How to Pass INF2603: Mastering Databases & SQL (2025 Guide)

INF2603 is often the first time students encounter the “backend” of software development. It moves you away from coding logic (like loops and if-statements) into the world of Data Storage and Design.

The module is split into two distinct skills: Design (drawing how data relates) and Implementation (writing the code to manage that data). To get a distinction, you need to master the transition from a drawing on paper to a working SQL database.

This guide breaks down the three pillars of the module.

1. Database Design (ER Diagrams)

This is usually the first question in the exam. You will be given a scenario (e.g., “A library system”). You must draw an Entity-Relationship Diagram.

  • The Entities: Identify the “nouns” in the scenario (Book, Member, Loan). These become your tables.
  • The Relationships: Identify the “verbs” (Member borrows Book).
  • Cardinality: This is where marks are lost. You must determine if it is:
    • One-to-One (1:1): One husband has one wife.
    • One-to-Many (1:M): One mother has many children.
    • Many-to-Many (M:N): Many students take many modules.
  • Exam Tip: You cannot implement a Many-to-Many relationship directly in a database. You must resolve it by creating a “Linking Table” (Associative Entity).

[Image of entity relationship diagram example]

2. Normalization (The Logic)

Normalization is the process of organizing data to reduce redundancy (duplicates). You typically need to take a messy table and “normalize” it to 3rd Normal Form (3NF).

  • 1NF: Eliminate repeating groups. Every column must hold a single value (atomic).
  • 2NF: Eliminate partial dependency. Every non-key column must depend on the whole Primary Key (not just part of it). This only applies if you have a Composite Key.
  • 3NF: Eliminate transitive dependency. Non-key columns shouldn’t depend on other non-key columns (e.g., knowing the “Zip Code” tells you the “City” – this belongs in a separate table).

3. SQL (Structured Query Language)

This is the language you use to talk to the database. You need to master DDL (creating tables) and DML (manipulating data).

Creating Tables (DDL)

You must define the Primary Key and Foreign Keys correctly.

CREATE TABLE Student (
    StudentID int PRIMARY KEY,
    Name varchar(50),
    CourseID int,
    FOREIGN KEY (CourseID) REFERENCES Course(CourseID)
);

Note: Always create the “Parent” table (Course) before the “Child” table (Student), or the Foreign Key will fail.

Querying Data (DML)

  • SELECT: The most common command. Know how to use WHERE, ORDER BY, and GROUP BY.
  • JOINS: You will be asked to combine data from two tables.
    • INNER JOIN: Returns only matching records.
    • LEFT JOIN: Returns all records from the left table, even if there is no match on the right.

[Image of sql joins venn diagram]

4. Connectivity (PHP & MySQL)

The practical part of the module often involves using PHP to connect a web page to a MySQL database.

  • The Connection String: You need to know the parameters: Host (localhost), Username (root), Password, and Database Name.
  • The Loop: To display multiple results (like a list of students), you use a while loop to fetch rows one by one.
while($row = $result->fetch_assoc()) {
    echo $row["Name"];
}

Decksh’s Top 3 Tips for a Distinction

Tip 1: Practice SQL by Hand

In the exam, you don’t have a computer to check your syntax.

  • Practice writing out full CREATE TABLE and SELECT statements on paper.
  • Pay attention to commas and brackets. A missing comma between column definitions is a mark lost.

Tip 2: Master the “Composite Key”

A Composite Key is a Primary Key made of two columns (e.g., StudentID + ModuleID).

  • This is essential for Linking Tables.
  • Understand that neither column is unique on its own, but the combination is unique.

Tip 3: Draw Before You Code

Never start writing SQL code until you have sketched the ER Diagram.

  • If your design is wrong (e.g., you put the Foreign Key in the wrong table), your SQL code will be impossible to write.
  • Spend the first 10 minutes of the exam purely on design.

Conclusion

INF2603 is a skill you will use for the rest of your career. Don’t just learn it to pass; learn it to build. If you can master Normalization and SQL Joins, you will not only get a distinction but also be ready for the industry.

Good luck!

Leave a Comment