PostgreSQL Database Quiz Questions

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

PostgreSQL is an open-source relational database management system (RDBMS).

Q2
True / False

PostgreSQL cannot be used for storing unstructured data.

Q3
True / False

The default port for PostgreSQL is 3306.

Q4
True / False

PostgreSQL supports advanced data types such as arrays, hstore, and JSON.

Q5
True / False

PostgreSQL does not support ACID (Atomicity, Consistency, Isolation, Durability) transactions.

Q6
True / False

PostgreSQL's procedural language PL/pgSQL allows for the creation of functions and triggers.

Q7
True / False

PostgreSQL has built-in support for full-text search capabilities.

Q8
True / False

PostgreSQL's foreign data wrappers (FDW) allow it to query data from other databases, including non-relational ones.

Q9
True / False

PostgreSQL does not support partitioning tables.

Q10
True / False

PostgreSQL's MVCC (Multiversion Concurrency Control) mechanism helps in achieving high concurrency and performance in transactional workloads.

Q11
Single Choice

What is the primary role of MySQL in application software?

Q12
Single Choice

Which MySQL statement is used in application software to fetch data from a database table?

Q13
Single Choice

In an e-commerce application, which MySQL operation would be used to add a new product to the inventory table?

Q14
Single Choice

Which MySQL statement would you use to modify the price of a product in an inventory management application?

SQL Code
UPDATE products
SET price = 19.99
WHERE product_id = 101;
Q15
Single Choice

In a customer relationship management (CRM) application, which MySQL clause is used to filter customer records based on specific criteria?

SQL Code
SELECT * FROM customers
WHERE status = 'active';
Q16
Single Choice

How would you retrieve the total number of orders placed by a customer in an online shopping application using MySQL?

SQL Code
SELECT COUNT(*)
FROM orders
WHERE customer_id = 25;
Q17
Single Choice

In a MySQL-based financial application, which statement would you use to roll back a transaction if an error occurs while transferring funds?

Q18
Single Choice

Which MySQL feature allows an application to ensure that two transactions do not interfere with each other?

Q19
Single Choice

In a MySQL-driven analytics application, how can you optimize a query to retrieve only unique records from a large dataset?

SQL Code
SELECT DISTINCT customer_id
FROM transactions;
Q20
Single Choice

In a MySQL-powered application, which of the following would be the most efficient way to ensure data consistency when multiple users are updating the same table concurrently?

Q21
Multiple Choice

Identify the correct PostgreSQL statement that creates a function related to application software management.

SQL Code
CREATE OR REPLACE FUNCTION calculate_storage()
RETURNS integer AS $$
DECLARE
 total_storage integer;
BEGIN
 total_storage := 0;
 RETURN total_storage;
END;
$$ LANGUAGE plpgsql;
Q22
Multiple Choice

Which of the following queries correctly handles data storage for an application software module in PostgreSQL?

SQL Code
INSERT INTO app_storage
SELECT id, name, data_size
FROM application_data
WHERE data_size > 100;
Q23
Multiple Choice

Determine the PostgreSQL query that correctly updates the application software's versioning information.

SQL Code
UPDATE application_version
SET version = '2.0'
WHERE app_id = 1;
Q24
Multiple Choice

Select the correct PostgreSQL command that retrieves information from the application logs table.

SQL Code
SELECT log_time, log_message
FROM application_logs
WHERE log_level = 'ERROR';
Q25
Multiple Choice

Identify the correct PostgreSQL query that removes obsolete entries from an application software's database table.

SQL Code
DELETE FROM obsolete_data
WHERE last_used < '2023-01-01';
Q26
Multiple Choice

Choose the PostgreSQL command that properly alters the structure of a table used in application software.

SQL Code
ALTER TABLE user_data
ADD COLUMN last_login TIMESTAMP;
Q27
Multiple Choice

Determine the correct PostgreSQL command that aggregates data for application usage reporting.

SQL Code
SELECT app_id, COUNT(*) AS usage_count
FROM app_usage_logs
GROUP BY app_id;
Q28
Multiple Choice

Which PostgreSQL statement is correctly used to create a view for application software data?

SQL Code
CREATE VIEW app_summary AS
SELECT app_id, app_name, COUNT(*) AS total_usage
FROM app_usage_logs
GROUP BY app_id, app_name;
Q29
Multiple Choice

Identify the PostgreSQL command that updates multiple application software modules' status in a single query.

SQL Code
UPDATE application_modules
SET status = 'inactive'
WHERE module_id IN (1, 2, 3);
Q30
Multiple Choice

Choose the correct PostgreSQL command for joining two tables related to application software data.

SQL Code
SELECT a.app_id, a.app_name, u.usage_count
FROM applications a
JOIN usage_stats u
ON a.app_id = u.app_id;