Schema & DDL interview questions

27 real Schema & DDL questions from the SQL bank, as asked in Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd — free to start.

1. What is CREATE TABLE?

Junior
  1. A.a Postgres pseudo-type that auto-generates increasing integer keys, equivalent in purpose to MySQL AUTO_INCREMENT and standard IDENTITY columns
  2. B.a DDL statement that defines a new relation by specifying its column names, data types, and constraints
  3. C.a DDL statement that changes an existing table's structure, such as adding a column, dropping a column, or modifying a constraint
  4. D.a rule that validates each row against a boolean condition and rejects any row for which the condition is false
Reveal the answer + AI explanation — free account

3. Which statement is correct?

Junior
  1. A.CREATE TABLE — a column constraint that forbids the absence of a value, forcing every row to supply something for that column
  2. B.CREATE TABLE — a DDL statement that defines a new relation by specifying its column names, data types, and constraints
  3. C.CREATE TABLE — a rule guaranteeing no two rows share the same value in the specified column(s), while still permitting NULLs in most engines
  4. D.CREATE TABLE — a column clause supplying a fallback value automatically used when an insert omits that column
Reveal the answer + AI explanation — free account

4. What is ALTER TABLE?

Junior
  1. A.a column clause supplying a fallback value automatically used when an insert omits that column
  2. B.a DDL statement that changes an existing table's structure, such as adding a column, dropping a column, or modifying a constraint
  3. C.a DDL statement that defines a new relation by specifying its column names, data types, and constraints
  4. D.a rule guaranteeing no two rows share the same value in the specified column(s), while still permitting NULLs in most engines
Reveal the answer + AI explanation — free account

6. Which statement is correct?

Junior
  1. A.ALTER TABLE — a column constraint that forbids the absence of a value, forcing every row to supply something for that column
  2. B.ALTER TABLE — a constraint identifying each row uniquely; it forbids duplicate values and forbids NULLs, and a table may have only one
  3. C.ALTER TABLE — a DDL statement that changes an existing table's structure, such as adding a column, dropping a column, or modifying a constraint
  4. D.ALTER TABLE — a DDL statement that defines a new relation by specifying its column names, data types, and constraints
Reveal the answer + AI explanation — free account

7. What is primary key?

Junior
  1. A.a Postgres pseudo-type that auto-generates increasing integer keys, equivalent in purpose to MySQL AUTO_INCREMENT and standard IDENTITY columns
  2. B.a constraint identifying each row uniquely; it forbids duplicate values and forbids NULLs, and a table may have only one
  3. C.a rule guaranteeing no two rows share the same value in the specified column(s), while still permitting NULLs in most engines
  4. D.a rule that validates each row against a boolean condition and rejects any row for which the condition is false
Reveal the answer + AI explanation — free account

9. Which statement is correct?

Junior
  1. A.primary key — a constraint identifying each row uniquely; it forbids duplicate values and forbids NULLs, and a table may have only one
  2. B.primary key — a column clause supplying a fallback value automatically used when an insert omits that column
  3. C.primary key — a DDL statement that changes an existing table's structure, such as adding a column, dropping a column, or modifying a constraint
  4. D.primary key — a column constraint that forbids the absence of a value, forcing every row to supply something for that column
Reveal the answer + AI explanation — free account

10. What is foreign key?

Mid
  1. A.a Postgres pseudo-type that auto-generates increasing integer keys, equivalent in purpose to MySQL AUTO_INCREMENT and standard IDENTITY columns
  2. B.a constraint enforcing referential integrity by requiring a column's values to match an existing key in another (or the same) table
  3. C.a DDL statement that changes an existing table's structure, such as adding a column, dropping a column, or modifying a constraint
  4. D.a rule that validates each row against a boolean condition and rejects any row for which the condition is false
Reveal the answer + AI explanation — free account

12. Which statement is correct?

Mid
  1. A.foreign key — a column clause supplying a fallback value automatically used when an insert omits that column
  2. B.foreign key — a constraint enforcing referential integrity by requiring a column's values to match an existing key in another (or the same) table
  3. C.foreign key — a DDL statement that changes an existing table's structure, such as adding a column, dropping a column, or modifying a constraint
  4. D.foreign key — a column constraint that forbids the absence of a value, forcing every row to supply something for that column
Reveal the answer + AI explanation — free account

13. What is UNIQUE constraint?

Mid
  1. A.a rule guaranteeing no two rows share the same value in the specified column(s), while still permitting NULLs in most engines
  2. B.a DDL statement that defines a new relation by specifying its column names, data types, and constraints
  3. C.a rule that validates each row against a boolean condition and rejects any row for which the condition is false
  4. D.a constraint identifying each row uniquely; it forbids duplicate values and forbids NULLs, and a table may have only one
Reveal the answer + AI explanation — free account

14. Which term means: "a rule guaranteeing no two rows share the same value in the specified column(s), while still permitting NULLs in most engines"?

Mid
  1. A.UNIQUE constraint
  2. B.CHECK constraint
  3. C.CREATE TABLE
  4. D.ALTER TABLE
Reveal the answer + AI explanation — free account

15. Which statement is correct?

Mid
  1. A.UNIQUE constraint — a rule guaranteeing no two rows share the same value in the specified column(s), while still permitting NULLs in most engines
  2. B.UNIQUE constraint — a Postgres pseudo-type that auto-generates increasing integer keys, equivalent in purpose to MySQL AUTO_INCREMENT and standard IDENTITY columns
  3. C.UNIQUE constraint — a constraint enforcing referential integrity by requiring a column's values to match an existing key in another (or the same) table
  4. D.UNIQUE constraint — a column clause supplying a fallback value automatically used when an insert omits that column
Reveal the answer + AI explanation — free account

16. What is CHECK constraint?

Mid
  1. A.a rule that validates each row against a boolean condition and rejects any row for which the condition is false
  2. B.a constraint identifying each row uniquely; it forbids duplicate values and forbids NULLs, and a table may have only one
  3. C.a column clause supplying a fallback value automatically used when an insert omits that column
  4. D.a constraint enforcing referential integrity by requiring a column's values to match an existing key in another (or the same) table
Reveal the answer + AI explanation — free account

18. Which statement is correct?

Mid
  1. A.CHECK constraint — a rule guaranteeing no two rows share the same value in the specified column(s), while still permitting NULLs in most engines
  2. B.CHECK constraint — a rule that validates each row against a boolean condition and rejects any row for which the condition is false
  3. C.CHECK constraint — a Postgres pseudo-type that auto-generates increasing integer keys, equivalent in purpose to MySQL AUTO_INCREMENT and standard IDENTITY columns
  4. D.CHECK constraint — a column clause supplying a fallback value automatically used when an insert omits that column
Reveal the answer + AI explanation — free account

19. What is NOT NULL?

Junior
  1. A.a column constraint that forbids the absence of a value, forcing every row to supply something for that column
  2. B.a rule guaranteeing no two rows share the same value in the specified column(s), while still permitting NULLs in most engines
  3. C.a DDL statement that defines a new relation by specifying its column names, data types, and constraints
  4. D.a constraint enforcing referential integrity by requiring a column's values to match an existing key in another (or the same) table
Reveal the answer + AI explanation — free account

21. Which statement is correct?

Junior
  1. A.NOT NULL — a column constraint that forbids the absence of a value, forcing every row to supply something for that column
  2. B.NOT NULL — a rule guaranteeing no two rows share the same value in the specified column(s), while still permitting NULLs in most engines
  3. C.NOT NULL — a Postgres pseudo-type that auto-generates increasing integer keys, equivalent in purpose to MySQL AUTO_INCREMENT and standard IDENTITY columns
  4. D.NOT NULL — a rule that validates each row against a boolean condition and rejects any row for which the condition is false
Reveal the answer + AI explanation — free account

22. What is DEFAULT?

Mid
  1. A.a DDL statement that defines a new relation by specifying its column names, data types, and constraints
  2. B.a column clause supplying a fallback value automatically used when an insert omits that column
  3. C.a column constraint that forbids the absence of a value, forcing every row to supply something for that column
  4. D.a constraint enforcing referential integrity by requiring a column's values to match an existing key in another (or the same) table
Reveal the answer + AI explanation — free account

24. Which statement is correct?

Mid
  1. A.DEFAULT — a DDL statement that changes an existing table's structure, such as adding a column, dropping a column, or modifying a constraint
  2. B.DEFAULT — a rule guaranteeing no two rows share the same value in the specified column(s), while still permitting NULLs in most engines
  3. C.DEFAULT — a DDL statement that defines a new relation by specifying its column names, data types, and constraints
  4. D.DEFAULT — a column clause supplying a fallback value automatically used when an insert omits that column
Reveal the answer + AI explanation — free account

25. What is SERIAL?

Senior
  1. A.a column constraint that forbids the absence of a value, forcing every row to supply something for that column
  2. B.a Postgres pseudo-type that auto-generates increasing integer keys, equivalent in purpose to MySQL AUTO_INCREMENT and standard IDENTITY columns
  3. C.a constraint identifying each row uniquely; it forbids duplicate values and forbids NULLs, and a table may have only one
  4. D.a constraint enforcing referential integrity by requiring a column's values to match an existing key in another (or the same) table
Reveal the answer + AI explanation — free account

26. Which term means: "a Postgres pseudo-type that auto-generates increasing integer keys, equivalent in purpose to MySQL AUTO_INCREMENT and standard IDENTITY columns"?

Senior
  1. A.SERIAL
  2. B.DEFAULT
  3. C.foreign key
  4. D.CHECK constraint
Reveal the answer + AI explanation — free account

27. Which statement is correct?

Senior
  1. A.SERIAL — a column clause supplying a fallback value automatically used when an insert omits that column
  2. B.SERIAL — a Postgres pseudo-type that auto-generates increasing integer keys, equivalent in purpose to MySQL AUTO_INCREMENT and standard IDENTITY columns
  3. C.SERIAL — a constraint identifying each row uniquely; it forbids duplicate values and forbids NULLs, and a table may have only one
  4. D.SERIAL — a DDL statement that changes an existing table's structure, such as adding a column, dropping a column, or modifying a constraint
Reveal the answer + AI explanation — free account

Free to start

Answers, AI explanations, and a scored voice mock interview

Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take one full AI mock interview — scored like a real panel.

Practice Schema & DDL free