SQL Fundamentals · Practice set 5 of 5
Relational Model and SQL: 10 practice questions
10 free SQL Fundamentals practice questions on Relational Model and SQL, with an explanation for every answer. Untimed. The full mock exam and the timed version are in the app.
-
Question 1 of 10
In a SELECT query, which part states the values or expressions that appear in the output?
- AThe statement terminator
- BThe WHERE clause
- CThe select list
- DThe FROM clause
Show the answer
The select list contains the output expressions, and each expression produces a result-column value.
Next → 1 / 10 -
Question 2 of 10
A table already has three unique constraints. How many primary keys may it also declare?
- AExactly three primary keys
- BOne for every unique constraint
- CAt most one primary key
- DNone because unique constraints already exist
Show the answer
A table may have several unique constraints but only one declared primary key for its main row identity.
Next → 2 / 10 -
Question 3 of 10
Which referenced columns give a foreign key one row to match?
- AColumns covered by a primary key or suitable unique constraint
- BEvery column in the referenced table
- CAny column used in a WHERE clause
- DAny column that contains no nulls and is indexed in both tables
Show the answer
A reference needs a key that identifies at most one row; a primary key or suitable unique constraint provides that rule.
Next → 3 / 10 -
Question 4 of 10
What does SELECT 2 + 3 produce when it has no FROM clause?
- AA one-column result containing 5
- BAn empty result because there are no input rows
- CA stored value added to the database
- DA syntax error because every SELECT needs a table
Show the answer
The arithmetic expression produces a scalar value, and SELECT presents it in a result column.
Next → 4 / 10 -
Question 5 of 10
A customer table has unique, non-null email and customer_number columns. Other tables need one stable declared identity, while email must still reject duplicates. Which design fits?
- AUse customer_number as the primary key and keep a unique constraint on email
- BKeep only NOT NULL on both columns
- CReference email without a key constraint
- DDeclare both columns as separate primary keys because each is unique in its own column
Show the answer
One primary key supplies the declared identity, while the separate unique constraint keeps email distinct.
Next → 5 / 10 -
Keep the ones you got wrong
In the app, every question you miss comes back exactly when you’re about to forget it.
Opens in your browser. Nothing to install.
Start studying -
Question 6 of 10
A report must calculate quantity * unit_price for each returned row without changing which rows are kept. Where does the calculation belong?
- AIn the select list as a value expression
- BIn WHERE as the row condition
- CIn FROM as a table name
- DAfter the semicolon as part of a second clause
Show the answer
A select-list expression adds a calculated result column without filtering rows.
Next → 6 / 10 -
Question 7 of 10
Which two properties make primary-key values reliable for identifying rows?
- AThey are text and sorted
- BThey are copied into every related table
- CThey are generated by the database
- DThey are unique and never null
Show the answer
A primary key identifies one row, so duplicate or missing key values would make that identity unclear. Standard SQL enforces both rules; an ordinary SQLite table needs `NOT NULL` for the second.
Next → 7 / 10 -
Question 8 of 10
An order has a non-null customer_id that matches no row in the referenced customer key. What does the foreign-key rule require?
- ACreate a customer row automatically
- BChange the unmatched value to zero
- CAccept the order because constraints do not apply across separate tables
- DReject the order until the value matches a referenced row
Show the answer
A foreign key protects the relationship by requiring its value to match a row in the referenced key.
Next → 8 / 10 -
Question 9 of 10
Which statement distinguishes a value expression from a table expression?
- ABoth always return a complete table
- BA value expression filters rows, while a table expression only renames columns
- CA value expression returns one scalar; a table expression produces rows and columns
- DA value expression is a full statement, while a table expression is a semicolon
Show the answer
The difference is shape: one value is a scalar, while rows and columns are table shaped.
Next → 9 / 10 -
Question 10 of 10
Consider SELECT price * quantity AS total FROM order_items WHERE quantity > 1;. Which description labels its parts correctly?
- AFROM is the statement, SELECT is a table, and the semicolon is the result set
- BEvery word is a separate statement because SQL is token based
- CWHERE is an expression, price is a clause, and order_items is the statement
- DIt is the statement with clauses and expressions; its returned rows are the result set
Show the answer
The complete SELECT command is the statement. Clauses organize its work, expressions calculate values, and execution produces a result set.
Next → 10 / 10 -
You’ve finished this set
That’s 10 questions on Relational Model and SQL. In the app the ones you miss come back exactly when you’re about to forget them.
Back to the courseOpens in your browser. Nothing to install.
Start studying
The whole course, on your computer and your phone
Lessons you can read, audio you can listen to on the way to work, and practice that remembers what you got wrong.
Opens in your browser. Nothing to install.
Start studying“This app is the ‘One Lake’ for preparing the certification exams. Really worth it.”
