90 likes | 185 Vues
Explore relational algebra examples to solve query problems efficiently. Learn how to divide databases and interpret results with practical T1/T2 examples. Find solutions to various query challenges, including faculty search, course prerequisites, class capacities, and student grades.
E N D
Relational Algebra • Divide Examples • Query Problems
Divide Example T1 T2
What is the result of the following divide expression? T1 / T2
Divide Example CoursesCompleted DatabaseCourseCodes
Divide Example • What is the result of the following query? • CoursesCompleted / DatabaseCourses • What question could the above expression be an answer to?
Query Problems • Find the faculty (all attributes) in the computer science department (DeptID CS) • Find the names of faculty in the computer science department • Find the capacity of classrooms with more than 100 seats • Find the names of courses that have a prerequisite of CS 220
Query Problems • Find the names of courses offered in the Spring • Find the names of students who received an Incomplete in Fall 2012. • Find the names of courses that have never been taught. • Find the names of faculty who taught a class in Spring of 2012 • Find the names of students who have passed all prerequisites for CS 442
Query Problems • Find the names of students who have passed all computer science courses. • Find the names of faculty who taught a courses that is a prerequisite for MTH 444 in Fall 2012. • Find the names of faculty who taught all courses that are prerequisites for MTH 444 in Fall 2012.
Query Problems • Find the class(es) with the smallest enrollment in Spring of 2013. • Find the name(s) of the course(s) worth the most credits