WGU D427: DATA MANAGEMENT SQL REAL QUESTIONS +
DETAILED ANSWERS - LATEST VERSION - TOP RATED
(2026/2027)
Q1. What does SQL stand for?
✓ Answer: Structured Query Language — a standard language for managing
and querying relational databases.
Q2. What are the five main SQL sublanguages?
✓ Answer: DDL (Data Definition Language), DML (Data Manipulation
Language), DCL (Data Control Language), TCL (Transaction Control
Language), and DQL (Data Query Language).
Q3. What is a relational database?
✓ Answer: A database that organizes data into tables (relations) with rows
and columns, where relationships between tables are established through
keys.
Q4. What is the purpose of the SELECT statement?
✓ Answer: The SELECT statement retrieves data from one or more tables
and returns a result set of rows.
Q5. What is the difference between WHERE and HAVING?
✓ Answer: WHERE filters rows BEFORE aggregation; HAVING filters groups
AFTER aggregation and is used with GROUP BY.
Q6. What does the DISTINCT keyword do?
✓ Answer: DISTINCT eliminates duplicate rows from a SELECT result set,
returning only unique values.
Q7. What is a primary key?
, ✓ Answer: A primary key is a column (or combination of columns) that
uniquely identifies each row in a table. It cannot be NULL and must be unique.
Q8. What is a foreign key?
✓ Answer: A foreign key is a column in one table that references the primary
key of another table, enforcing referential integrity.
Q9. What does NULL represent in SQL?
✓ Answer: NULL represents the absence of a value or unknown data. It is not
zero or an empty string.
Q10. How do you test for NULL in SQL?
✓ Answer: Use IS NULL or IS NOT NULL. You cannot use = NULL or !=
NULL because comparisons with NULL always return UNKNOWN.
Q11. What is a composite key?
✓ Answer: A composite key is a primary key made up of two or more columns
that together uniquely identify a row.
Q12. What is referential integrity?
✓ Answer: Referential integrity ensures that a foreign key value always
references an existing primary key value in the related table, preventing
orphaned records.
Q13. What are the three-valued logic outcomes in SQL?
✓ Answer: TRUE, FALSE, and UNKNOWN. UNKNOWN arises when NULL
is involved in comparisons.
Q14. What is a schema in SQL?
✓ Answer: A schema is a logical container or namespace that groups related
database objects such as tables, views, and indexes.
Q15. What is a catalog in a database system?
✓ Answer: A catalog is the highest-level container in a database hierarchy,
containing one or more schemas.
Q16. What is the difference between CHAR and VARCHAR data types?
✓ Answer: CHAR stores fixed-length character strings; VARCHAR stores
variable-length strings. CHAR pads with spaces; VARCHAR only uses as
much space as needed.
Q17. What is the INT data type?
, ✓ Answer: INT (or INTEGER) stores whole numbers without decimal points,
typically 4 bytes, ranging from about -2.1 billion to 2.1 billion.
Q18. What is the DECIMAL or NUMERIC data type?
✓ Answer: DECIMAL/NUMERIC stores exact numeric values with a specified
precision (total digits) and scale (digits after decimal), used for financial data.
Q19. What does the DATE data type store?
✓ Answer: DATE stores calendar dates in YYYY-MM-DD format without time
information.
Q20. What is the TIMESTAMP data type?
✓ Answer: TIMESTAMP stores both date and time, often including time zone
information, used for tracking when events occur.
Q21. What are SQL constraints?
✓ Answer: Constraints are rules enforced on table columns to maintain data
integrity. Common constraints include PRIMARY KEY, FOREIGN KEY,
UNIQUE, NOT NULL, CHECK, and DEFAULT.
Q22. What does a NOT NULL constraint do?
✓ Answer: NOT NULL prevents a column from storing NULL values, requiring
a value to be provided for every row.
Q23. What does a UNIQUE constraint do?
✓ Answer: UNIQUE ensures all values in a column (or combination of
columns) are distinct across all rows in the table.
Q24. What does a CHECK constraint do?
✓ Answer: CHECK validates that column values satisfy a specified Boolean
expression before they are inserted or updated.
Q25. What is a DEFAULT constraint?
✓ Answer: DEFAULT specifies the value automatically inserted into a column
when no value is explicitly provided in an INSERT statement.
Q26. What is a candidate key?
✓ Answer: A candidate key is any column or set of columns that could serve
as a primary key — it must be unique and NOT NULL.
Q27. What is a surrogate key?
✓ Answer: A surrogate key is an artificial, system-generated identifier (often
an auto-increment integer) used as a primary key instead of a natural key.
, Q28. What is a natural key?
✓ Answer: A natural key is a primary key derived from real-world data that
already exists in the entity (e.g., SSN, email address).
Q29. What is an alternate key?
✓ Answer: An alternate key is a candidate key that was not chosen as the
primary key. It can still be enforced using a UNIQUE constraint.
Q30. What is a super key?
✓ Answer: A super key is any set of columns that can uniquely identify rows,
including those with extra unnecessary columns. Every candidate key is a
super key.
DETAILED ANSWERS - LATEST VERSION - TOP RATED
(2026/2027)
Q1. What does SQL stand for?
✓ Answer: Structured Query Language — a standard language for managing
and querying relational databases.
Q2. What are the five main SQL sublanguages?
✓ Answer: DDL (Data Definition Language), DML (Data Manipulation
Language), DCL (Data Control Language), TCL (Transaction Control
Language), and DQL (Data Query Language).
Q3. What is a relational database?
✓ Answer: A database that organizes data into tables (relations) with rows
and columns, where relationships between tables are established through
keys.
Q4. What is the purpose of the SELECT statement?
✓ Answer: The SELECT statement retrieves data from one or more tables
and returns a result set of rows.
Q5. What is the difference between WHERE and HAVING?
✓ Answer: WHERE filters rows BEFORE aggregation; HAVING filters groups
AFTER aggregation and is used with GROUP BY.
Q6. What does the DISTINCT keyword do?
✓ Answer: DISTINCT eliminates duplicate rows from a SELECT result set,
returning only unique values.
Q7. What is a primary key?
, ✓ Answer: A primary key is a column (or combination of columns) that
uniquely identifies each row in a table. It cannot be NULL and must be unique.
Q8. What is a foreign key?
✓ Answer: A foreign key is a column in one table that references the primary
key of another table, enforcing referential integrity.
Q9. What does NULL represent in SQL?
✓ Answer: NULL represents the absence of a value or unknown data. It is not
zero or an empty string.
Q10. How do you test for NULL in SQL?
✓ Answer: Use IS NULL or IS NOT NULL. You cannot use = NULL or !=
NULL because comparisons with NULL always return UNKNOWN.
Q11. What is a composite key?
✓ Answer: A composite key is a primary key made up of two or more columns
that together uniquely identify a row.
Q12. What is referential integrity?
✓ Answer: Referential integrity ensures that a foreign key value always
references an existing primary key value in the related table, preventing
orphaned records.
Q13. What are the three-valued logic outcomes in SQL?
✓ Answer: TRUE, FALSE, and UNKNOWN. UNKNOWN arises when NULL
is involved in comparisons.
Q14. What is a schema in SQL?
✓ Answer: A schema is a logical container or namespace that groups related
database objects such as tables, views, and indexes.
Q15. What is a catalog in a database system?
✓ Answer: A catalog is the highest-level container in a database hierarchy,
containing one or more schemas.
Q16. What is the difference between CHAR and VARCHAR data types?
✓ Answer: CHAR stores fixed-length character strings; VARCHAR stores
variable-length strings. CHAR pads with spaces; VARCHAR only uses as
much space as needed.
Q17. What is the INT data type?
, ✓ Answer: INT (or INTEGER) stores whole numbers without decimal points,
typically 4 bytes, ranging from about -2.1 billion to 2.1 billion.
Q18. What is the DECIMAL or NUMERIC data type?
✓ Answer: DECIMAL/NUMERIC stores exact numeric values with a specified
precision (total digits) and scale (digits after decimal), used for financial data.
Q19. What does the DATE data type store?
✓ Answer: DATE stores calendar dates in YYYY-MM-DD format without time
information.
Q20. What is the TIMESTAMP data type?
✓ Answer: TIMESTAMP stores both date and time, often including time zone
information, used for tracking when events occur.
Q21. What are SQL constraints?
✓ Answer: Constraints are rules enforced on table columns to maintain data
integrity. Common constraints include PRIMARY KEY, FOREIGN KEY,
UNIQUE, NOT NULL, CHECK, and DEFAULT.
Q22. What does a NOT NULL constraint do?
✓ Answer: NOT NULL prevents a column from storing NULL values, requiring
a value to be provided for every row.
Q23. What does a UNIQUE constraint do?
✓ Answer: UNIQUE ensures all values in a column (or combination of
columns) are distinct across all rows in the table.
Q24. What does a CHECK constraint do?
✓ Answer: CHECK validates that column values satisfy a specified Boolean
expression before they are inserted or updated.
Q25. What is a DEFAULT constraint?
✓ Answer: DEFAULT specifies the value automatically inserted into a column
when no value is explicitly provided in an INSERT statement.
Q26. What is a candidate key?
✓ Answer: A candidate key is any column or set of columns that could serve
as a primary key — it must be unique and NOT NULL.
Q27. What is a surrogate key?
✓ Answer: A surrogate key is an artificial, system-generated identifier (often
an auto-increment integer) used as a primary key instead of a natural key.
, Q28. What is a natural key?
✓ Answer: A natural key is a primary key derived from real-world data that
already exists in the entity (e.g., SSN, email address).
Q29. What is an alternate key?
✓ Answer: An alternate key is a candidate key that was not chosen as the
primary key. It can still be enforced using a UNIQUE constraint.
Q30. What is a super key?
✓ Answer: A super key is any set of columns that can uniquely identify rows,
including those with extra unnecessary columns. Every candidate key is a
super key.