The document describes the 8 steps involved in database query processing: 1) a query string is parsed into a query tree, 2) the query tree is checked for validity, 3) views are removed from the valid query tree, 4) a logical query plan is generated, 5) the logical query plan is rewritten for better efficiency, 6) a selected physical plan is generated based on cost, 7) executable code is generated, and 8) the query is executed and results are returned. An example query is also provided to find the names of electrical engineering students taking at least one computer science course.
The document describes the 8 steps involved in database query processing: 1) a query string is parsed into a query tree, 2) the query tree is checked for validity, 3) views are removed from the valid query tree, 4) a logical query plan is generated, 5) the logical query plan is rewritten for better efficiency, 6) a selected physical plan is generated based on cost, 7) executable code is generated, and 8) the query is executed and results are returned. An example query is also provided to find the names of electrical engineering students taking at least one computer science course.
The document describes the 8 steps involved in database query processing: 1) a query string is parsed into a query tree, 2) the query tree is checked for validity, 3) views are removed from the valid query tree, 4) a logical query plan is generated, 5) the logical query plan is rewritten for better efficiency, 6) a selected physical plan is generated based on cost, 7) executable code is generated, and 8) the query is executed and results are returned. An example query is also provided to find the names of electrical engineering students taking at least one computer science course.
1 Query string Parser Query tree 2 Query tree Checker Valid query tree 3 Valid query tree View expander Valid tree without views 4 Valid tree without views Logical query plan generator Logical query plan 5 Logical query plan Rewriter (heuristic) Better logical query plan 6 Logical query plan Physical plan generator (cost-based) Selected physical plan 7 Physical plan Code generator Executable code 8 Executable code Execution engine Answer!
Running example Student(ID, Name, Major) // ID is key Course(Num, Dept) // Num is key Taking(ID, Num) // (ID,Num) is key
Query to find names of all EE students taking at least one CS course:
Select Distinct Name From Student, Course, Taking Where Taking.ID = Student.ID And Taking.Num = Course.Num And Major = 'EE' And Dept = 'CS'