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

IIT2022263 DBMS Lab5

The document contains a series of database queries related to students, courses, and employees. It includes operations such as selection, projection, and joins to extract specific information from the database. The queries focus on various attributes like student names, course details, and employee information based on certain conditions.

Uploaded by

deadpoolupadhyay
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 views2 pages

IIT2022263 DBMS Lab5

The document contains a series of database queries related to students, courses, and employees. It includes operations such as selection, projection, and joins to extract specific information from the database. The queries focus on various attributes like student names, course details, and employee information based on certain conditions.

Uploaded by

deadpoolupadhyay
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

DBMS Lab5

Q1)

1. π_student_name(σ_major='Computer Science'(Students))

2. π_course_name, instructor(Enrollments ⨝_(Enrollments.course_id =


Courses.course_id) σ_semester='Spring 2024'(Courses))

3. π_student_name, grade(σ_course_name='Database Management' ∧


instructor='Professor Smith'(Enrollments ⨝_(Enrollments.course_id =
Courses.course_id) Courses))

4. ρ(CourseAvg, π_course_id, avg(grade)(σ_course_name='Introduction to


Programming'(Enrollments)))

5. γ_major(count(student_id) → num_students)(Students)

6. π_student_name(Students - π_student_id(σ_semester='Fall 2023'(Enrollments)))

7. π_student_name((Students ⨝ Enrollments) ÷ π_course_id(σ_semester='Spring


2024'(Courses)))

8. π_student_name, major(Students ⨝ Enrollments ⨝_(Enrollments.course_id =


Courses.course_id ∧ Courses.instructor='Professor Johnson') Courses)

9. π_course_name(γ_course_name(count(enrollment_id) →
num_enrollments)(σ_semester='Spring 2024'(Enrollments)))

10. π_student_name, major(Students ⨝_(Students.student_id = Enrollments.student_id)


γ_student_id, max(grade) → max_grade(Enrollments))

Q2)
1. π_fname, address(σ_Dname='Research'(Employee ⨝ Department))
2. π_PNumber, DNum, MGRSSN, MGRStartDate(σ_PLocation='Stafford'(Project)) ⨝
Department

3. π_PNumber(Works_On ⨝ σ_lname='Smith'(Employee)) ∪ π_PNumber(Project ⨝


σ_Dnumber=Department.Dnumber ∧ DName='Research' ∧ MGRSSN=Employee.SSN ∧
lname='Smith'(Department ⨝ Employee))

4. π_fname, lname(σ_ESSN not in (π_ESSN(Dependent))(Employee)) 5. π_fname,


lname(σ_SSN in (π_MGRSSN(σ_SSN in (π_ESSN(Dependent))(Employee))))

You might also like