




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































Question 1. What is the primary purpose of a primary key in a relational table? A) To enforce uniqueness of a column’s values B) To provide a default value for a column C) To store large binary objects D) To speed up full‑table scans Answer: A Explanation: A primary key uniquely identifies each row and automatically creates a unique index, ensuring no duplicate values.
Question 2. Which constraint guarantees that a column cannot contain NULL values? A) UNIQUE B) CHECK C) NOT NULL D) FOREIGN KEY Answer: C
Explanation: The NOT NULL constraint forbids NULL entries, ensuring that every row supplies a value for the column.
Question 3. In EPAS, which process is responsible for listening for client connections? A) backend process B) postmaster (or postgresql) C) autovacuum worker D) walwriter Answer: B Explanation: The postmaster (also called the postgresql process) accepts TCP connections and spawns backend processes to handle them.
Question 4. What does the Write‑Ahead Log (WAL) ensure in EPAS? A) Immediate data visibility to other sessions B) That changes are written to disk before the data files are updated
Question 6. Which index type is best suited for full‑text search in EPAS? A) B‑tree B) Hash C) GIN D) GiST Answer: C Explanation: GIN (Generalized Inverted Index) efficiently supports full‑text search operators and array containment.
Question 7. What does the pg_hba.conf file control? A) Database schema definitions B) Server memory allocation C) Client authentication methods and rules D) Automatic vacuum settings Answer: C
Explanation: pg_hba.conf defines which authentication method (trust, md5, scram‑sha‑256, etc.) applies to which client connections.
Question 8. Which command-line utility is used to create a logical backup of a single database? A) pg_basebackup B) pg_dump C) pg_restore D) pg_ctl Answer: B Explanation: pg_dump produces a logical dump (SQL statements) of a single database, which can be restored with psql or pg_restore.
Question 9. Which statement correctly adds a NOT NULL constraint to an existing column? A) ALTER TABLE t ALTER COLUMN c SET NOT NULL; B) ALTER TABLE t MODIFY c NOT NULL;
Question 11. What does the “autovacuum” daemon primarily prevent? A) Disk fragmentation B) Transaction ID wraparound and table bloat C) Unauthorized access D) Data corruption due to power loss Answer: B Explanation: Autovacuum reclaims dead tuples and freezes transaction IDs, preventing wraparound and excessive bloat.
Question 12. Which SQL clause limits the number of rows returned by a query? A) WHERE B) HAVING C) LIMIT D) OFFSET Answer: C
Explanation: LIMIT restricts the maximum number of rows returned; OFFSET can be combined to skip rows.
Question 13. In EPAS, which feature provides Oracle‑compatible PL/SQL packages? A) EDB Advanced Server Compatibility (EAS) B) Oracle Compatibility Layer (OCL) C) EnterpriseDB Compatibility (EDC) D) EDB‑Oracle Compatibility (EOC) Answer: A Explanation: The EDB Advanced Server Compatibility layer supplies PL/SQL packages, synonyms, and built‑in functions to ease Oracle migration.
Question 14. Which command shows a list of all databases in the cluster from psql? A) \l B) \d
Question 16. Which of the following statements creates a sequence named order_seq starting at 1000? A) CREATE SEQUENCE order_seq START 1000; B) CREATE SEQUENCE order_seq INCREMENT BY 1000; C) CREATE SEQUENCE order_seq MINVALUE 1000; D) CREATE SEQUENCE order_seq START WITH 1000; Answer: D Explanation: START WITH specifies the initial value for the sequence; the other options set increment or minimum values.
Question 17. Which PostgreSQL configuration parameter controls the maximum number of concurrent connections? A) max_worker_processes B) max_connections C) max_locks_per_transaction D) shared_buffers Answer: B
Explanation: max_connections defines how many client connections the server will accept simultaneously.
Question 18. What does the “\timing” meta‑command in psql do? A) Enables display of query execution time. B) Shows the current server time zone. C) Times how long a transaction lasts. D) Starts a stopwatch for manual timing. Answer: A Explanation: \timing toggles the display of elapsed execution time for each query run in the psql session.
Question 19. Which clause is required to filter groups after aggregation? A) WHERE B) HAVING C) GROUP BY
Question 21. Which of the following is true about the “pg_basebackup” utility? A) It produces a logical dump in SQL format. B) It creates a physical copy of the data directory suitable for standby servers. C) It can only back up a single table. D) It requires the server to be shut down. Answer: B Explanation: pg_basebackup streams a physical backup of the entire cluster, making it ideal for setting up streaming replicas.
Question 22. What does the “pg_restore – c” option do? A) Compresses the restored data. B) Continues on error. C) Drops the target database before restoring. D) Creates a new connection for each table. Answer: C
Explanation: The - c (or --clean) flag issues DROP statements before recreating objects, ensuring a clean restore.
Question 23. Which SQL statement creates a view that shows only active customers from the customers table? A) CREATE VIEW active_cust AS SELECT * FROM customers WHERE status='active'; B) CREATE MATERIALIZED VIEW active_cust SELECT * FROM customers WHERE status='active'; C) CREATE VIEW active_cust FROM customers WHERE status='active'; D) CREATE VIEW active_cust AS customers WHERE status='active'; Answer: A Explanation: The proper syntax uses CREATE VIEW … AS SELECT … WHERE … to define a view based on a query.
Question 24. Which command changes the owner of a schema to a different role? A) ALTER SCHEMA schema_name OWNER TO new_owner;
Question 26. What is the effect of setting “default_transaction_isolation = serializable” in postgresql.conf? A) All transactions run with READ COMMITTED isolation. B) Transactions can see uncommitted changes. C) The server enforces the strictest isolation level, preventing phantom reads. D) It disables MVCC. Answer: C Explanation: SERIALIZABLE is the highest isolation level, guaranteeing that concurrent transactions behave as if executed serially.
Question 27. Which function returns the current transaction ID? A) txid_current() B) transaction_id() C) curr_txid() D) pg_transaction_id()
Answer: A Explanation: txid_current() returns the 64‑bit transaction identifier for the current session.
Question 28. Which of the following statements correctly creates a table partitioned by RANGE on a date column? A) CREATE TABLE sales (sale_id INT, sale_date DATE) PARTITION BY RANGE (sale_date); B) CREATE TABLE sales PARTITION BY RANGE (sale_date) (sale_id INT); C) CREATE TABLE sales (sale_id INT, sale_date DATE) PARTITION BY LIST (sale_date); D) CREATE TABLE sales PARTITIONED BY RANGE (sale_date) (sale_id INT); Answer: A Explanation: The syntax specifies the table definition followed by PARTITION BY RANGE (column).
Question 29. Which command grants SELECT privilege on a table to a role named analyst?
Question 31. Which command disables a role’s ability to log in without dropping it? A) ALTER ROLE user NOLOGIN; B) REVOKE LOGIN FROM user; C) ALTER ROLE user WITH NOLOGIN; D) Both A and C are valid. Answer: D Explanation: Both “ALTER ROLE user NOLOGIN” and “ALTER ROLE user WITH NOLOGIN” achieve the same effect.
Question 32. When using “INSERT … SELECT”, which of the following is true? A) The SELECT must return exactly one row. B) The column order in the SELECT must match the target table’s column order unless column list is specified. C) INSERT … SELECT cannot be used with a WHERE clause. D) It always creates a new transaction.
Answer: B Explanation: Without an explicit column list, the SELECT’s column order must align with the target table’s columns.
Question 33. Which parameter controls how often the autovacuum daemon runs the vacuum analyze cycle? A) autovacuum_naptime B) autovacuum_vacuum_threshold C) autovacuum_analyze_scale_factor D) autovacuum_max_workers Answer: A Explanation: autovacuum_naptime defines the pause between autovacuum launcher checks.
Question 34. What is the purpose of the “pg_total_relation_size()” function?