Prepstellar

SQL Fundamentals · Practice set 5 of 5

Relational Model and SQL: 10 practice questions

10 questions · Untimed · Free

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.

Set 5 · Relational Model and SQL · 10 questions Read the lesson
  1. Question 1 of 10

    In a SELECT query, which part states the values or expressions that appear in the output?

    1. AThe statement terminator
    2. BThe WHERE clause
    3. CThe select list
    4. DThe FROM clause
    Show the answer

    The select list contains the output expressions, and each expression produces a result-column value.

    Next → 1 / 10
  2. Question 2 of 10

    A table already has three unique constraints. How many primary keys may it also declare?

    1. AExactly three primary keys
    2. BOne for every unique constraint
    3. CAt most one primary key
    4. 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
  3. Question 3 of 10

    Which referenced columns give a foreign key one row to match?

    1. AColumns covered by a primary key or suitable unique constraint
    2. BEvery column in the referenced table
    3. CAny column used in a WHERE clause
    4. 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
  4. Question 4 of 10

    What does SELECT 2 + 3 produce when it has no FROM clause?

    1. AA one-column result containing 5
    2. BAn empty result because there are no input rows
    3. CA stored value added to the database
    4. 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
  5. 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?

    1. AUse customer_number as the primary key and keep a unique constraint on email
    2. BKeep only NOT NULL on both columns
    3. CReference email without a key constraint
    4. 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
  6. 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

    On your phone, with the same account

    Get it on Google Play Download on the App Store
  7. 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?

    1. AIn the select list as a value expression
    2. BIn WHERE as the row condition
    3. CIn FROM as a table name
    4. 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
  8. Question 7 of 10

    Which two properties make primary-key values reliable for identifying rows?

    1. AThey are text and sorted
    2. BThey are copied into every related table
    3. CThey are generated by the database
    4. 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
  9. 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?

    1. ACreate a customer row automatically
    2. BChange the unmatched value to zero
    3. CAccept the order because constraints do not apply across separate tables
    4. 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
  10. Question 9 of 10

    Which statement distinguishes a value expression from a table expression?

    1. ABoth always return a complete table
    2. BA value expression filters rows, while a table expression only renames columns
    3. CA value expression returns one scalar; a table expression produces rows and columns
    4. 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
  11. Question 10 of 10

    Consider SELECT price * quantity AS total FROM order_items WHERE quantity > 1;. Which description labels its parts correctly?

    1. AFROM is the statement, SELECT is a table, and the semicolon is the result set
    2. BEvery word is a separate statement because SQL is token based
    3. CWHERE is an expression, price is a clause, and order_items is the statement
    4. 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
  12. 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 course

    Opens in your browser. Nothing to install.

    Start studying

    On your phone, with the same account

    Get it on Google Play Download on the App Store

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

On your phone, with the same account

Get it on Google Play Download on the App Store

“This app is the ‘One Lake’ for preparing the certification exams. Really worth it.”

Abdelhak Y. Google Play review