0% found this document useful (0 votes)
63 views2 pages

cs403p Assignment Soluton-2024

The document describes relational algebra operations performed on two tables, Teacher and Class. It selects rows from Teacher where Department is 'CS', projects selected columns from Class, and projects columns after selecting rows from Teacher where Rank is 'Lecturer'.

Uploaded by

naeemullah142001
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)
63 views2 pages

cs403p Assignment Soluton-2024

The document describes relational algebra operations performed on two tables, Teacher and Class. It selects rows from Teacher where Department is 'CS', projects selected columns from Class, and projects columns after selecting rows from Teacher where Rank is 'Lecturer'.

Uploaded by

naeemullah142001
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/ 2

1. Represent the above database relations as a two-dimensional structure called Table.

Teacher Table:

TeacherID Name Rank Department Salary

T001 Dr. Najma Waheed Professor CS 170000

T002 Dr. Nouman Masood Assistant Professor MGT 120000

T003 Dr. Farhana Khan Professor CS 150000

T004 Dr. Tayyaba Ali Professor CS 140000

T005 Mr. Nouman Ahmad Lecturer MGT 80000

T006 Mr. Waqass Raheem Lecturer ENG 75000


Class Table:

ClassID CourseCode DayofWeek Venue Department

A001 CS403 Monday A Block CS

B002 MGT101 Tuesday B Block MGT

C003 ENG201 Monday C Block ENG

B005 CS403 Friday B Block CS


2. Perform the following relational algebra operations on the given relations/tables and provide resultant tables. i. σ Department = ‘CS’ (Teacher)Teacher Table

TeacherID Name Rank Department Salary

(Department = ‘CS’):
T001 Dr. Najma Waheed Professor CS 170000

T003 Dr. Farhana Khan Professor CS 150000

T004 Dr. Tayyaba Ali Professor CS 140000


ii. Π ClassID, DayofWeek, Venue (Class)

Class Table (Projection of ClassID, DayofWeek, Venue):

ClassID DayofWeek Venue

A001 Monday A Block

B002 Tuesday B Block

C003 Monday C Block

B005 Friday B Block


iii. Π Name, Rank, Department ( σ Rank = ‘Lecturer’ (Teacher) )

TeacherID Name Rank Department

Teacher Table (Rank = ‘Lecturer’):


T005 Mr. Nouman Ahmad Lecturer MGT

T006 Mr. Waqass Raheem Lecturer ENG

Teacher Table (Projection of Name, Rank, Department where Rank = ‘Lecturer’):

Name Rank Department

Mr. Nouman Ahmad Lecturer MGT

Mr. Waqass Raheem Lecturer ENG

You might also like