QUESTIONS EXAM ACCURATE AND
VERIFIED ACTUAL EXAM QUESTIONS WITH
DETAILED ANSWERS FOR GUARANTEED
PASS | ALREADY GRADED A
1. When a product is deleted from the product table, all corresponding rows for the product in
the pricing table are deleted automatically as well. What is this referential integrity technique
called?
A. Restrict delete
B. Set-to-null
C. Cascaded delete ✅
D. Soft delete
Correct Answer: C. Cascaded delete
Rationale: Cascaded delete ensures that when a row in the parent table is deleted,
corresponding rows in the child table are automatically deleted.
2. What does the clause PRIMARY KEY followed by a field name in parentheses mean in a
CREATE TABLE statement?
A. The table will be indexed
B. The column is a unique constraint
C. The column is a foreign key
D. The column is the primary key for the table ✅
Correct Answer: D. The column is the primary key for the table
Rationale: The PRIMARY KEY clause specifies that the listed column uniquely identifies each row
in the table.
3. Which ALTER TABLE statement adds a foreign key constraint to a child table?
A. ALTER TABLE child ADD CONSTRAINT fk FOREIGN KEY (par_id);
B. ALTER TABLE parent ADD FOREIGN KEY (par_id);
C. ALTER TABLE child ADD FOREIGN KEY (par_id) REFERENCES parent (par_id) ON DELETE
CASCADE; ✅
D. ALTER TABLE parent ADD COLUMN par_id FOREIGN KEY;
,Correct Answer: C.
Rationale: This statement adds a foreign key with a cascading delete rule to maintain referential
integrity.
4. How does Table 2 affect the returned results from Table 1 in a LEFT JOIN?
A. Only matching rows from Table 1 are returned
B. All rows from Table 2 are returned
C. All rows from Table 1 are returned regardless of matches ✅
D. Only non-matching rows are returned
Correct Answer: C.
Rationale: LEFT JOIN returns all rows from the left (first) table, even if there's no match in the
right table.
5. Which command functions as a RIGHT JOIN with the roles of the tables reversed?
A. Cross join
B. Inner join
C. Left join ✅
D. Full join
Correct Answer: C. Left join
Rationale: LEFT JOIN with reversed table positions yields the same result as a RIGHT JOIN.
6. What does the LEFT JOIN statement do in: SELECT t1., t2. FROM t1 LEFT JOIN t2 ON t1.i1 =
t2.i2?
A. Selects all rows from both tables
B. Selects only rows with matches in both tables
C. Selects all rows in Table 1 and matching rows in Table 2 ✅
D. Selects all rows in Table 2 and matching rows in Table 1
Correct Answer: C.
Rationale: LEFT JOIN includes all rows from the left table and matches from the right table.
7. What is the difference between COUNT(*) and COUNT(col_name)?
A. No difference
B. COUNT() counts all rows; COUNT(col_name) counts non-null values only ✅
C. COUNT() counts distinct values only
D. COUNT(col_name) counts all rows
Correct Answer: B.
Rationale: COUNT(*) includes nulls, whereas COUNT(column) excludes them.
8. How does a row subquery differ from a table subquery?
A. Row subquery returns multiple rows
, B. Table subquery returns scalar values
C. Row subquery returns a single row with one or more columns ✅
D. Table subquery returns a single value
Correct Answer: C.
Rationale: A row subquery returns exactly one row with one or more columns.
9. What is a unary relationship?
A. Relationship between two different tables
B. Relationship with composite keys
C. Relationship between instances of a single entity type ✅
D. Relationship in a recursive join
Correct Answer: C.
Rationale: A unary relationship links rows within the same table/entity.
10. Which delete rule sets column values in a child table to a missing value when the matching
data is deleted from the parent table?
A. Cascade
B. Restrict
C. Set-to-default
D. Set-to-null ✅
Correct Answer: D.
Rationale: Set-to-null nullifies the foreign key in the child table when the parent is deleted.
11. In which normal form is data that has a simple primary key and no repeating groups?
A. First
B. Second ✅
C. Third
D. Boyce-Codd
Correct Answer: B.
Rationale: Second normal form requires a primary key and the elimination of repeating groups.
12. What does WHERE identify in a basic SQL SELECT statement?
A. Columns to display
B. Tables to use
C. Sorting order
D. Rows to be included ✅
Correct Answer: D.
Rationale: The WHERE clause filters which rows will be returned by the query.