Access Final Fall 2014 Query 9

Slides:



Advertisements
Similar presentations
ER Model For a college DB
Advertisements

Intermediate Accounting
AESuniversity Ad hoc Reporting. Ad hoc Reports What are ad hoc reports? Why would you use ad hoc reports? Creating an ad hoc report from a query Building.
Query Optimization Reserves Sailors sid=sid bid=100 rating > 5 sname (Simple Nested Loops) Imperative query execution plan: SELECT S.sname FROM Reserves.
Data Bits Many to Many Subkeys JoinsQueries Attributes $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 Final DataBit.
Relational Algebra and SQL Exercises
Integer Subtraction Subtraction with positive and negative integers.
CREATE VIEW SYNTAX CREATE VIEW name [(view_col [, view_col …])] AS [WITH CHECK OPTION];
Incremental Maintenance for Non-Distributive Aggregate Functions work done at IBM Almaden Research Center Themis Palpanas (U of Toronto) Richard Sidle.
Query Evaluation. An SQL query and its RA equiv. Employees (sin INT, ename VARCHAR(20), rating INT, age REAL) Maintenances (sin INT, planeId INT, day.
Query Evaluation. SQL to ERA SQL queries are translated into extended relational algebra. Query evaluation plans are represented as trees of relational.
Database table design Single table vs. multiple tables Sen Zhang.
Sim2Imp (Simulation to Implementation) Breakout J. Wawrzynek, K. Asanovic, G. Gibeling, M. Lin, Y. Lee, N. Patil.
Google’s Map Reduce. Commodity Clusters Web data sets can be very large – Tens to hundreds of terabytes Cannot mine on a single server Standard architecture.
Computer organization at the logic level Some not so famous last words.
ONE PASS ALGORITHM PRESENTED BY: PRADHYUMAN RAOL ID : 114 Instructor: Dr T.Y. LIN.
©Silberschatz, Korth and Sudarshan3.1Database System Concepts - 6 th Edition SQL Schema Changes and table updates instructor teaches.
SQL Operations Aggregate Functions Having Clause Database Access Layer A2 Teacher Up skilling LECTURE 5.
Access Query Builder: Building Queries with the Principle of Least Information Karl Lieberherr.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 3: Introduction.
Chapter 3 Introduction to SQL Yonsei University 1 st Semester, 2015 Sanghyun Park.
©Silberschatz, Korth and Sudarshan1Database System Concepts - 6 th Edition E-R Diagram for a University Enterprise.
Copyright © Curt Hill Queries in SQL More options.
INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS Dr. Adam Anthony Fall 2012.
1 Psych 5500/6500 Measures of Variability Fall, 2008.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Module A: Formal Relational.
CS 405G: Introduction to Database Systems Instructor: Jinze Liu Fall 2009.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 6 The Relational Algebra and Relational Calculus.
Computing & Information Sciences Kansas State University Monday, 03 Nov 2008CIS 560: Database System Concepts Lecture 27 of 42 Monday, 03 November 2008.
Access Test Solutions Fall 2014 Questions 7 and 8 Karl Lieberherr.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 4: Intermediate.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 6: Formal Relational.
Chapter 3 Introduction to SQL
Chapter 3 Introduction to SQL(2)
Chapter 6: Set Operators
Introduction to SQL.
Chapter 3 Introduction to SQL(3)
External Sorting Chapter 13
Data stream as an unbounded table
Chapter 6: Formal Relational Query Languages
VIII. Land Revisited Essay
continued on next slide
CS222P: Principles of Data Management Lecture #15 Query Optimization (System-R) Instructor: Chen Li.
Relational Schemas Classroom (building, room-number, capacity) Department (dept-name, building, budget) Course (course-id, title, dept-name, credits) Instructor.
Access Patterns Karl Lieberherr 11/8/2018 Access Patterns.
CS222: Principles of Data Management Notes #13 Set operations, Aggregation Instructor: Chen Li.
CS 405G: Introduction to Database Systems
                                                                                                                                                                                                                                                
continued on next slide
continued on next slide
cs638/838 - Spring 2017 (Shavlik©), Week 7
عمل الطالبة : هايدى محمد عبد المنعم حسين
Multiplying Binomial Radial Expressions and Rationalizing with Conjugates. MA.912.A.6.2 Add, subtract, multiply, and divide radical expressions (Square.
Combining Like Terms that Contain Fractions
External Sorting Chapter 13
KMeans Clustering on Hadoop Fall 2013 Elke A. Rundensteiner
Concurrency in Go CS 240 – Fall 2018 Rec. 2.
Chapter 2: Intro to Relational Model
Chapter 7: Entity-Relationship Model
Access: Queries III Participation Project
Chapter 6: Formal Relational Query Languages
A Very Brief Introduction to Relational Databases
Distribute and combine like terms
CS222: Principles of Data Management Lecture #15 Query Optimization (System-R) Instructor: Chen Li.
External Sorting Chapter 13
Evaluation of Relational Operations: Other Techniques
continued on next slide

continued on next slide
Group Operations Part IV.
Presentation transcript:

Access Final Fall 2014 Query 9 Karl Lieberherr

Query 9: how many courses have been taught by a single instructor during 2011. Query plan Select 2011 courses and their instructors. Then we only have to deal with CourseIDs and InstructorIDs. A nice reduction. Selection Pattern. Eliminate duplicates because an instructor might have taught the same course several times. Required Elimination of Duplicates. Count courses per instructor. CountForOther Pattern. List courses who have one instructor. Selection Pattern. Count those courses. CountForSelf Pattern.

Combines steps 1 and 2.

Output

Alternative for 9a Use property sheet and select: Unique Values = YES. Replaces group-by.

see property sheet next slide.

Unique Values

Combine 3 and 4.

Output

Step 5

Deviation from Principle of Least Information Combining a totals-query with a selection query is considered ok because first the aggregation is done followed by the selection. It is a convenient abbreviation. We can still see the intermediate results by developing the query incrementally.