Skip to content
ZAVIA

Study notes · Database Systems · 5th Semester · Free

Database Systems notes

Lectures 1–7 for Database Systems (CSC270) at COMSATS Abbottabad, plus original notes on the ER model written in simple words.

Credit

The lecture slides below are the teaching material of Mam Aisha, Department of Computer Science, COMSATS University Islamabad, Abbottabad Campus. They are shared here with full credit, exactly as given in class, for students' revision. The slides remain the teacher's work — Zavia only hosts them with credit. The “ER model in simple words” notes further down this page are original notes written by Zavia, not copied from any book.

Lectures 1–7

ER model in simple words

Original notes by Zavia, written from the lectures above. Read the lectures first, then use this page for quick revision.

1. What the ER model is for

Before building any database, you draw a picture of what the system has to remember. That picture is the ER model. It was introduced by Peter Chen in 1976, and it is still the standard first step in database design: you list the things the organisation cares about, the facts you need to store about each of them, and how they connect to each other — and only then do you build tables.

2. Entity, entity type, instance, set

An entity is one real thing you want to store data about — a person, a place, a course, an event. The entity type is the kind of thing (Student, Course), one instance is a single example of it (the student Habib), and the entity set is all the instances of that type together (all students). In a diagram, an entity type is a rectangle with a singular, capitalised name.

3. Attributes — the facts about an entity

  • Simple vs composite: a simple attribute has one value (Roll_No); a composite one splits into parts (Name into First, Middle, Last).
  • Single-valued vs multi-valued: one value per instance (CNIC_No) vs several (Skills). Multi-valued ones are shown in curly brackets in some notations.
  • Stored vs derived: a derived fact is calculated from other facts instead of being stored — Years_Employed comes from Date_Employed, so you store the date and work the rest out.
  • Identifier: the attribute (or set of them) that picks out exactly one instance — underlined in the diagram. A partial identifier only works together with its owner, and is double-underlined.

4. Strong vs weak entities

A strong entity stands on its own: an Employee exists whether or not anything else exists, and it has its own identifier (Employee_ID). A weak entity cannot stand alone — a Dependent only makes sense attached to its owner Employee, and its partial identifier is meaningless without that owner. The link between a weak entity and its owner is called the identifying relationship, and the owner is the identifying owner.

5. A worked mini-example

Take a university: Student, Course and Department are entity types. Student has attributes Student_ID (identifier), Name (composite: First_Name, Last_Name) and Skills (multi-valued). Course has Course_ID and Title. Department has Dept_ID and Name. A Student enrols in a Course — that is the relationship, and it is the part most students forget to name in the exam. If you can draw these three boxes, name their identifiers, and label the relationship, you have the core of any ER question.

← Back to Study Notes