DAC Database & SQL Analytics Flashcards
6 cards from real DAC practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 6 DAC Database & SQL Analytics flashcards as text
What is a foreign key in a relational database?
Answer: A column that references the primary key of another table to enforce referential integrity
A foreign key is a column whose values reference the primary key of another table, enforcing referential integrity between tables.
Which SQL statement is used to retrieve data from a database?
Answer: SELECT
SELECT is the SQL statement used to query and retrieve data from one or more database tables.
What is a Common Table Expression (CTE) in SQL?
Answer: A temporary named result set defined within a WITH clause for use in a single query
A CTE is defined using the WITH keyword and provides a named temporary result set that can be referenced within the query, improving readability and enabling recursion.
In analytical SQL, what does the PARTITION BY clause do in a window function?
Answer: Defines groups within which the window function is calculated
PARTITION BY divides the result set into groups (partitions), and window functions are applied independently within each partition.
What does ACID stand for in database transaction management?
Answer: Atomicity, Consistency, Isolation, Durability
ACID stands for Atomicity, Consistency, Isolation, and Durability — the four properties that guarantee reliable database transactions.
Which type of database join produces a Cartesian product if no condition is specified?
Answer: CROSS JOIN
A CROSS JOIN returns every combination of rows from both tables (Cartesian product), resulting in m × n rows where m and n are the row counts of each table.