Which relational algebra sequence returns the names of employees in the Sales department from Employee and Department, matching rows by dept_id?
Relational Algebra and SQL Fundamentals Online Quiz Questions
Use this free practice quiz with 20 questions to review Relational Algebra and SQL Fundamentals, test your knowledge, and prepare for your next test or exam.
Select all statements that accurately describe SQL table constraints.
- A
PRIMARY KEY requires unique, non-null identifiers.
- B
NOT NULL requires a value.
- C
UNIQUE prevents duplicate values.
- D
CHECK enforces a condition.
- E
A foreign key declared with REFERENCES must always be non-null, even without NOT NULL.
If related database changes have not yet been committed, ROLLBACK cancels those uncommitted changes.
- A
True
- B
False
What type of key links rows between relational tables?
ORDER BY requests a display order; without it, row order is . SQL generally preserves duplicate rows unless SELECT is specified.
You need to update or delete only certain rows in a table. Explain how a WHERE condition controls which rows are affected and how you can check the target rows before making a broad change.
Which statement correctly distinguishes a Cartesian product from a join in relational algebra?
- A
A Cartesian product pairs every row of one relation with every row of another; a join combines related rows, usually by matching key columns.
- B
A Cartesian product combines only rows with matching keys; a join pairs every row with every other row.
- C
A Cartesian product keeps specified columns; a join removes duplicate rows.
- D
A Cartesian product filters rows by a condition; a join returns rows found in one relation but not another.
Select all statements that accurately describe relational table structure and key roles.
- A
A table consists of rows and columns, and each column has a defined type.
- B
A primary key identifies rows.
- C
A foreign key links rows between tables.
- D
A primary key links rows between tables, while a foreign key identifies each row.
- E
Every column in a table must be a primary key.
In SQL, WHERE column_name = NULL is the correct way to select rows where column_name is missing.
- A
True
- B
False
Which SQL transaction command saves the changes in a transaction?
In SQL, defines a new table. The constraint requires unique, non-null identifiers.
Before running a broad UPDATE or DELETE, what is the recommended way to inspect which rows will be affected?
- A
Run the UPDATE or DELETE without a condition so the database can choose the intended rows.
- B
Run a SELECT with the same condition to inspect the target rows.
- C
Replace the condition with ORDER BY.
- D
Use INSERT to preview the affected rows.
A primary key identifies rows in a table, while a foreign key links rows between tables.
- A
True
- B
False
Which SQL transaction command saves the changes in a transaction? Enter the SQL command in uppercase.
Which relational algebra plan returns the names of employees in the Sales department, given Employee(emp_id, name, dept_id, salary) and Department(dept_id, dept_name)?
- A
Project dept_name, then take the Cartesian product of Employee and Department.
- B
Select rows where dept_name is Sales from Employee alone, then take the union with Department.
- C
Join Employee and Department on dept_id, select rows where dept_name is Sales, then project name.
- D
Take the difference between Employee and Department, then select name.
A DELETE statement without a WHERE condition removes only the first row in its target table.
- A
True
- B
False
Which SQL constraint prevents duplicate values? Enter the constraint keyword in uppercase.
Which SQL clause requests a particular display order for query results?
- A
ORDER BY
- B
WHERE
- C
FROM
- D
GROUP BY
Which SQL constraint keyword enforces a relationship to a key in another table? Enter the keyword in uppercase.
Which statement correctly describes the roles of COMMIT and ROLLBACK in a transaction?
- A
ROLLBACK cancels uncommitted changes; COMMIT cancels committed changes.
- B
COMMIT saves changes; ROLLBACK cancels uncommitted changes.
- C
COMMIT and ROLLBACK both save all changes.
- D
ROLLBACK saves changes; COMMIT cancels uncommitted changes.
Related study packs and tools
02 — Information and Representation
A progressive guide to how computers encode numbers, text, images, and sound as binary data, including the trade-offs and limits of digital representation.
2 Digital Logic
A 14-question medium-difficulty quiz on Boolean algebra, logic gates, truth tables, and combinational circuits.
03 — Python Programming Fundamentals
A focused set of flashcards covering Python variables, data types, expressions, control flow, functions, input, output, and common programming practices.
6 Computer Memory
Learn how computer memory stores and addresses information, how RAM and ROM differ, and how caches and the memory hierarchy balance speed, capacity, and cost.
07 Trees and Binary Search Trees
A progressive guide to tree structure, binary-tree traversals, binary search tree operations, deletion, balancing, and the way tree height determines time and space costs.
10 — Data, Systems, and Applications
A progression through how data is organized, searched, exposed through software interfaces, and managed through abstraction layers in modern computer systems.
Interrupts
Reviews how interrupts support event handling and multitasking, and how Linux system calls use the RISC-V `ecall` instruction and register conventions.
OS Processes
This quiz covers process management, context switching and scheduling, multitasking, traps and interrupts, and RISC-V privilege transitions.
Systemcalls
A quiz on operating-system system calls, including privileged-operation requests, process creation and execution with fork, exec, and waitpid, and signal handling.