Docsity

EDB PostgreSQL 13 Associate Exam, Exams of Technology

Toggle sidebar
bg1
EDB PostgreSQL 13 Associate Exam
Q1. What is PostgreSQL 13 primarily known as?
A. An open source relational database management system
B. A commercial NoSQL database
C. A file storage solution
D. A programming language interpreter
Correct Answer: A
Explanation: PostgreSQL is widely recognized as an open source relational database
management system (RDBMS) that is extensible and standards compliant.
Q2. Which aspect of PostgreSQL 13 is highlighted by its extensibility?
A. Fixed schema design
B. Ability to add custom data types and functions
C. Inability to support stored procedures
D. Restrictive licensing
Correct Answer: B
Explanation: PostgreSQL allows users to create custom data types, functions, and extensions,
making it highly extensible.
Q3. PostgreSQL’s history began with which influential project?
A. MySQL
B. Ingres
C. Oracle Database
D. IBM DB2
Correct Answer: B
Explanation: PostgreSQL evolved from the Ingres project, incorporating research on relational
models.
Q4. One key advantage of PostgreSQL is its support for ACID compliance. Which of the
following is NOT part of ACID?
A. Atomicity
B. Consistency
C. Isolation
D. Distribution
Correct Answer: D
Explanation: ACID stands for Atomicity, Consistency, Isolation, and Durability; distribution is
not included.
Q5. PostgreSQL 13 differentiates itself from many competitors by offering which of the
following?
A. Proprietary plugins only
B. Advanced indexing options such as GiST and GIN
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33

Partial preview of the text

Download EDB PostgreSQL 13 Associate Exam and more Exams Technology in PDF only on Docsity!

EDB PostgreSQL 13 Associate Exam

Q1. What is PostgreSQL 13 primarily known as? A. An open source relational database management system B. A commercial NoSQL database C. A file storage solution D. A programming language interpreter Correct Answer: A Explanation: PostgreSQL is widely recognized as an open source relational database management system (RDBMS) that is extensible and standards compliant. Q2. Which aspect of PostgreSQL 13 is highlighted by its extensibility? A. Fixed schema design B. Ability to add custom data types and functions C. Inability to support stored procedures D. Restrictive licensing Correct Answer: B Explanation: PostgreSQL allows users to create custom data types, functions, and extensions, making it highly extensible. Q3. PostgreSQL’s history began with which influential project? A. MySQL B. Ingres C. Oracle Database D. IBM DB Correct Answer: B Explanation: PostgreSQL evolved from the Ingres project, incorporating research on relational models. Q4. One key advantage of PostgreSQL is its support for ACID compliance. Which of the following is NOT part of ACID? A. Atomicity B. Consistency C. Isolation D. Distribution Correct Answer: D Explanation: ACID stands for Atomicity, Consistency, Isolation, and Durability; distribution is not included. Q5. PostgreSQL 13 differentiates itself from many competitors by offering which of the following? A. Proprietary plugins only B. Advanced indexing options such as GiST and GIN

C. Only basic SQL support D. Single-threaded query execution Correct Answer: B Explanation: PostgreSQL includes advanced indexing methods like GiST and GIN that enhance performance and search capabilities. Q6. Which component in PostgreSQL is responsible for parsing, planning, and executing queries? A. The storage manager B. The query optimizer C. The transaction log D. The configuration file Correct Answer: B Explanation: The query optimizer parses and plans the execution strategy for SQL queries to improve performance. Q7. What is one major benefit of PostgreSQL being open source? A. It requires expensive licensing fees B. It offers extensive community support and frequent updates C. It is closed to modifications D. It only supports a single operating system Correct Answer: B Explanation: The open source nature of PostgreSQL fosters community contributions, support, and continual enhancements. Q8. PostgreSQL supports multiple programming languages for stored procedures. Which is one of these languages? A. C# B. PL/pgSQL C. JavaScript D. Ruby Correct Answer: B Explanation: PL/pgSQL is PostgreSQL’s native procedural language used for writing stored procedures and functions. Q9. What does the “13” in PostgreSQL 13 denote? A. The number of supported languages B. The version release C. The number of built-in data types D. The default port number Correct Answer: B Explanation: The “13” indicates the release version of PostgreSQL, showing its evolution over time. Q10. PostgreSQL’s development is driven by which of the following? A. A single corporate entity

B. The configuration file only C. The system BIOS D. The network interface Correct Answer: A Explanation: The query planner and optimizer in PostgreSQL analyze queries to determine the most efficient execution plan. Q16. PostgreSQL is often compared with which database system due to its robust feature set? A. Microsoft Access B. Oracle Database C. Notepad D. Redis Correct Answer: B Explanation: PostgreSQL is commonly compared with Oracle Database as both are known for enterprise-level features and performance. Q17. What is a major reason many enterprises choose PostgreSQL 13? A. It is the only available database system B. It combines powerful features with a cost-effective, open source model C. It has minimal documentation D. It supports only simple queries Correct Answer: B Explanation: Enterprises favor PostgreSQL for its robust feature set, extensibility, and no licensing costs. Q18. The evolution of PostgreSQL over time is mainly due to what? A. A static codebase B. Regular community-driven enhancements and new features C. A lack of developer interest D. Frequent removal of features Correct Answer: B Explanation: PostgreSQL’s evolution is driven by contributions from a dedicated global community that adds new features and improvements. Q19. What is one of the historical milestones in PostgreSQL’s development? A. The introduction of PL/pgSQL in the early releases B. Its switch from open source to proprietary C. Dropping support for SQL standards D. The removal of transaction support Correct Answer: A Explanation: The addition of PL/pgSQL was a significant milestone that allowed for more complex business logic within the database. Q20. PostgreSQL 13’s architecture emphasizes separation between which of the following components?

A. User interface and hardware drivers B. Storage management and query processing C. File system and web server D. None of the above Correct Answer: B Explanation: PostgreSQL separates storage management from query processing, enabling better performance, reliability, and scalability. Q21. Which installation method for PostgreSQL 13 is most suited for a Linux environment? A. Using binary packages from the distribution’s repository B. Installing through Microsoft Store C. Downloading from an iOS App Store D. Running from a browser plugin Correct Answer: A Explanation: Linux distributions often provide binary packages in their repositories, making installation straightforward and efficient. Q22. What is a common prerequisite for installing PostgreSQL on any operating system? A. A specific graphics card B. Sufficient disk space and proper system libraries C. A proprietary license key D. Internet Explorer installed Correct Answer: B Explanation: Adequate disk space and required system libraries are essential prerequisites for a successful PostgreSQL installation. Q23. Which configuration file is critical for tuning PostgreSQL’s performance settings? A. my.cnf B. postgresql.conf C. httpd.conf D. config.ini Correct Answer: B Explanation: The postgresql.conf file is the main configuration file for adjusting PostgreSQL settings related to performance and behavior. Q24. What role does the pg_hba.conf file serve in PostgreSQL? A. It configures database replication B. It defines client authentication rules C. It manages memory allocation D. It handles indexing methods Correct Answer: B Explanation: The pg_hba.conf file controls client authentication, determining which hosts can connect and how.

Q30. Which package manager might be used to install PostgreSQL on a Debian-based Linux distribution? A. yum B. apt C. brew D. pacman Correct Answer: B Explanation: Debian-based systems use the apt package manager to install software, including PostgreSQL. Q31. When installing PostgreSQL on Windows, which tool is commonly used? A. Windows Installer (MSI) package B. Linux shell script C. Android APK installer D. iOS configuration profile Correct Answer: A Explanation: Windows users typically install PostgreSQL using an MSI package provided by the PostgreSQL Global Development Group. Q32. Which configuration parameter would you adjust to optimize PostgreSQL for a high- transaction workload? A. shared_buffers B. clock_speed C. disk_partition D. language_pack Correct Answer: A Explanation: Increasing shared_buffers can help manage high transactional loads by allowing more data caching in memory. Q33. Which file would you edit to change client authentication settings in PostgreSQL? A. postgresql.conf B. pg_hba.conf C. recovery.conf D. replication.conf Correct Answer: B Explanation: The pg_hba.conf file controls client authentication and connection permissions. Q34. What is the purpose of configuring WAL (Write-Ahead Logging) during installation? A. To speed up web page loading B. To ensure data integrity and support crash recovery C. To manage user roles D. To format output in the command line Correct Answer: B Explanation: WAL is essential for ensuring that all changes are recorded for recovery in case of a system failure.

Q35. When troubleshooting installation issues, which of the following is a first step? A. Immediately reinstall the operating system B. Review installation logs and error messages C. Disable the firewall permanently D. Delete all configuration files Correct Answer: B Explanation: Checking installation logs and error messages provides clues to what might have gone wrong and guides the troubleshooting process. Q36. Which installation method allows for the most customization of PostgreSQL features? A. Using pre-built binary packages B. Installing from source C. Using a mobile app installer D. Running a browser-based demo Correct Answer: B Explanation: Building PostgreSQL from source enables fine-tuning of build options and inclusion of custom modules. Q37. What is a typical system requirement for installing PostgreSQL 13 on any platform? A. A minimum of 256 MB of RAM B. A compatible operating system and sufficient disk space C. A specific graphics processing unit (GPU) D. A dedicated sound card Correct Answer: B Explanation: A proper operating system along with enough disk space and memory is required for a stable PostgreSQL installation. Q38. For enhanced security during installation, which of the following is recommended? A. Disabling all network connections B. Configuring secure authentication methods and access rules C. Running PostgreSQL as a root user D. Leaving default settings unchanged Correct Answer: B Explanation: Secure authentication and properly defined access rules help protect the database from unauthorized connections. Q39. What is the first step in creating a new database in PostgreSQL? A. Modifying the postgresql.conf file B. Running the CREATE DATABASE command C. Restarting the server D. Editing the pg_hba.conf file Correct Answer: B Explanation: The CREATE DATABASE command is used to initialize a new database instance within PostgreSQL.

B. Through GRANT and REVOKE statements C. By modifying the postgresql.conf file D. With the ALTER SCHEMA command only Correct Answer: B Explanation: Permissions are managed using GRANT and REVOKE, which assign and remove access rights on database objects. Q46. Which command would you use to view the structure of a table in PostgreSQL? A. DESCRIBE tablename; B. \d tablename C. SHOW tablename; D. EXPLAIN tablename; Correct Answer: B Explanation: The \d command in psql displays the table structure, including columns, types, and indexes. Q47. What distinguishes a materialized view from a regular view in PostgreSQL? A. Materialized views do not store any data B. Materialized views store query results physically C. Regular views require manual refresh D. Regular views are read-only Correct Answer: B Explanation: Materialized views cache query results on disk, making data retrieval faster for complex queries. Q48. When creating a table, what does the term “constraint” refer to in PostgreSQL? A. A limit on the number of rows B. Rules applied to column data to ensure data integrity C. A type of backup procedure D. A method for indexing Correct Answer: B Explanation: Constraints are rules such as primary keys, foreign keys, and unique restrictions that enforce data integrity. Q49. How can you add a new column to an existing table in PostgreSQL? A. MODIFY TABLE B. ALTER TABLE ADD COLUMN C. UPDATE TABLE ADD COLUMN D. INSERT COLUMN Correct Answer: B Explanation: The ALTER TABLE ADD COLUMN command is used to modify a table structure by adding a new column. Q50. What is the purpose of defining data types for columns in a PostgreSQL table? A. To determine the file format B. To enforce the kind of data that can be stored

C. To speed up the internet connection D. To generate random data automatically Correct Answer: B Explanation: Data types ensure that only data conforming to specified types (e.g., integer, text) is stored, preserving data integrity. Q51. Which of the following is an advantage of using schemas in PostgreSQL? A. They limit the number of available data types B. They allow logical separation and organization of database objects C. They reduce the overall database size automatically D. They provide encryption by default Correct Answer: B Explanation: Schemas help organize and isolate database objects, making management and security easier. Q52. In PostgreSQL, how do you remove a table from a database? A. DELETE TABLE tablename; B. DROP TABLE tablename; C. REMOVE TABLE tablename; D. CLEAR TABLE tablename; Correct Answer: B Explanation: The DROP TABLE command permanently removes a table and its data from the database. Q53. What is a foreign key in PostgreSQL used for? A. To generate random numbers B. To link rows between two tables ensuring referential integrity C. To store large objects D. To create full-text indexes Correct Answer: B Explanation: A foreign key creates a relationship between two tables, ensuring that the key value exists in the referenced table. Q54. How do you view all roles in a PostgreSQL database? A. SELECT * FROM roles; B. \du command in psql C. LIST ROLES; D. SHOW USERS; Correct Answer: B Explanation: The \du command in the psql interface displays all database roles along with their attributes. Q55. Which SQL command is used to grant privileges to a user on a table? A. PERMIT B. GRANT C. ALLOW

Explanation: JSONB stores data in a binary format, allowing for faster access and more efficient indexing compared to JSON. Q61. Which of the following PostgreSQL data types would you use to store true/false values? A. BOOLEAN B. INTEGER C. VARCHAR D. TEXT Correct Answer: A Explanation: The BOOLEAN data type is specifically designed to store TRUE or FALSE values. Q62. What is an enumerated type in PostgreSQL used for? A. To store a list of fixed values B. To perform arithmetic operations C. To manage time zones D. To create full-text search indexes Correct Answer: A Explanation: Enumerated types define a static set of valid values, ensuring data consistency. Q63. Which function would you use to convert a string to uppercase in PostgreSQL? A. lower() B. initcap() C. upper() D. capitalize() Correct Answer: C Explanation: The upper() function converts a string to uppercase characters. Q64. What is the purpose of using custom functions in PostgreSQL? A. To perform repetitive tasks and complex calculations B. To change the database storage format C. To install new software D. To manage network connections Correct Answer: A Explanation: Custom functions allow you to encapsulate logic for repetitive tasks, calculations, and business rules within the database. Q65. In PostgreSQL, which language is primarily used for writing custom functions? A. Python B. PL/pgSQL C. JavaScript D. C++ Correct Answer: B Explanation: PL/pgSQL is PostgreSQL’s native procedural language designed for writing custom functions and stored procedures.

Q66. How would you create a custom function that returns an integer in PostgreSQL? A. USING CREATE FUNCTION with a defined return type B. With the INSERT command C. By modifying the postgresql.conf file D. Through the GRANT statement Correct Answer: A Explanation: The CREATE FUNCTION command allows you to define a function along with its return type and body. Q67. Which operator in PostgreSQL is used for string concatenation? A. || B. ++ C. && D. %% Correct Answer: A Explanation: In PostgreSQL, the double pipe (||) operator is used to concatenate strings. Q68. Which PostgreSQL function is used for extracting a substring from a string? A. extract() B. substring() C. part() D. split() Correct Answer: B Explanation: The substring() function allows you to extract a portion of a string based on specified parameters. Q69. What advantage does using built-in functions in PostgreSQL provide? A. They are less efficient than custom code B. They simplify complex operations and enhance performance C. They restrict data manipulation D. They disable indexing Correct Answer: B Explanation: Built-in functions are optimized for performance and help simplify complex SQL operations. Q70. Which PostgreSQL data type is appropriate for storing dates and times? A. TIMESTAMP B. BOOLEAN C. INTERVAL D. VARCHAR Correct Answer: A Explanation: The TIMESTAMP data type is designed to store both date and time information. Q71. How can you cast a value from one data type to another in PostgreSQL? A. Using the CAST() function or :: operator B. By modifying the data dictionary

D. To disable built-in functions Correct Answer: B Explanation: Custom data types allow you to represent complex business data and enforce specific constraints that are not covered by standard types. Q77. Which of the following is an example of a built-in PostgreSQL function for date manipulation? A. date_trunc() B. string_trunc() C. number_round() D. text_format() Correct Answer: A Explanation: The date_trunc() function truncates a timestamp to a specified precision, making it useful for date manipulations. Q78. How do operators enhance SQL queries in PostgreSQL? A. They are not used in SQL queries B. They allow for concise syntax to perform operations like concatenation and comparison C. They slow down query performance D. They replace the need for functions Correct Answer: B Explanation: Operators provide a shorthand method for common operations, making queries easier to write and read. Q79. Which statement is a Data Definition Language (DDL) command in PostgreSQL? A. SELECT B. CREATE TABLE C. INSERT D. UPDATE Correct Answer: B Explanation: CREATE TABLE is a DDL command used to define and create a new table structure in the database. Q80. Which of the following commands is used for modifying an existing table structure? A. ALTER TABLE B. UPDATE TABLE C. MODIFY TABLE D. CHANGE TABLE Correct Answer: A Explanation: ALTER TABLE allows changes to the structure of an existing table, such as adding or dropping columns. Q81. What does the DROP command do in PostgreSQL? A. It creates new database objects B. It permanently removes database objects C. It temporarily hides data

D. It archives old records Correct Answer: B Explanation: DROP is a DDL command that permanently deletes database objects such as tables, views, or databases. Q82. Which SQL command is part of the Data Manipulation Language (DML) in PostgreSQL? A. CREATE DATABASE B. INSERT C. DROP INDEX D. ALTER TABLE Correct Answer: B Explanation: INSERT is a DML command used to add new rows to a table, manipulating the actual data stored. Q83. Which DML statement is used to update existing data in a table? A. SELECT B. UPDATE C. DELETE D. INSERT Correct Answer: B Explanation: The UPDATE statement modifies existing records in a table based on specified conditions. Q84. In PostgreSQL, what is the purpose of a transaction? A. To group multiple operations into a single unit of work B. To back up the database C. To store data in a different format D. To run queries faster Correct Answer: A Explanation: Transactions ensure that a group of operations either all succeed or all fail, maintaining data integrity. Q85. Which property of transactions ensures that even if an error occurs, the database remains consistent? A. Atomicity B. Isolation C. Durability D. Consistency Correct Answer: A Explanation: Atomicity guarantees that a transaction is treated as a single unit, meaning all operations must complete successfully or none do. Q86. What does the COMMIT command do in PostgreSQL transactions? A. It discards all changes made during the transaction B. It permanently saves all changes made during the transaction

D. Random partitioning Correct Answer: C Explanation: Range partitioning divides data into partitions based on a continuous range of values, optimizing queries that use range conditions. Q92. What is the purpose of table partitioning in PostgreSQL? A. To combine multiple tables into one B. To improve query performance and manage large datasets C. To create duplicate records D. To encrypt data automatically Correct Answer: B Explanation: Partitioning a table can enhance performance by limiting the amount of data scanned during queries and improving manageability. Q93. Which command can help you see how PostgreSQL executes a query? A. DESCRIBE B. EXPLAIN C. SHOW PLAN D. QUERY_ANALYZE Correct Answer: B Explanation: The EXPLAIN command provides insight into the query execution plan, helping to identify potential performance issues. Q94. In a complex query, what is the role of a subquery? A. To create a new table B. To nest one query inside another to provide intermediate results C. To update multiple tables simultaneously D. To generate user roles Correct Answer: B Explanation: Subqueries allow one query to be embedded within another, offering a way to compute intermediate results for further filtering. Q95. What are window functions in PostgreSQL used for? A. To update table partitions B. To perform calculations across sets of rows related to the current row C. To create physical partitions in data D. To manage user sessions Correct Answer: B Explanation: Window functions enable calculations (such as running totals or moving averages) across a set of rows while retaining individual row details. Q96. Which PostgreSQL clause allows you to define a temporary result set for use within a query? A. WITH (Common Table Expressions) B. TEMPORARY C. USING

D. GROUP BY

Correct Answer: A Explanation: The WITH clause, also known as Common Table Expressions (CTEs), defines temporary result sets that can be referenced within a larger query. Q97. What does the GROUP BY clause do in an SQL query? A. It groups rows that share a property so that aggregate functions can be applied B. It sorts data in ascending order C. It limits the number of rows returned D. It creates duplicate records Correct Answer: A Explanation: GROUP BY is used to aggregate data based on one or more columns, making it easier to summarize and analyze large datasets. Q98. How does the HAVING clause differ from WHERE in PostgreSQL? A. HAVING is used for filtering aggregated data, while WHERE filters rows before aggregation B. HAVING can only be used with DELETE commands C. WHERE is for sorting data D. They are interchangeable Correct Answer: A Explanation: The WHERE clause filters rows prior to aggregation, whereas HAVING filters the results after an aggregation has been performed. Q99. Which PostgreSQL feature enables the creation of recursive queries? A. Subqueries only B. Recursive Common Table Expressions (CTEs) C. Stored procedures D. Indexes Correct Answer: B Explanation: Recursive CTEs allow a query to refer to its own output, making it possible to traverse hierarchical data. Q100. What is the main purpose of query optimization in PostgreSQL? A. To increase database size B. To improve the efficiency and speed of query execution C. To disable logging D. To create new indexes automatically Correct Answer: B Explanation: Query optimization refines the execution plan to reduce processing time and resource usage, thus improving performance. Q101. How do indexes contribute to query performance in PostgreSQL? A. They store duplicate data B. They allow the database to find rows more quickly without scanning the entire table C. They slow down write operations D. They replace the need for a primary key