PostgreSQL Database Quiz Questions

Course Name:PostgreSQL
Chapter Name:Chapter 2 - Introduction to Software Applications
Lesson Content Link:GUI tools for SQL Development
Current Quiz Count:30
Progress
0%
Q1
True / False

PostgreSQL does not have any official GUI tools for SQL development.

Q2
True / False

pgAdmin is a web-based GUI tool for managing PostgreSQL databases.

Q3
True / False

pgAdmin can only be used on Windows operating systems.

Q4
True / False

DBeaver is a popular third-party GUI tool that supports PostgreSQL.

Q5
True / False

DataGrip, an IDE from JetBrains, does not support PostgreSQL.

Q6
True / False

pgAdmin provides a visual query builder for users who prefer not to write SQL queries manually.

Q7
True / False

pgAdmin supports server monitoring and management features for PostgreSQL databases.

Q8
True / False

pgAdmin does not support the creation and management of PostgreSQL roles and permissions.

Q9
True / False

Advanced users can use the PostgreSQL extension in Visual Studio Code for SQL development.

Q10
True / False

Certification exams for PostgreSQL professionals often include questions about using pgAdmin for database administration tasks.

Q11
Single Choice

Which MySQL Database GUI tool allows users to visually design databases using an ERD (Entity-Relationship Diagram)?

Q12
Single Choice

In MySQL Workbench, which feature allows you to write and execute SQL queries directly?

Q13
Single Choice

Which MySQL tool provides a web interface for managing MySQL databases, including running SQL queries, managing users, and importing/exporting data?

Q14
Single Choice

In MySQL Workbench, what does the following SQL code do when executed from the SQL Editor?

SQL Code
CREATE DATABASE example_db;
USE example_db;
Q15
Single Choice

Which feature of MySQL Workbench allows users to perform reverse engineering on an existing database?

Q16
Single Choice

When using the SQL Editor in MySQL Workbench, what will the following SQL query return?

SQL Code
SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'example_db';
Q17
Single Choice

Which MySQL GUI tool allows creating and managing replication setups directly through a graphical interface?

Q18
Single Choice

How does the following SQL script executed from MySQL Workbench's SQL Editor contribute to performance tuning?

SQL Code
EXPLAIN SELECT * FROM orders WHERE order_date > '2024-01-01';
Q19
Single Choice

In MySQL Workbench, how can you synchronize the model with the database?

Q20
Single Choice

What is the main advantage of using MySQL Workbench over command-line tools for database administration in a production environment?

Q21
Multiple Choice

Which of the following SQL queries is correctly formatted and would typically be executed using a PostgreSQL GUI tool?

SQL Code
SELECT username, email
FROM users
WHERE created_at > '2024-01-01'
ORDER BY username ASC;
Q22
Multiple Choice

Which SQL command should be used within a PostgreSQL GUI tool to create a new table with a unique constraint on a column?

SQL Code
CREATE TABLE employees (
 employee_id SERIAL PRIMARY KEY,
 name VARCHAR(100) NOT NULL,
 email VARCHAR(100) UNIQUE NOT NULL,
 hire_date DATE NOT NULL
);
Q23
Multiple Choice

Which SQL command is correctly used to generate a database view within a PostgreSQL GUI tool?

SQL Code
CREATE VIEW active_employees AS
SELECT name, email
FROM employees
WHERE active = TRUE;
Q24
Multiple Choice

Which SQL query is correctly formatted for generating a report on sales data using a PostgreSQL GUI tool?

SQL Code
SELECT product_name, SUM(quantity_sold) AS total_sold
FROM sales
GROUP BY product_name
ORDER BY total_sold DESC;
Q25
Multiple Choice

Which SQL command is properly formatted to alter a table by adding a new column using a PostgreSQL GUI tool?

SQL Code
ALTER TABLE customers
ADD COLUMN last_purchase_date DATE;
Q26
Multiple Choice

In a PostgreSQL GUI tool, which SQL command would you use to create a stored procedure that calculates and returns the total sales for a given period?

SQL Code
CREATE OR REPLACE FUNCTION total_sales(start_date DATE, end_date DATE)
RETURNS NUMERIC AS $$
BEGIN
 RETURN (SELECT SUM(amount) FROM sales WHERE sale_date BETWEEN start_date AND end_date);
END;
$$ LANGUAGE plpgsql;
Q27
Multiple Choice

Which SQL command should be executed in a PostgreSQL GUI tool to set up a trigger that logs changes to a table?

SQL Code
CREATE TRIGGER log_changes
AFTER INSERT OR UPDATE OR DELETE ON employees
FOR EACH ROW EXECUTE FUNCTION log_employee_changes();
Q28
Multiple Choice

Which SQL query is correctly formatted to join two tables and is typically executed using a PostgreSQL GUI tool?

SQL Code
SELECT employees.name, departments.department_name
FROM employees
JOIN departments ON employees.department_id = departments.department_id;
Q29
Multiple Choice

Which SQL command should be executed in a PostgreSQL GUI tool to back up a specific database?

SQL Code
pg_dump -U postgres -d app_db -F c -f /path/to/backup/app_db.backup
Q30
Multiple Choice

In a PostgreSQL GUI tool, which SQL command would be used to restore a database from a backup file?

SQL Code
pg_restore -U postgres -d app_db -F c /path/to/backup/app_db.backup