1 Explicit and Implicit LIST Aggregate Function for Relational Databases Witold Litwin Université Paris 9 Dauphine

Slides:



Advertisements
Similar presentations
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Advertisements

You have been given a mission and a code. Use the code to complete the mission and you will save the world from obliteration…
Advanced Piloting Cruise Plot.
Chapter 1 The Study of Body Function Image PowerPoint
1 Copyright © 2010, Elsevier Inc. All rights Reserved Fig 2.1 Chapter 2.
By D. Fisher Geometric Transformations. Reflection, Rotation, or Translation 1.
Business Transaction Management Software for Application Coordination 1 Business Processes and Coordination.
Summary of Convergence Tests for Series and Solved Problems
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
My Alphabet Book abcdefghijklm nopqrstuvwxyz.
Multiplying binomials You will have 20 seconds to answer each of the following multiplication problems. If you get hung up, go to the next problem when.
0 - 0.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Addition Facts
Year 6 mental test 5 second questions
Year 6 mental test 10 second questions
Fourth normal form: 4NF 1. 2 Normal forms desirable forms for relations in DB design eliminate redundancies avoid update anomalies enforce integrity constraints.
Relational data objects 1 Lecture 6. Relational data objects 2 Answer to last lectures activity.
Relational data integrity
Around the World AdditionSubtraction MultiplicationDivision AdditionSubtraction MultiplicationDivision.
2010 fotografiert von Jürgen Roßberg © Fr 1 Sa 2 So 3 Mo 4 Di 5 Mi 6 Do 7 Fr 8 Sa 9 So 10 Mo 11 Di 12 Mi 13 Do 14 Fr 15 Sa 16 So 17 Mo 18 Di 19.
ZMQS ZMQS
1 Copyright Copyright 2012.
Unité 3 Leçon oui! Yes! 2. mais oui! Sure! 3. Bien sûr! Of course! 4. Non! No 5. Mais non! Of course not! 6. Peut-être Maybe 7. Pierre est….. Pierre.
SQL: The Query Language Part 2
REVIEW: Arthropod ID. 1. Name the subphylum. 2. Name the subphylum. 3. Name the order.
ABC Technology Project
CS 3630 Database Design and Implementation. Where Clause and Aggregate Functions -- List all rooms whose price is greater than the -- average room price.
© Paradigm Publishing, Inc Access 2010 Level 1 Unit 1Creating Tables and Queries Chapter 2Creating Relationships between Tables.
1 Undirected Breadth First Search F A BCG DE H 2 F A BCG DE H Queue: A get Undiscovered Fringe Finished Active 0 distance from A visit(A)
Green Eggs and Ham.
VOORBLAD.
15. Oktober Oktober Oktober 2012.
1 Breadth First Search s s Undiscovered Discovered Finished Queue: s Top of queue 2 1 Shortest path from s.
“Start-to-End” Simulations Imaging of Single Molecules at the European XFEL Igor Zagorodnov S2E Meeting DESY 10. February 2014.
BIOLOGY AUGUST 2013 OPENING ASSIGNMENTS. AUGUST 7, 2013  Question goes here!
Factor P 16 8(8-5ab) 4(d² + 4) 3rs(2r – s) 15cd(1 + 2cd) 8(4a² + 3b²)
Squares and Square Root WALK. Solve each problem REVIEW:
© 2012 National Heart Foundation of Australia. Slide 2.
Lets play bingo!!. Calculate: MEAN Calculate: MEDIAN
LO: Count up to 100 objects by grouping them and counting in 5s 10s and 2s. Mrs Criddle: Westfield Middle School.
Understanding Generalist Practice, 5e, Kirst-Ashman/Hull
Chapter 5 Test Review Sections 5-1 through 5-4.
GG Consulting, LLC I-SUITE. Source: TEA SHARS Frequently asked questions 2.
Addition 1’s to 20.
25 seconds left…...
Equal or Not. Equal or Not
Slippery Slope
Test B, 100 Subtraction Facts
Januar MDMDFSSMDMDFSSS
Week 1.
We will resume in: 25 Minutes.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Intracellular Compartments and Transport
Bottoms Up Factoring. Start with the X-box 3-9 Product Sum
A SMALL TRUTH TO MAKE LIFE 100%
PSSA Preparation.
Immunobiology: The Immune System in Health & Disease Sixth Edition
Essential Cell Biology
How Cells Obtain Energy from Food
Immunobiology: The Immune System in Health & Disease Sixth Edition
CpSc 3220 Designing a Database
Traktor- og motorlære Kapitel 1 1 Kopiering forbudt.
Presentation transcript:

1 Explicit and Implicit LIST Aggregate Function for Relational Databases Witold Litwin Université Paris 9 Dauphine

2 Summary New Aggregate Function Transforms a set of values into single one –Char type A basic long time need Should be highly useful

3 Plan Motivating Examples Explicit LIST Implicit LIST Conlusion Further Work

4 Motivating Example 1 The Supplier-Part (SP) table of the best- known S-P database

5 Motivating Example 1 The classical query : select SP.[S#], Sum(SP.Qty) AS [Total Qty] from SP group By SP.[S#]; S#Total Qty S11300 S2700 S3200 S4900 How to get also the individual quantities ?

6 Motivating Example 2 A database of persons having: –Multiple Hobbies –Multiple preferred Restaurants –Many Friends Best design: –four 4-NF tables P (SS #, Name), H (SS#, Hobby), R (SS#, Rest), F (SS#, Friend)

7 Database

8 Fragment

9 Query select P.[SS#], P.Name, F.Friend, R.Rest, H.Hobby from ((P INNER JOIN F ON P.[SS#] = F.[SS#]) INNER JOIN H ON P.[SS#] = H.[SS#]) INNER JOIN R ON P.[SS#] = R.[SS#] where P.[SS#] ="ss1" ; Select Name, Friends, Restaurants, Hobbies, of Person SS1 SQL :

10 Result Usable ???

11 General Problem Current RDBs manage tables in 1NF –All attributes are single-valued (atomic values) Example 1 ; We wished –Single-valued attribute : SUM(QTY) –Multi-valued attribute Individual quantities The result would not be 1NF

12 General Problem RDB manages tables in 1NF –All attributes are single-valued Example 2 ; We wished : –Single-valued attributes : S#, Name –Multi-valued attributes (multi-sets): Hobby, Rest, Friend The result is normalized to 1NF –{(ss1,Witold, x, y, z) : x Hobby, y Rest, z Friend } –The table is not in 4NF –Subject to well-known anomalies

13 Solutions Design RDBS for 0NF tables –A revolution –0NF RDBS will not be here for years Aggregate set or multi-set values into atomic values –An evolution –All RDBS already do it using: SUM, AVG, COUNT… perhaps with GROUP BY –We need a new aggregate leaving the entire set visible E.g: (multi)-set of values X => (single) list of values X

14 Local Culinary Example The set-valued attribute: –(Schwarz, Wälder; Kirchen, Chocoladen, Torte) The aggregated attribute: –Schwarzwälderkirchenchocoladentorte Local specialty, try it !

15 Explicit LIST function Select S#, sum (Qty) AS [Total Qty], LIST (Qty) AS Histogram from SP group by S#;

16 Explicit LIST function select P.SS#, Name, LIST (DISTINCT (Friend)), LIST (DISTINCT (Rest)), LIST (DISTINCT (Hobby)) from P, F, R, H where P.SS# = F.SS# and F.SS# = R.SS# and R.SS# = H.SS# and P.SS# ="ss1" group by P.SS#, Name ; P NameFriend RestHobby SS1WitoldAlexis, Christopher, Ron, Jim, Donna, Elisabeth, Dave, Peter, Per-Ake, Thomas Bengal, Cantine Paris 9, Chef Wu, Ferme de Condé, Miyake, Louis XIII, Mela, North Beach Pizza, Pizza Napoli, Sushi Etoile Bike, Classical Music, Good food, Hike, Movie, Science Fiction, Ski, Swim, Tennis, Wine

17 Explicit LIST function Simulated actual output using MsAccess forms with list boxes Form with three subforms No SQL query used

18 Explicit LIST function select P#, SUM (Qty) as [Total Qty], LIST (S#, Qty) as [Per supplier] from SP group by P#; P#Total Qty Per supplier p1600s1 300 s2 300 p21000s1 200 s2 400 s3 200 s4 200 p3400s1 400 p4500s1 200 s4 300 p5500s1 100 s4 400 p6100s1 100

19 Implicit LIST function For any single-valued A : –A = LIST (A) Any non-aggregated attribute in an SQL query has to be in the GROUP BY clause Now, any non-aggregated perhaps composite attribute A from a single table and not in GROUP BY clause is implicitly under –LIST (DISTINCT (A)) Queries may become less procedural

20 Implicit LIST function select P#, SUM (Qty) as [Total Qty], S#, Qty from SP group by P# having S# QTY like *s4*; Implicit LIST is LIST (S#, QTY)

21 Implicit LIST function Query Select S.*, P#, Qty From S, SP Where S.S# = SP.S# Repeats all the data of the supplier S in every resulting tuple –6 times for S1: its Name, City, Status Query Select S.*, P#, Qty From S, SP Where S.S# = SP.S# Group By S.S# Does it only once per supplier Less redundancy

22 Implicit Joins and From Equijoins following the referential semantic links or integrity may be implicit MsAccess, SQL Server… FROM clause content can be inferred from the attribute names Even less procedural formulation may result: select P.SS#, Name, Friend, Rest, Hobby group by P.SS#, Name ;

23 Implementation Issues Should be easy for the RDBS owner –Any RDB already processes the aggregates Already done hiding the list Should also be shown

24 Implementation Issues For explicit LIST, foreign function interface may suffice –Oracle, DB2, Yukon… –See related work in the paper for current (limited) proposals Oracle & iAnywhere (core code) Not for the implicit LIST –Access to core code is necessary

25 Conclusion LIST is a new aggregate function Aggregates a multi-valued attribute into a single value Responds to a long-standing fundamental RDBS user need - 30 years ? Should be rather easy to implement Future work should start with the implementation –Using foreign functions for explicit LIST

26 Research Support European Commission ICONS Project –no. IST Microsoft Research

27 Thank You for Your Attention Witold Litwin Université Paris 9 Dauphine