PostgreSQL Objective Questions & Answers for Beginners Set-3
1. What does the "HAVING" clause typically follow in a SQL query?
Explanation: The "HAVING" clause is used to filter rows after they have been grouped using the "GROUP BY" clause in a SQL query.
2. Which PostgreSQL data type is used to store binary data?
Explanation: The "BYTEA" data type in PostgreSQL is used to store binary data, such as images or documents.
3. What is the purpose of the "LIMIT" clause in a SQL query?
Explanation: The "LIMIT" clause is used to restrict the number of rows returned by a query.
4. In PostgreSQL, which data type is used to store large text or character data?
Explanation: The "TEXT" data type is used to store large text or character data in PostgreSQL.
5. What is the primary purpose of database normalization?
Explanation: Database normalization is a process that organizes data to minimize redundancy and improve data integrity.
6. Which PostgreSQL data type is used to store large numeric values?
Explanation: The "NUMERIC" data type is used to store large precision numeric values in PostgreSQL.
7. What is the role of the "CASCADE" option when defining foreign key constraints?
Explanation: The "CASCADE" option specifies that when a referenced record is deleted, all associated records that depend on it will also be deleted.
8. In PostgreSQL, which operator is used to concatenate strings?
Explanation: The "||" operator is used for string concatenation in PostgreSQL.
9. What is the purpose of the PostgreSQL "pg_hba.conf" file?
Explanation: The "pg_hba.conf" file is used to configure client authentication methods for PostgreSQL.
10. What is the purpose of the PostgreSQL "pg_ctl" utility?
Explanation: The "pg_ctl" utility is used to start and stop the PostgreSQL database server.
11. Which SQL function is used to count the number of rows in a table?
Explanation: The "COUNT(*)" function is used to count the number of rows in a table.
12. What is the purpose of the "RAISE" statement in PostgreSQL?
Explanation: The "RAISE" statement is used to signal an error and terminate the execution of a function or block in PostgreSQL.
13. What does the PostgreSQL "pg_stat_statements" module provide?
Explanation: The "pg_stat_statements" module in PostgreSQL provides real-time statistics about executed SQL statements, helping to analyze query performance.
14. In PostgreSQL, what is a "subquery"?
Explanation: A subquery is a query that is embedded within another query and is used to retrieve data for use in the main query.
15. What is the purpose of the "TRUNCATE" statement in PostgreSQL?
Explanation: The "TRUNCATE" statement is used to remove all rows from a table, effectively resetting the table's content.
Related content
Rate Your Experience
: 89
: 1