PostgreSQL

PostgreSQL

Test your PostgreSQL knowledge with free quizzes on MyCodeSkills covering core concepts.


  1. What is PostgreSQL?

    • A programming language
    • A NoSQL database
    • An open-source object-relational database
    • A web server
  2. What command is used to connect to a PostgreSQL database via terminal?

    • pg_connect
    • connect_db
    • psql
    • start_pg
  3. Which command is used to create a new database in PostgreSQL?

    • MAKE DATABASE
    • CREATE DATABASE
    • INIT DATABASE
    • NEW DATABASE
  4. Which data type is used for textual data in PostgreSQL?

    • CHAR
    • VARCHAR
    • TEXT
    • All of the above
  5. What is the default port for PostgreSQL?

    • 1521
    • 3306
    • 5432
    • 8080
  6. What does a LEFT JOIN return?

    • Only matching rows
    • All rows from left table and matched rows from right
    • All rows from both tables
    • Only unmatched rows
  7. Which clause groups rows based on common values?

    • ORDER BY
    • GROUP BY
    • PARTITION BY
    • FILTER
  8. What is the purpose of the HAVING clause?

    • Filters grouped records
    • Sorts grouped records
    • Joins multiple tables
    • Adds a primary key
  9. Which type of JOIN returns only matching rows?

    • INNER JOIN
    • FULL JOIN
    • LEFT JOIN
    • OUTER JOIN
  10. What command is used to update data?

    • MODIFY
    • EDIT
    • UPDATE
    • CHANGE
  11. What is the purpose of a GIN index?

    • Full-text search and array operations
    • Numeric calculations
    • Speeding up DELETE
    • Foreign key constraints
  12. What does the `RETURNING` clause do in INSERT or UPDATE?

    • Returns only successful status
    • Returns affected rows
    • Logs results
    • Creates a backup
  13. What are triggers used for?

    • Encrypt data
    • Run functions on events
    • Perform joins
    • Modify system settings
  14. What is stored in the WAL (Write-Ahead Log)?

    • Debug logs
    • Future queries
    • Changes before they’re applied
    • User passwords
  15. What is the purpose of VACUUM?

    • Back up the database
    • Remove NULL values
    • Reclaim storage and prevent bloat
    • Index tables