Interview questions
Predict the result, find the errors, explain the solution. You can read the questions without an account.
Topic: DDL, keys, and normalizationReset all
23 questions
Can you insert a second
NULLinto a column with aUNIQUEconstraint?Predict the resultJuniorWill a foreign key allow an order for a nonexistent customer?
Predict the resultSeniorFind the bugs: SQL newsletter subscribers
Find the errorsJuniorFind the bugs: orders with totals that don't match their line items
Find the errorsMiddleFind the bugs: checking data before changing a column
Find the errorsJuniorCan you add a customer with an existing name?
Predict the resultJuniorCan you insert
NULLinto a required column?Predict the resultJuniorWill the schema allow a negative item quantity?
Predict the resultJuniorFind the bugs: validating order statuses before a migration
Find the errorsJuniorHow do you insert rows with circular foreign keys?
ExplainMiddleWhy use
DECIMALinstead ofFLOATfor money?ExplainJuniorHow do
DEFAULT,CHECK, andNOT NULLwork together?ExplainJuniorWhat happens when you insert an empty string into a required field?
Predict the resultJuniorHow would you design a many-to-many relationship?
ExplainMiddle