0% found this document useful (0 votes)
18 views

Database Lab 04

The document describes a database lab assignment for a student named Muhammad Asim Hanif. It involves modeling entities and relationships for two different domains: a bookstore database and a university database. For the bookstore database, the main entities are Book, Category, Customer, Order, and the relationships between them. For the university database, the main entities are Department, Course, Student, Professor, Assessment, Grade, Club, Event and the relationships between them.

Uploaded by

muhammadasimf23
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Database Lab 04

The document describes a database lab assignment for a student named Muhammad Asim Hanif. It involves modeling entities and relationships for two different domains: a bookstore database and a university database. For the bookstore database, the main entities are Book, Category, Customer, Order, and the relationships between them. For the university database, the main entities are Department, Course, Student, Professor, Assessment, Grade, Club, Event and the relationships between them.

Uploaded by

muhammadasimf23
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Database Systems Lab

CS161

Lab No: 04

Student Name Muhammad Asim Hanif


Registration # F23608048
Semester 2nd
Batch Fall 2023
Instructor Dr Maria Kanwal
Lab Engineer Tabinda Nasir
Department SE
Date 20-03-2024
TASK 01

Here are the main entities involved:

 Book: Represents a book in the bookstore. Contains attributes


such as title,author, ISBN, and price.
 Category: Represents a category or genre of books in the
bookstore Contains attributes such as name and description.
 Customer: Represents a customer who has registered with the
bookstore Contains attributes such as name, address, and email.
 Order: Represents an order placed by a customer. Contains
attributes such as order date and total price. Also has a foreign
key reference to the Customer entity, indicating which customer
placed the order.
 Book_Category: Represents the many-to-many relationship
between
 books and categories. Contains foreign key references to both
the Book and Category entities.
 Order_Book: Represents the many-to-many relationship
between orders and books. Contains foreign key references to
both the Order and Book entities.
Relationships:
 One book can belong to multiple categories (Many-to-Many).
 One category can have multiple books (One-to-Many).
 One customer can place multiple orders (One-to-Many).
 One order can contain multiple books (One-to-Many).

SCREENSHOTS:
TASK 02:

Entities and Attributes:


1. Department:
 department_id (Primary Key)
 name
2. Course:
 course_id (Primary Key)
 name
 department_id (Foreign Key)
3. Student:
 student_id (Primary Key)
 name
 email
4. Professor:
 professor_id (Primary Key)
 name
 department_id (Foreign Key)
5. Assessment:
 assessment_id (Primary Key)
 type
 course_id (Foreign Key)
6. Grade:
 grade_id (Primary Key)
 value
 assessment_id (Foreign Key)
 student_id (Foreign Key)
7. Club:
 club_id (Primary Key)
 name
8. Event:
 event_id (Primary Key)
 name
 club_id (Foreign Key)

RELATIONSHIP:

1. Department - Course: (One-to-Many)


 A department can offer multiple courses, but a course
belongs to only one department.
2. Course - Assessment: (One-to-Many)
 A course can have multiple assessments (exams,
assignments, etc.), but each assessment belongs to only
one course.
3. Course - Professor: (Many-to-Many)
 Professors teach multiple courses, and a course can be
taught by multiple professors.
4. Student - Course: (Many-to-Many)
 Students can enroll in multiple courses, and a course can
have multiple students enrolled.
5. Assessment - Grade: (One-to-Many)
 An assessment (such as an exam or assignment) can have
multiple grades, but each grade is for only one assessment.
6. Student - Grade: (One-to-Many)
 A student can have multiple grades (for different
assessments), but each grade is for only one student.
7. Student - Club: (Many-to-Many)
 Students can belong to multiple clubs, and a club can have
multiple student members.
8. Club - Event: (One-to-Many)
 A club can organize multiple events, but each event is
organized by only one club.

SCREENSHOT

You might also like