PostgreSQL Database Quiz Questions

Course Name:PostgreSQL
Chapter Name:Chapter 4 - Setup Sample Database
Lesson Content Link:Database Hosting
Current Quiz Count:30
Progress
0%
Q1
True / False

PostgreSQL can only be hosted on Linux operating systems.

Q2
True / False

PostgreSQL hosting in the cloud is limited to only Amazon Web Services (AWS).

Q3
True / False

PostgreSQL offers native support for clustering and replication.

Q4
True / False

PostgreSQL's default port for database connections is 5433.

Q5
True / False

PostgreSQL supports hosting databases with multi-tenant architectures using schemas.

Q6
True / False

In PostgreSQL, the pgAdmin tool is not capable of remote database management.

Q7
True / False

PostgreSQL's native backup tool, pg_dump, supports parallel backups for faster performance.

Q8
True / False

PostgreSQL does not support hosting in containers using Docker.

Q9
True / False

PostgreSQL supports logical replication, which allows selective replication of specific tables or even specific columns.

Q10
True / False

PostgreSQL allows setting up replication slots to ensure data consistency during streaming replication.

Q11
Single Choice

Which of the following MySQL hosting options allows you to run MySQL on a cloud provider's infrastructure without managing the underlying hardware?

Q12
Single Choice

What does the acronym "RDS" stand for in Amazon's MySQL hosting service?

Q13
Single Choice

In which hosting environment would you typically need to manage your MySQL backups manually?

Q14
Single Choice

Which of the following SQL statements would you use to check the status of a MySQL replication setup on a hosted environment?

Q15
Single Choice

In a MySQL managed hosting environment, which SQL command would you use to grant remote access to a user?

Q16
Single Choice

Which MySQL configuration parameter is crucial for performance optimization in a cloud-hosted environment?

Q17
Single Choice

When using MySQL in a cloud environment with high availability (HA), which feature ensures automatic failover in case the primary instance fails?

Q18
Single Choice

Which of the following SQL commands would you use to monitor the performance of your MySQL database in a cloud-hosted environment?

Q19
Single Choice

In a distributed MySQL environment, which feature allows you to distribute read operations across multiple database instances to improve performance?

Q20
Single Choice

Which of the following strategies would you use in a cloud-hosted MySQL environment to ensure minimal downtime during a planned maintenance window?

Q21
Multiple Choice

Which SQL command is used to create a sample database for hosting in PostgreSQL?

SQL Code
CREATE DATABASE sample_db
WITH OWNER = sample_user
ENCODING = 'UTF8'
LC_COLLATE = 'en_US.UTF-8'
LC_CTYPE = 'en_US.UTF-8'
TEMPLATE = template0;
Q22
Multiple Choice

Which SQL command correctly sets up a user role for managing a hosted PostgreSQL database?

SQL Code
CREATE ROLE db_admin
WITH LOGIN PASSWORD 'secure_password'
CREATEDB CREATEROLE;
Q23
Multiple Choice

Which SQL query grants all privileges on a sample database to a specific role in PostgreSQL?

SQL Code
GRANT ALL PRIVILEGES ON DATABASE sample_db TO db_admin;
Q24
Multiple Choice

Which SQL command in PostgreSQL would you use to connect to a hosted database named 'sample_db'?

SQL Code
psql -U sample_user -d sample_db -h localhost -p 5432
Q25
Multiple Choice

Which SQL command is used to list all databases on a PostgreSQL host?

SQL Code
\l
Q26
Multiple Choice

Which SQL command would you use to back up a sample database hosted on a PostgreSQL server?

SQL Code
pg_dump -U sample_user -d sample_db -F c -f /path/to/backup/sample_db.backup
Q27
Multiple Choice

Which SQL command would you use to restore a PostgreSQL database from a backup?

SQL Code
pg_restore -U sample_user -d sample_db -F c /path/to/backup/sample_db.backup
Q28
Multiple Choice

Which SQL query lists all tables in a specific schema of a hosted PostgreSQL database?

SQL Code
SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'public';
Q29
Multiple Choice

Which SQL command would you use to change the owner of a hosted PostgreSQL database?

SQL Code
ALTER DATABASE sample_db OWNER TO new_owner;
Q30
Multiple Choice

Which SQL command in PostgreSQL terminates all connections to a specific database before performing maintenance tasks?

SQL Code
SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity
WHERE datname = 'sample_db' AND pid <> pg_backend_pid();