Objectives

  • Create tables with a primary key.
  • Enter a small data set and run a select query.

Theory: Introduction to databases, data concepts, DBMS.

If Access is unavailable, use LibreOffice Base or a spreadsheet with two sheets named as tables, plus a FILTER or VLOOKUP demo, and note the substitute in your report.

Tasks (55 minutes)

Database file Surname_IT231_Lab6.accdb (or equivalent):

  1. Table Students: StudentID (PK, Short Text), FullName, Program (e.g. BBA).
  2. Table Enrolments: EnrolID (PK, AutoNumber), StudentID, CourseCode (IT231), Marks.
  3. Enter at least five students and six enrolment rows (one student may take the course twice only if you explain it; otherwise one row each).
  4. Query: list FullName and Marks for CourseCode = "IT231", sorted by Marks descending.
  5. Optional: a simple form to add a student.

Do not store real personal data of classmates without permission; use fictional names.

Deliverable

The database file plus a screenshot of the query datasheet.

Viva

  1. What is a primary key?
  2. Why is a database better than many Excel files for student records?
  3. What does a query do that a table does not?
  4. Name two functions of a DBMS besides storing data.