What this quiz covers
This quiz focuses on Tables Rows And Schemas, giving you a quick way to practice the rules, question types, and explanations that matter most for SQL.
A database contains a table named sales.Product and another named inventory.Product. Both tables include columns named product_id and description, but they store different sets of rows.
Which conclusion is best supported by this design?
Product.SQL Quiz
Practice Tables Rows And Schemas in SQL with focused quiz questions that help you check what you know, review explanations, and build confidence with test-style prompts.
This quiz focuses on Tables Rows And Schemas, giving you a quick way to practice the rules, question types, and explanations that matter most for SQL.
Try each quiz question before looking at the correct answer. Use the explanations to review missed ideas, then come back to similar questions until the pattern feels familiar.
A database contains a table named sales.Product and another named inventory.Product. Both tables include columns named product_id and description, but they store different sets of rows.
Which conclusion is best supported by this design?
Product.schema.TableName. So sales.Product and inventory.Product are two completely distinct objects despite sharing the name Product. The schema prefix is what makes them unique within the database. This is exactly why B is correct: schemas provide separate namespaces, allowing two tables with the same unqualified name to coexist without any conflict.
A describes a rule that simply doesn't exist. Databases do not require unqualified names to be unique across the entire system — they only require that the fully qualified name (schema + table name) be unique. A confuses unqualified names with fully qualified identifiers. C is a logical leap that doesn't hold up: sharing a name and a couple of column names doesn't make two tables the same logical entity. Tables are defined by their data, constraints, and purpose — not just their structure headers. D introduces a fabricated rule suggesting identical schemas must hold identical data, which has no basis in how relational databases work. Schema names are purely organizational; they say nothing about the content of the tables inside them.
As a study tip, remember that in SQL, identity is always fully qualified. When you see a question about naming conflicts or table coexistence, ask yourself whether the full schema-qualified names are actually identical — if not, there's no conflict.A logging table has no primary key or uniqueness constraint. Due to a retry, two rows contain identical values in every column. A standard DELETE statement uses a WHERE condition that matches those values exactly.
What is the most accurate conceptual result?
DELETE WHERE statement, the database scans every stored row and evaluates the condition against each one individually. If both rows satisfy the condition, both rows get deleted — full stop. The fact that their values are identical is irrelevant to how the engine processes them. Each row is its own independent unit of storage.
A is wrong because SQL has no concept of "logical deduplication" during deletion. The database doesn't merge identical rows into a single entity before applying operations — that's not how row storage works. B is wrong because SQL evaluates conditions row-by-row without any confusion about duplicates; there's no mechanism that causes the engine to skip or error on matching rows. D is wrong because SQL assigns no inherent priority based on insertion order during a standard DELETE. There's no "earlier duplicate wins" rule — that misconception conflates SQL behavior with application-level retry logic.
The practical takeaway here is important: if you want to delete only one of several duplicate rows, a standard DELETE WHERE won't help you — you'd need a more advanced technique like using ROWID (in Oracle), ctid (in PostgreSQL), or a CTE with ROW_NUMBER(). Knowing this distinction will help you on both exam questions and real-world schema design problems.An administrator moves a Customer table from the crm schema to the archive schema. The operation preserves all column definitions and data rows.
What has changed from the perspective of table organization?
crm, while the rows separately belong to archive.schema.table_name. Moving a table between schemas doesn't alter its structure or data; it changes where the table lives within the database's namespace hierarchy.
That's exactly what happens here. The Customer table moves from crm to archive, so its schema-qualified name changes from crm.Customer to archive.Customer. The columns, data types, constraints, and rows remain completely intact — only the namespace has shifted. This makes D the correct answer: the table now belongs to a different namespace, and any code referencing crm.Customer would break unless updated.
The other choices reflect common misconceptions worth unpacking. A is nonsensical — rows and columns are fundamentally different things (rows are data instances, columns are structural definitions), and moving a table never swaps them. B confuses a schema with the concept of "archiving." A schema is always just a namespace container; tables inside it still hold ordinary rows regardless of whether the schema is named "archive." C invents a false split where columns and rows somehow belong to different schemas — SQL has no such mechanism. A table is a unified object; its components don't get distributed across schemas.
A helpful study tip: whenever you see a question about schemas, ask yourself "what does a schema actually do?" It groups objects into a namespace and affects qualified naming — nothing more. It doesn't transform data, split table components, or change row structure.A database has sales.Order and finance.Refund tables. Both contain a column named account_id. A junior analyst claims that the shared column name proves both tables are in the same schema and that rows with equal values are formally related.
Which response best evaluates the analyst's claims?
sales.Order vs. finance.Refund). Those prefixes tell you everything: these tables belong to different schemas. A shared column name like account_id has absolutely no bearing on schema membership. The schema is a namespace, and column names are just labels within each table's own structure.
Equally important, equal values in two columns do not automatically create a formal relationship. A formal relationship requires an explicit constraint — specifically a foreign key — that the database engine enforces. Without that constraint, matching values between sales.Order.account_id and finance.Refund.account_id are just coincidental (or intentional) data similarities, not a structural bond the database recognizes or protects.
That makes D the correct answer: neither claim holds up.
Answer A fails on both counts, treating column names as authoritative for two things they simply don't control. Answer B incorrectly assumes a shared column name collapses two tables into one namespace — the schema prefix in the table name already disproves this directly. Answer C makes the classic mistake of confusing data equality with relational integrity; without a foreign key constraint, the database won't prevent orphaned or mismatched rows.
A useful rule of thumb: in SQL, structure is defined by DDL constraints, not by naming conventions or value coincidences.Rows are inserted into an EventLog table in chronological order. A later query retrieves all rows without an ORDER BY clause, and a developer expects the first returned row to be the earliest inserted event.
Which assessment of the developer's expectation is most accurate?
ORDER BY clause in your SELECT statement, the database engine is free to return rows in any order it chooses — based on storage layout, indexes, query plan optimizations, or internal caching. No standard guarantees physical insertion order will match retrieval order.
This makes A the correct answer. The developer's expectation is not guaranteed precisely because SQL tables have no inherent retrieval order. Even if rows happened to be stored physically in insertion sequence, the query optimizer might scan an index, perform a parallel read, or reorganize pages during compaction — all of which can scramble the apparent order. The only safe way to guarantee chronological retrieval is ORDER BY on a timestamp or sequence column.
B reflects a common misconception — that rows "remember" their insertion position like array indices. Relational tables are sets, not lists; insertion sequence is not a stored property of row position. C is pure distraction; column data types have absolutely nothing to do with retrieval order. D introduces a plausible-sounding but entirely fabricated threshold — no such page-size rule exists in SQL standards or any major database system.
As a study tip, remember this mantra: "No ORDER BY, no guaranteed order." On SQL exams, any answer claiming deterministic ordering without an explicit ORDER BY should be treated with immediate suspicion, regardless of how the table was populated.A Queue table has four defined columns and several constraints. A statement successfully deletes every row but does not drop or alter the table.
How should the resulting object be described?
NULL.DELETE statement removes all data from the table but leaves the table itself completely intact. The Queue table still exists in the database with its four columns and all associated constraints (primary keys, foreign keys, NOT NULL constraints, etc.). It simply has zero rows — which is a perfectly valid, queryable state. You can immediately run SELECT, INSERT, or any other DML statement against it. That makes B the correct answer.
A is wrong because SQL places no minimum row requirement on a table. An empty table is entirely valid and commonly used — think of tables that start empty and get populated over time. C introduces a fictional "schema-only" status that doesn't exist in SQL; an empty table is fully operational and can be queried at any time (a SELECT simply returns zero rows). D is equally fictional — SQL does not insert a phantom NULL row as a placeholder when a table is emptied. That concept has no basis in standard SQL behavior.
A useful study tip: always distinguish between DDL operations (DROP TABLE, ALTER TABLE), which change structure, and DML operations (DELETE, TRUNCATE), which affect data. A DELETE without a WHERE clause clears all rows but never touches the table's definition.A test database and a production database were created from the same deployment script. Their Customer tables have identical column names, data types, and constraints. Production contains many more customer rows and different values than test.
Which statement most accurately distinguishes the definitions from the stored data?
A Customer table does not have an emergency_contact column. A user requests that this attribute be recorded for one particular customer while all other customer records remain unchanged.
If the designer adds emergency_contact as a nullable column, which description is accurate?
NULL there. (correct answer)ALTER TABLE ... ADD COLUMN actually works.
Adding a nullable column like emergency_contact modifies the table's schema for all rows simultaneously. Rows that have no value for this new attribute simply store NULL there automatically. This is exactly what option C describes: the column exists in every row, but non-specified rows are permitted to hold NULL, effectively leaving them "blank" for that field. This is precisely why nullable columns are so useful — they let you capture optional data without breaking existing records.
Option A reflects a fundamental misunderstanding. In a relational table, every row must conform to the same column structure. Rows cannot have their own independent sets of columns — that would violate the relational model entirely.
Option B incorrectly suggests the selected customer moves to a separate schema. SQL doesn't work this way; schemas define structure for entire tables, not individual rows. A single customer cannot be isolated into a different schema by adding a column.
Option D is also wrong because it implies rows cannot gain new columns, suggesting you'd need a second row instead. In reality, ALTER TABLE adds the column to all existing rows at once — no duplicate rows are needed or appropriate.
A good rule of thumb: column definitions belong to the table, not to individual rows. Whenever you see a question implying rows can have different structures, that's almost certainly a distractor exploiting a common misconception about the relational model.A table currently has five columns and several thousand rows. An administrator successfully adds a sixth column without inserting or deleting any rows.
Which statement is necessarily true immediately after the structural change?
ALTER TABLE statement actually does to existing data. Adding a column is a structural modification — it changes the table's definition, not its row count.
When a new column is added to an existing table, the database engine updates the schema so that every row in the table now includes that column as part of its structure. Existing rows will typically show NULL (or a specified default value) in the new column, but they are still the same rows — none are added or removed. This is why C is correct: the table ends up with six columns and the exact same number of rows as before.
A reflects a common misconception about how databases store metadata. Column definitions live in the system catalog (or information schema), not as rows inside the table itself. Adding a column does not create a new row in your data table.
B is subtly wrong because it implies existing rows are somehow excluded from the new column's structure. In reality, all rows — old and new — share the same column structure after the ALTER TABLE completes. Existing rows simply receive NULL or the default value for the new column.
D describes behavior closer to creating a view or a new table, not an ALTER TABLE operation. When you alter a table, the original table is the modified table — no separate schema object is created.
A good rule of thumb: ALTER TABLE ... ADD COLUMN changes the shape of the table for all rows, past and future, while leaving the row count untouched.A table begins with 8 columns and 120 rows. Two columns are added, then 15 rows are inserted. A deletion subsequently removes 18 rows: 12 original rows and 6 of the newly inserted rows.
What are the table's final degree and cardinality?