Relational Algebra
Relational Algebra in Databases: implementation patterns, named pitfalls, and the autograder cases that catch them.
Computer Science Foundations
Relational schema design, SQL queries through window functions, normalization to BCNF, index tuning, and transaction isolation analysis. The hardest CMU 15-445 query optimization step is reading the PostgreSQL EXPLAIN ANALYZE output and identifying a missing index that drops a sequential scan to an index scan, the move our tutors annotate inline. Verified CS graduates with PostgreSQL, MySQL, MongoDB depth, starting at $20 per task, 12-hour average turnaround.
Why Databases
Relational schema design, SQL queries through window functions, normalization to BCNF, index tuning, and transaction isolation analysis. The hardest CMU 15-445 query optimization step is reading the PostgreSQL EXPLAIN ANALYZE output and identifying a missing index that drops a sequential scan to an index scan, the move our tutors annotate inline. Verified CS graduates with PostgreSQL, MySQL, MongoDB depth, starting at $20 per task, 12-hour average turnaround.
Topics covered
Relational Algebra in Databases: implementation patterns, named pitfalls, and the autograder cases that catch them.
ER Diagrams to Schema in Databases: implementation patterns, named pitfalls, and the autograder cases that catch them.
SQL DDL (CREATE, ALTER, DROP) in Databases: implementation patterns, named pitfalls, and the autograder cases that catch them.
SQL DML (SELECT, INSERT, UPDATE, DELETE) in Databases: implementation patterns, named pitfalls, and the autograder cases that catch them.
Joins (Inner, Outer, Cross, Lateral) in Databases: implementation patterns, named pitfalls, and the autograder cases that catch them.
Subqueries and CTEs in Databases: implementation patterns, named pitfalls, and the autograder cases that catch them.
Full overview
Databases are the persistent layer behind every non-trivial application. Database courses cover 8 named topic areas: relational design (ER diagrams to schema), the relational algebra (selection, projection, join, union, set difference, division), SQL through window functions and CTEs, normalization theory (1NF through BCNF with functional dependencies), physical storage (B+ trees, hash indexes, columnar layouts), transactions (ACID, isolation levels, MVCC), query processing (parser, optimizer, executor), and NoSQL alternatives (document stores, key-value, wide-column, graph). CMU 15-445, Berkeley CS186, MIT 6.830, and Stanford CS245 each spend 13 to 15 weeks on these topics with Garcia-Molina-Ullman-Widom or Ramakrishnan-Gehrke as the textbook, plus implementation projects on a teaching database (BusTub at CMU, SimpleDB at Berkeley and MIT).
PostgreSQL is the most common teaching target because it implements the SQL standard faithfully, supports the full range of indexes (B-tree, hash, GiST, GIN, BRIN), exposes the query planner via EXPLAIN ANALYZE, and runs on every platform. The assessment landscape splits 50-50 between SQL-heavy problem sets (schema design, query writing, normalization proofs) and implementation projects on the teaching database (buffer pool manager, B+ tree, query executor, concurrency control). The SQL half rewards fluency with the full standard plus the specific dialect in use; the implementation half rewards systems thinking about page layouts, latches, and ARIES recovery.
CSHH tutor matching for this subject draws from CS graduates with split backgrounds: SQL-fluent application developers for the schema and query work, and former CMU 15-445 or CS186 TAs for the C++ or Java implementation projects. ORM-based application work (Django ORM, SQLAlchemy, Hibernate, JPA, Prisma) crosses into the languages-and-libraries cluster and matches against the relevant language specialist. Our tutors deliver schema designs with explicit functional dependency analysis and BCNF justification, SQL queries that match the textbook style of the course, EXPLAIN ANALYZE output for any non-trivial query, and transaction code with isolation level annotated.
Languages supported: SQL (PostgreSQL, MySQL, SQLite), Python (with psycopg2, SQLAlchemy, Django ORM), Java (with JDBC, JPA, Hibernate), JavaScript (with node-postgres, Prisma).
Where Students Get Stuck
Many-to-many requires a junction table. Weak entities need the owner key as part of their composite key. ISA hierarchies have 3 mapping strategies (single table, table per class, joined). We pick based on access patterns and draw the ER with cardinality and participation before writing DDL.
Deriving candidate keys requires computing attribute closures (X+) for candidate attribute sets, then checking that every attribute is in some X+. Computing X+ involves repeatedly applying functional dependencies until no new attributes are added. We provide the closure computation table for the FDs in the assignment.
Boyce-Codd Normal Form requires every functional dependency be on a superkey. Decomposing a non-BCNF relation can lose information (decomposition is not lossless without the right join attribute) or lose functional dependency preservation. We prove lossless join via the chase algorithm and document any FD lost.
PostgreSQL EXPLAIN ANALYZE shows the query plan and actual row counts. A sequential scan on a large table where an index scan would be 100x faster is the classic finding. We add the right index (B-tree for equality, GIN for full-text, BRIN for naturally ordered data), rerun EXPLAIN ANALYZE, and show before-and-after cost.
B-tree handles equality, range, and ORDER BY. Hash handles equality only but in O(1). GIN handles array, JSONB, and full-text. BRIN handles naturally ordered data (timestamps, IDs) in tiny index size. We pick the index type based on the query predicate and verify with EXPLAIN ANALYZE.
READ COMMITTED prevents dirty reads. REPEATABLE READ prevents non-repeatable reads (in PostgreSQL, also prevents phantom reads via snapshot isolation). SERIALIZABLE prevents all anomalies via serializable snapshot isolation but introduces serialization failures that must be retried. We pick the level based on the consistency requirement and add retry logic where appropriate.
Where It Appears
| Context | What we cover | |
|---|---|---|
| Database Systems (CMU 15-445, U of T CSC443, Manchester COMP60331, NUS CS3223, IIT Bombay CS387, ETH Zurich 263-3010) | BusTub C++ database (or equivalent teaching DB) with projects: buffer pool manager, B+ tree index, query execution, concurrency control. The B+ tree project requires concurrent latching with crab-locking protocol. | Databases implementations with tests |
| Introduction to Database Systems (Berkeley CS186, U of T CSC343, Manchester COMP23111, Edinburgh INFR10070, NUS CS2102, IIT Bombay CS387) | Java-based RookieDB (or equivalent) with projects on B+ tree implementation, join algorithms (block nested loop, hash, sort-merge), query optimization with System R cost model, and ARIES recovery. | Databases implementations with tests |
| Database Systems (MIT 6.830, U of T CSC2508, NUS CS5421, IIT Bombay CS632, Edinburgh INFR11199) | SimpleDB in Java (or equivalent teaching engine) with projects on heap files, B+ tree, query operator implementation, and locking-based concurrency control with deadlock detection. | Databases implementations with tests |
| Database System Principles (Stanford CS245, U of T CSC2508, NUS CS5421, IIT Bombay CS632, KAIST CS500) | Graduate-level treatment of storage, indexing, query processing, transactions, and distributed databases. Final project often on a Spark SQL extension or a custom index type. | Databases implementations with tests |
| Generic Databases (CS340 in the US, U of T CSC343, NUS CS2102, IIT Bombay CS387, Manchester COMP23111, Sydney INFO2120, used at 200+ universities) | Standard upper-division covering Garcia-Molina-Ullman-Widom. Common assignments: ER diagram for a university enrollment system, SQL queries with subqueries and joins, BCNF decomposition of a denormalized schema. | Databases implementations with tests |
| Database Application Development (CS346 in the US, U of T CSC309, NUS CS2102, IIT Bombay CS387, Manchester COMP10120) | Web app with ORM-based database access. Common stacks: Django plus PostgreSQL, Flask plus SQLAlchemy plus PostgreSQL, Node.js plus Prisma plus PostgreSQL, Spring Boot plus JPA plus MySQL. | Databases implementations with tests |
Tutors Who Cover This Subject
FAQ
Submit your assignment and get matched with a verified Databases tutor in 15 minutes.
Submit Your Assignment