MCQs on Introduction to PostgreSQL | PostgreSQL Database

PostgreSQL, an advanced open-source relational database system, offers robust features for data management and application development. This guide explores its basics, benefits, installation, and architecture comprehensively.


MCQs on Introduction to PostgreSQL

1. What is PostgreSQL?

  1. PostgreSQL is a:
    • A) NoSQL database
    • B) Relational database management system
    • C) Cloud computing service
    • D) Programming language
  2. PostgreSQL is also known as:
    • A) MySQL
    • B) Postgres
    • C) SQL Pro
    • D) DB Lite
  3. Which of the following best describes PostgreSQL?
    • A) Lightweight database for small applications
    • B) Fully-featured, enterprise-class database
    • C) A frontend development tool
    • D) A data visualization library
  4. PostgreSQL is:
    • A) Open-source and free
    • B) Proprietary and licensed
    • C) Limited to Linux only
    • D) Used only for local databases
  5. Which language is PostgreSQL primarily written in?
    • A) Python
    • B) C
    • C) Java
    • D) PHP
  6. PostgreSQL supports:
    • A) Single-user access
    • B) Multi-version concurrency control (MVCC)
    • C) Only unstructured data
    • D) No security features
  7. Which of these is NOT supported by PostgreSQL?
    • A) JSON/JSONB data types
    • B) Full-text search
    • C) Stored procedures
    • D) Web hosting services

2. Features and Benefits

  1. PostgreSQL is highly scalable in terms of:
    • A) Database size
    • B) Number of concurrent users
    • C) Both A and B
    • D) Neither A nor B
  2. Which feature makes PostgreSQL unique compared to many relational databases?
    • A) Lack of indexing
    • B) Support for advanced data types like JSON
    • C) Absence of stored procedures
    • D) Only horizontal scaling
  3. PostgreSQL supports which indexing methods?
    • A) Hash indexing only
    • B) B-tree, GiST, and GIN indexing
    • C) Random indexing
    • D) Non-clustered indexing
  4. PostgreSQL is known for its compliance with:
    • A) NoSQL standards
    • B) ACID properties
    • C) Third-party licensing requirements
    • D) GraphQL standards
  5. Which of these is a PostgreSQL benefit?
    • A) Proprietary features
    • B) Extensive support for SQL and NoSQL data models
    • C) Lack of scalability
    • D) Limited platform support
  6. Which feature in PostgreSQL supports high availability?
    • A) Transaction logs
    • B) Replication
    • C) Limited storage options
    • D) Static schema
  7. PostgreSQL supports which kind of data replication?
    • A) Synchronous and asynchronous
    • B) Partial replication only
    • C) No replication options
    • D) Real-time only
  8. What is a significant performance feature of PostgreSQL?
    • A) Limited query optimization
    • B) Advanced query planner and optimizer
    • C) High latency during writes
    • D) Lack of indexing support
  9. PostgreSQL supports horizontal scaling through:
    • A) Sharding
    • B) Denormalization
    • C) Index locking
    • D) Manual backups
  10. What is the key benefit of PostgreSQL’s MVCC feature?
    • A) Simplifies security
    • B) Improves data consistency and concurrency
    • C) Reduces storage needs
    • D) Limits data scalability

3. Installing PostgreSQL (Linux, Windows, macOS)

  1. What package manager is commonly used to install PostgreSQL on Ubuntu?
    • A) pip
    • B) yum
    • C) apt
    • D) brew
  2. Which tool is used to install PostgreSQL on Windows?
    • A) Visual Studio
    • B) pgAdmin
    • C) PostgreSQL installer
    • D) Command Prompt
  3. PostgreSQL is pre-installed on which operating system?
    • A) macOS
    • B) Linux (some distributions)
    • C) Windows 10
    • D) None
  4. The default port for PostgreSQL is:
    • A) 1433
    • B) 3306
    • C) 5432
    • D) 1521
  5. On macOS, PostgreSQL can be installed using:
    • A) Homebrew
    • B) App Store
    • C) pgAdmin only
    • D) Apache HTTP server
  6. Which command initializes a new PostgreSQL database cluster in Linux?
    • A) pg_init
    • B) initdb
    • C) createdb
    • D) startdb
  7. After installation, the PostgreSQL service can be started using:
    • A) pgstart
    • B) service postgresql start
    • C) start postgres service
    • D) launch postgres

4. PostgreSQL Architecture

  1. The main memory component of PostgreSQL is:
    • A) Shared Buffers
    • B) WAL
    • C) pg_hba.conf
    • D) Background writer
  2. The Write-Ahead Logging (WAL) feature in PostgreSQL ensures:
    • A) High read speeds
    • B) Data integrity and crash recovery
    • C) Lower storage usage
    • D) Automatic backup generation
  3. Which component in PostgreSQL manages database connections?
    • A) Postmaster
    • B) pgAdmin
    • C) SQL Shell
    • D) WAL Logger
  4. What is a PostgreSQL “Tablespace”?
    • A) Memory location for temporary files
    • B) Disk location for storing database objects
    • C) Networking layer for queries
    • D) Cache for query plans
  5. Which PostgreSQL process ensures that data changes are written to disk?
    • A) Autovacuum
    • B) Background Writer
    • C) Checkpointer
    • D) WAL Writer
  6. The PostgreSQL architecture follows which type of model?
    • A) Client-server model
    • B) Peer-to-peer model
    • C) Decentralized model
    • D) Monolithic model

Answer Key

QnoAnswer (Option with Text)
1B) Relational database management system
2B) Postgres
3B) Fully-featured, enterprise-class database
4A) Open-source and free
5B) C
6B) Multi-version concurrency control (MVCC)
7D) Web hosting services
8C) Both A and B
9B) Support for advanced data types like JSON
10B) B-tree, GiST, and GIN indexing
11B) ACID properties
12B) Extensive support for SQL and NoSQL data models
13B) Replication
14A) Synchronous and asynchronous
15B) Advanced query planner and optimizer
16A) Sharding
17B) Improves data consistency and concurrency
18C) apt
19C) PostgreSQL installer
20B) Linux (some distributions)
21C) 5432
22A) Homebrew
23B) initdb
24B) service postgresql start
25A) Shared Buffers
26B) Data integrity and crash recovery
27A) Postmaster
28B) Disk location for storing database objects
29C) Checkpointer
30A) Client-server model

Use a Blank Sheet, Note your Answers and Finally tally with our answer at last. Give Yourself Score.

X
error: Content is protected !!
Scroll to Top