{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

slides17 - Schedule Today Mar 7(TH x More OQL x Read...

Info icon This preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Winter 2002 Arthur Keller – CS 180 17–1 Schedule Today: Mar. 7 (TH) More OQL. Read Sections 9.2-9.3. Mar. 12 (T) Semistructured Data, XML, XQuery. Read Sections 4.6-4.7. Assignment 8 due. Mar. 14 (TH) Data Warehouses, Data Mining. Project Part 7 due. Mar. 16 (Sa) Final Exam. 12–3PM. In class.
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Winter 2002 Arthur Keller – CS 180 17–2 Subqueries Used mainly in FROM clauses and with quantifiers EXISTS and FORALL . Example: Subquery in FROM Find the manufacturers of the beers served at Joe's. SELECT DISTINCT b.manf FROM ( SELECT s.beer FROM Sells s WHERE s.bar.name = "Joe's Bar" ) b
Image of page 2
Winter 2002 Arthur Keller – CS 180 17–3 Quantifiers Boolean-valued expressions for use in WHERE -clauses. FOR ALL x IN <collection> : <condition> EXISTS x IN <collection> : <condition> The expression has value TRUE if the condition is true for all (resp., at least one) elements of the collection. Example Find all bars that sell some beer for more than $5. SELECT b.name FROM Bars b WHERE EXISTS s IN b.beersSold : s.price > 5.00 Problem How would you find the bars that only sold beers for more than $5?
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Winter 2002 Arthur Keller – CS 180 17–4 Example Find the bars such that the only beers they sell for more than $5 are manufactured by Pete’s. SELECT b.name FROM Bars b WHERE FOR ALL be IN ( SELECT s.beer FROM b.beersSold s WHERE s.price > 5.00 ) : be.manf = "Pete's"
Image of page 4
Winter 2002 Arthur Keller – CS 180 17–5 Extraction of Collection Elements a) A collection with a single member: Extract the member with ELEMENT . Example Find the price Joe charges for Bud and put the result in a variable p .
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern