Relational model and ER diagrams
An entity set maps to a table; each relationship becomes either a table or foreign keys depending on cardinality. A weak entity's key includes its owner's key. Map total participation as a NOT NULL foreign key. Read the cardinality ratio and participation constraints before converting an ER diagram to tables.
Check yourself: Does your relational schema preserve every entity, relationship, and key constraint from the ER diagram?
Functional dependencies and normalization
Compute the attribute closure X⁺ by starting with X and repeatedly applying dependencies. X is a superkey when X⁺ contains all attributes; a candidate key has no proper subset that is also a superkey. BCNF requires every nontrivial determinant to be a superkey. A partial dependency of a non-prime attribute on a proper subset of a candidate key violates 2NF.
Check yourself: Can removing one attribute from your proposed key still determine every attribute?
SQL aggregation and join semantics
SQL bags retain duplicates; relational algebra uses sets. A JOIN can multiply rows when multiple matches exist. GROUP BY partitions rows; HAVING filters groups after aggregation. COUNT(column) ignores NULLs; COUNT(*) counts all rows. A LEFT JOIN retains every row from the left table, padding with NULLs where no match exists.
Check yourself: Can you enumerate the rows produced by the JOIN before applying GROUP BY?
Transactions and concurrency control
A schedule is conflict-serializable when its precedence graph (one vertex per transaction, edges for conflicting operation orderings) is acyclic. Two operations conflict when they access the same item and at least one writes. A topological sort of the acyclic graph gives an equivalent serial order. Recoverability is a separate property.
Check yourself: Have you excluded read-read pairs and checked every shared data item?
Data warehousing: star schemas and OLAP
A star schema centers a fact table holding measures and foreign keys to dimension tables. Dimensions describe the who, what, where, and when; facts record quantitative measures. Roll-up aggregates along a dimension hierarchy (e.g., day to month); drill-down disaggregates. Slice fixes one dimension; dice restricts multiple dimensions.
Check yourself: Is each column in the fact table a measure or a foreign key, not a descriptive attribute?