Alif Najmi
← Back to Alif Notes · Coursework

Jom Al-Quran: 56 tables, back from Oracle

7 November 2026 · 5 min read

The other database from my UTP days models Jom Al-Quran, a business running Quran and Arabic classes: students and their guardians, teachers and their schedules, courses, invoices, payments, and the websites and social media behind it all. It was a group assignment, built in Oracle like the company one.

  • 56 tables
  • 1,459 rows
  • 80 foreign keys
  • 0 broken links

Bringing it back

The original lived in a Word report: Oracle SQL and screenshots, runnable only on a lab machine. I had an AI coding agent port it to SQLite, repair the three typos that stopped it loading (two split inserts, 120 missing semicolons and two malformed foreign keys), check every relationship, and wrap it in tests. Every table, column and row is otherwise exactly as we submitted it.

For this page, the names, IC numbers, emails and phone numbers are all replaced with obviously fake ones. Each original maps to the same fake value everywhere, so every join still lines up.

Try it yourself

The report's five queries are below, including one that walks through thirteen tables to get from a guardian to their payment. Run them, open any table (or one of the views, in teal), or write your own. It all runs in your browser.

Scroll here to load the database.
Browse a table (20 main tables and 6 views)

How the tables connect

This is the diagram we drew in 2024. It was buried in the report as an embedded drawing, so it never made it into the first port. The arrows are subtypes: a guardian and a student are both kinds of client, a teacher is a kind of employee, a payment is a kind of transaction.

The original EER diagram: 20 entities in boxes with their attributes, joined by labelled relationship lines
The 2024 EER diagram. Open it full size to read the attributes.

A drawing that busy doesn't help you write a query, so here is the same schema as a map you can use. Pick the tables you care about. The atlas finds the shortest route between them, writes the JOINs and runs them. Switch to As we drew it in 2024 to put every table back where we placed it, or pick one table to see how it drifted from what the report documented.

Subtype of, from the 2024 diagram Link table, one-to-one in the data Link table, really one-to-many Link table, genuinely many-to-many Link table (hover a diamond)

Pick from a list instead

Scroll here to load the database.

Scroll here to load the database.

What I'd design differently now

Running it properly also meant reading it critically. It loads cleanly and every query works, but with a few years of hindsight:

  • Too many link tables. 36 of the 56 tables are link tables, and in the data most of them are really one-to-many. A single foreign key would do, and query four wouldn't need thirteen tables.
  • One person, three tables. The diagram makes guardians and students subtypes of client, but a parent's own row and their child's row are only tied together through a link table. The atlas's query-four preset shows what happens when you join them the short way: no rows. Today I'd have one Person table and roles on top.
  • The same fact stored twice. Schedules record their student and teacher directly and in two link tables. They agree now, which is exactly when duplicates look harmless.
  • The documentation drifted. The report's schema list and its CREATE TABLEs disagree on a few tables. A test that checks one against the other would have caught it.

None of that is a reason to be embarrassed by it. It's the same lesson every project since has taught me: write the model down, then check the real thing against it.

← A whole company in 49 tables All notes →