Database Systems & SQL Flashcards
6 cards from real B.S.W.E. Bachelor of Software Engineering practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 6 Database Systems & SQL flashcards as text
What is a database index and what does it improve?
Answer: A data structure that improves query performance
A database index is a data structure that provides fast lookup of data based on column values, significantly improving SELECT query performance.
What does the GROUP BY clause do in SQL?
Answer: Groups rows sharing a common value for aggregate functions
GROUP BY groups rows that have the same values in specified columns, enabling aggregate functions like COUNT, SUM, and AVG per group.
What is a stored procedure in SQL?
Answer: A precompiled set of SQL statements stored in the database
A stored procedure is a precompiled collection of SQL statements that can be executed as a single named unit, improving performance and reusability.
What is the difference between WHERE and HAVING in SQL?
Answer: WHERE filters before grouping; HAVING filters after grouping
WHERE filters individual rows before aggregation, while HAVING filters groups after the GROUP BY clause has been applied.
What is a database view?
Answer: A virtual table based on a SELECT query
A view is a virtual table defined by a stored SQL query that can be queried like a regular table but stores no data itself.
Which normal form eliminates transitive dependencies?
Answer: Third Normal Form (3NF)
Third Normal Form (3NF) eliminates transitive dependencies by ensuring every non-key attribute depends only on the primary key.