0% found this document useful (0 votes)
4 views6 pages

ERD Exercises

The document outlines various entities and their relationships across multiple scenarios, including Students, Departments, Courses, Employees, and Properties. Each section details the attributes of the entities and the nature of their relationships, such as Many-to-One and Many-to-Many. Additionally, it specifies primary keys for each entity to ensure unique identification.

Uploaded by

hamzahaladu002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views6 pages

ERD Exercises

The document outlines various entities and their relationships across multiple scenarios, including Students, Departments, Courses, Employees, and Properties. Each section details the attributes of the entities and the nature of their relationships, such as Many-to-One and Many-to-Many. Additionally, it specifies primary keys for each entity to ensure unique identification.

Uploaded by

hamzahaladu002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

QUESTION 1

Entities:

 Student: id, name, dob

 Department: dno, dname

 Course: ccode, title, credits

Relationships:

 Student-Department: Many-to-One

o A Student is enrolled in one Department, and a Department has many


Students.

 Student-Course: Many-to-Many

o A Student takes many Courses, and a Course is taken by many Students.

 Course-Department: Many-to-One

o A Course is offered by one Department, and a Department offers many


Courses.

QUESTION 2

Entities:

 Student: first_name, last_name, cgpa, dob

 Activity: activity_name, fee, max_capacity, type

 Coach: name, identity_number, salary

Relationships:

 Student-Activity: Many-to-Many

 Activity-Coach: Many-to-One
QUESTION 3

Entities:

 Room: room_number, type, price

 Customer: customer_id, name, dob, phone_number

 Department: deptno, name

 Employee: emp_id, name, salary

Relationships:

 Customer-Room: One-to-Many

o A Customer may rent only one Room, but a Room may have many
Customers.

 Employee-Department: Many-to-One

o An Employee works for one Department, and a Department has many


Employees.

 Employee-Department (Manager): One-to-One (or One-to-Many depending on


how it's modeled)

o One Employee is the manager of a Department.

 Employee-Room: Many-to-One

o An Employee serves many Rooms, but each Room is served by only one
Employee.
QUESTION 4

Entities:

 Branch: branchno (Primary Key), address, fax_no, telno

 Employee: empno (Primary Key), name, address, position, salary, gender

Relationships:

 Branch-Employee: One-to-Many

 Branch-Employee (Manager): One-to-One

Primary Keys:

 Branch: branchno

 Employee: empno

QUESTION 5:

Entities:

 Employee: employee_id, name, address, birthdate

 Project: project_id, project_name, start_date

Relationships:

 Employee-Project: Many-to-Many (with billing_rate as an attribute of the


relationship)

HOMEWORK 1:

Entities:

 Member: username (Primary Key), password, address


 Movie: movie_id (Primary Key), title, year_released, category

 Director: director_id (Primary Key), first_name, last_name, address (Street,


City, Country)

Relationships:

 Movie-Director: Many-to-One

 Member-Movie: Many-to-Many (with attributes hire_date, due_date)

Primary Keys:

 Member: username

 Movie: movie_id

 Director: director_id

HOMEWORK 2:

Entities:

 Employee: employee_id (Primary Key), name, address, salary

 Department: department_id (Primary Key), name

 Division: division_id (Primary Key), name

 Project: project_name (Primary Key), budget

Relationships:

 Department-Employee: One-to-Many

 Division-Department: One-to-Many

 Employee-Department (Manager): One-to-One

 Employee-Division (Manager): One-to-One


 Employee-Project: Many-to-Many

 Project-Project (Related): Many-to-Many

Primary Keys:

 Employee: employee_id

 Department: department_id

 Division: division_id

 Project: project_name

HOMEWORK 3:

Entities:

 Branch: branch_no (Primary Key), address, fax_no, tel_no

 Employee: emp_no (Primary Key), name, address, position, salary, gender

Relationships:

 Branch-Employee: One-to-Many

 Branch-Employee (Manager): One-to-One

Primary Keys:

 Branch: branch_no

 Employee: emp_no
HOMEWORK 4:

Entities:

 Sales Office: office_number (Primary Key), location

 Employee: employee_id (Primary Key), employee_name, salary

 Property: property_id (Primary Key), location (Address, City, State, Zip


Code)

 Owner: owner_id (Primary Key), owner_name

Relationships:

 Sales Office-Employee: One-to-Many

 Sales Office-Employee (Manager): One-to-One

 Sales Office-Property: One-to-Many

 Property-Owner: Many-to-Many (with percentage_owned)

Primary Keys:

 Sales Office: office_number

 Employee: employee_id

 Property: property_id

 Owner: owner_id

You might also like