Bird
0
0

Which of the following is the correct syntax to create a list partitioned table by category in PostgreSQL?

easy📝 Syntax Q12 of 15
PostgreSQL - Table Partitioning
Which of the following is the correct syntax to create a list partitioned table by category in PostgreSQL?
ACREATE TABLE sales PARTITION BY GROUP (category);
BCREATE TABLE sales PARTITION BY RANGE (category);
CCREATE TABLE sales PARTITION BY HASH (category);
DCREATE TABLE sales PARTITION BY LIST (category);
Step-by-Step Solution
Solution:
  1. Step 1: Identify partition type syntax

    List partitioning uses PARTITION BY LIST in PostgreSQL.
  2. Step 2: Match correct syntax

    Only CREATE TABLE sales PARTITION BY LIST (category); uses PARTITION BY LIST with the column name correctly.
  3. Final Answer:

    CREATE TABLE sales PARTITION BY LIST (category); -> Option D
  4. Quick Check:

    List partitioning syntax = PARTITION BY LIST [OK]
Quick Trick: Use PARTITION BY LIST for list partitioning [OK]
Common Mistakes:
  • Using PARTITION BY RANGE instead of LIST
  • Using PARTITION BY HASH incorrectly
  • Using non-existent PARTITION BY GROUP

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes