PostgreSQL MCQ Questions And Answers
PostgreSQL MCQs : This section focuses on "Basics" of PostgreSQL. These Multiple Choice Questions (MCQ) should be practiced to improve the PostgreSQL skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.
1. Which of the following is true regarding PostgreSQL?
A. PostgreSQL is a powerful
B. PostgreSQL is open source
C. PostgreSQL is object-relational database system
D. All of the above
View Answer
Ans : D
Explanation: PostgreSQL (pronounced as post-gress-Q-L) is an open source relational database management system (DBMS) developed by a worldwide team of volunteers.
2. PostgreSQL written in?
A. C
B. C++
C. Java
D. Python
View Answer
Ans : A
Explanation: Written in: C
3. PostgreSQL, originally called ?
A. Ingres
B. Postgres
C. Pregres
D. None of the above
View Answer
Ans : B
Explanation: PostgreSQL, originally called Postgres, was created at UCB by a computer science professor named Michael Stonebraker.
4. Which of the following is true regarding Postgres95?
A. Support for SQL was added in 1994
B. Released as Postgres95 in 1995
C. Establishment of the PostgreSQL Global Development Team
D. All of the above
View Answer
Ans : D
Explanation: 1994-1995 − Postgres95 : Support for SQL was added in 1994, Released as Postgres95 in 1995, Re-released as PostgreSQL 6.0 in 1996, Establishment of the PostgreSQL Global Development Team
5. Using psql, you can generate a complete list of commands by using the ________ command
A. help
B. /help
C. $help
D. &help
View Answer
Ans : A
Explanation: Using psql, you can generate a complete list of commands by using the help command.For the syntax of a specific command, use the following command : postgres-# help
6. Which syntax is used to Abort the current transaction?
A. ABORT
B. ABORT [ WORK ]
C. ABORT [ TRANSACTION ]
D. ABORT [ WORK | TRANSACTION ]
View Answer
Ans : D
Explanation: Abort the current transaction : ABORT [ WORK | TRANSACTION ]
7. Which syntax is used to Change the definition of a procedural language?
A. UPDATE LANGUAGE name RENAME TO new_name
B. ALTER LANGUAGE name RENAME TO new_name
C. ALTER LANGUAGE name OWNER TO new_name
D. UPDATE LANGUAGE name OWNER TO new_name
View Answer
Ans : B
Explanation: Change the definition of a procedural language : ALTER LANGUAGE name RENAME TO new_name
8. The below command is used to?
ALTER TRIGGER name ON table RENAME TO new_name
A. Delete the definition of a trigger
B. Update the definition of a trigger
C. Change the definition of a trigger
D. Insert the definition of a trigger
View Answer
Ans : C
Explanation: Change the definition of a trigger : ALTER TRIGGER name ON table RENAME TO new_name
9. The below command is used to?
ANALYZE [ VERBOSE ] [ table [ (column [, ...] ) ] ]
A. Collect statistics about a database.
B. Start a transaction block.
C. End a transaction block.
D. Destroy statistics about a database.
View Answer
Ans : A
Explanation: Collect statistics about a database : ANALYZE [ VERBOSE ] [ table [ (column [, ...] ) ] ]
10. Numeric types consist of?
A. two-byte
B. four-byte
C. eight-byte
D. All of the above
View Answer
Ans : D
Explanation: Numeric types consist of two-byte, four-byte, and eight-byte integers, four-byte and eight-byte floating-point numbers, and selectable-precision decimals.
11. The ________ type stores a currency amount with a fixed fractional precision.
A. character
B. money
C. binary
D. numeric
View Answer
Ans : B
Explanation: The money type stores a currency amount with a fixed fractional precision. Values of the numeric, int, and bigint data types can be cast to money. Using Floating point numbers is not recommended to handle money due to the potential for rounding errors.
12. The Boolean data type can have the states true, false, and a third state?
A. null
B. error
C. unknown
D. undefined
View Answer
Ans : C
Explanation: PostgreSQL provides the standard SQL type Boolean. The Boolean data type can have the states true, false, and a third state, unknown, which is represented by the SQL null value.
13. Geometric data types represent?
A. one dimensional
B. boolean
C. enum
D. two dimensional
View Answer
Ans : D
Explanation: Geometric data types represent two-dimensional spatial objects.
14. PostgreSQL offers data types to store IPv4, IPv6, and MAC addresses.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: PostgreSQL offers data types to store IPv4, IPv6, and MAC addresses.
15. How many types of SQL bit there?
A. 2
B. 3
C. 4
D. 5
View Answer
Ans : A
Explanation: Bit String Types are used to store bit masks. They are either 0 or 1. There are two SQL bit types: bit(n) and bit varying(n), where n is a positive integer.
16. This is a sorted list of distinct words that have been normalized to merge different variants of the same word, called as ?
A. tsquery
B. UUID
C. lexemes
D. None of the above
View Answer
Ans : C
Explanation: This is a sorted list of distinct words that have been normalized to merge different variants of the same word, called as lexemes
17. A meta-command always begins with what?
A. Forwardslash character (/)
B. Dollar sign ($)
C. Backslash character ()
D. Question mark (?)
View Answer
Ans : C
Explanation: A meta-command always begins with Backslash character ().
18. In PostgreSQL, a named collection of tables is called ?
A. Trigger
B. View
C. Procedure
D. Schema
View Answer
Ans : D
Explanation: In PostgreSQL, a named collection of tables is called Schema.
19. We add data to PostgreSQL by using which statement?
A. Insert
B. Add
C. Select
D. Update
View Answer
Ans : A
Explanation: We add data to PostgreSQL by using insert statement.
20. PostgreSQL used what model of communication?
A. Network
B. Client/Server
C. Peer-to-Peer
D. Push Model
View Answer
Ans : B
Explanation: PostgreSQL used Client/Server model of communication.
Discussion