SQL and Database Fundamentals Flashcards
6 cards from real Data and Analytics practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 6 SQL and Database Fundamentals flashcards as text
Which SQL clause is used to filter rows after aggregation?
Answer: HAVING
HAVING filters groups created by GROUP BY, whereas WHERE filters individual rows before aggregation.
What does a PRIMARY KEY constraint enforce in a relational database?
Answer: Unique, non-null values per row
A PRIMARY KEY ensures every row has a unique, non-null identifier in that column or set of columns.
Which SQL JOIN returns only rows where there is a match in both tables?
Answer: INNER JOIN
INNER JOIN returns only the rows that have matching values in both joined tables.
What is the purpose of an index in a relational database?
Answer: To speed up data retrieval queries
An index creates a data structure that allows the database engine to find rows faster without scanning the entire table.
Which normal form eliminates transitive dependencies?
Answer: 3NF
Third Normal Form (3NF) removes transitive dependencies, ensuring non-key columns depend only on the primary key.
What does the SQL DISTINCT keyword do?
Answer: Removes duplicate rows from the result set
DISTINCT eliminates duplicate rows from the query result, returning only unique value combinations.