Introduction to Data Management CSE 344. Section 6: Relational Calculus and Some XML

Similar documents
Database Systems CSE 414. Lecture 7: SQL Wrap-up

Biocides IT training Vienna - 4 December 2017 IUCLID 6

Biocides IT training Helsinki - 27 September 2017 IUCLID 6

Designing Great Beers: The Ultimate Guide To Brewing Classic Beer Styles By Ray Daniels

Yelp Chanllenge. Tianshu Fan Xinhang Shao University of Washington. June 7, 2013

News English.com Ready-to-use ESL/EFL Lessons by Sean Banville

Jerk From Jamaica: Barbecue Caribbean Style By Helen Willinsky, Ed Anderson READ ONLINE

4/10/17. Announcements. Database Systems CSE 414. Examples of Complex Queries. Recap from last lecture. Example 1. Example 1

The Design Cookbook: Recipes For A Stylish Home By Kelly Edwards

Good Housekeeping Best Recipes 2000 (Good Housekeeping Annual Recipes) By The Editors of Good Housekeeping

BLACK COFFEE BY AGATHA CHRISTIE DOWNLOAD EBOOK : BLACK COFFEE BY AGATHA CHRISTIE PDF

Activity 10. Coffee Break. Introduction. Equipment Required. Collecting the Data

Southern Heritage Cakes Cookbook (The Southern Heritage Cookbook Library) By Southern Heritage

GLUTEN FREE SLOW COOKER: NOURISHING MEALS MADE EASY BY ALLISON JORDAN

Phone: Visit:

Scotch The Whisky Of Scotland In Fact An By Robert B Lockhart READ ONLINE

Balancing Calories. Foods to Increase. Foods to Reduce. Enjoy your food, but eat less. Avoid oversized portions.

WINE TASTING GUIDE PDF

Deliver a comprehensive communications campaign to increase coffee consumption on a pre-competitive basis across the category

Barista at a Glance BASIS International Ltd.

25 Simple Casserole Recipes For Any Occasion By Cooking Penguin

NVIVO 10 WORKSHOP. Hui Bian Office for Faculty Excellence BY HUI BIAN

learning goals ARe YoU ReAdY to order?

Good Cook's Book Of Tomatoes By Michele Anna Jordan

WORK HARD! STAY FOCUSED! GET A SUPPORT GROUP AND WORKOUT BUDDY!

Saving Dinner: The Menus, Recipes, And Shopping Lists To Bring Your Family Back To The Table By Leanne Ely

DOWNLOAD OR READ : SPICES SALT AND AROMATICS IN THE ENGLISH KITCHEN ENGLISH COOKING ANCIENT AND MODERN VOL1 PDF EBOOK EPUB MOBI

The Great Christmas Cookie Swap Cookbook: 55 Bigbatch Recipes To Bake And Share By Good Housekeeping Institute (Editor)

SAP Fiori UX Design and Build Assignment SOMMELIER

Elvis And The Memphis Mambo Murders (A Southern Cousins Mystery Book 3) By Peggy Webb

KEVIN SHILLINGTON HISTORY OF AFRICA PDF

Food Sake Tokyo (The Terroir Guides) By Yukari Sakamoto, Takuya Suzuki

Insiders' Guide To Denver, 6th (Insiders' Guide Series) By Linda Castrone

Pizza Builder Bundle. Cut & Build Pizza Toppings Sort Counting Line Tracing Writing Practice Shape Practice

JAMS JELLIES MORE PDF

Concepts In Wine Technology By Yair Margalit PhD

DOWNLOAD OR READ : MUFFINS FAST AND FANTASTIC PDF EBOOK EPUB MOBI

LAS FRANCESAS DISFRUTAN TODO EL ANO Y... NO ENGORDAN BY GUILIANO MIREILLE

FILE // KRUPS COFFEE GRINDER GVX1 MANUAL ARCHIVE

Barbecues & Outdoor Kitchens: Fresh Design For Patio Living, Complete Guide To Construction, Simple Grills And Gourmet Kitchens By Editors of Sunset

G4G Training STAFF TRAINING MODULE 4 INSTRUCTOR GUIDE CLASS TIMELINE

Saving Heirloom Seeds: Saving Seeds Saves Our Heritage By Lara Bennet

Pairing Food And Wine For Dummies PDF

30 Easy Things To Cook And Eat (Cooking Cards) READ ONLINE

The Baker's Manual By Joseph Amendola READ ONLINE

HISTORY OF AFRICA SHILLINGTON PDF

WiX Cookbook Free Ebooks PDF

DIY Nut Milks, Nut Butters, And More: From Almonds To Walnuts By Melissa King READ ONLINE

Recipes From Mike Anderson's: Seafood And Other Southern Louisiana Favorites By Baton Rouge, Michael H. Anderson

Darjeeling tea pickers continue strike

Salsas Para Pastas/ Pasta Sauces: Unicamente Deliciosas Recetas/ Only Delicious Recipes (Serie Delicias) (Spanish Edition) READ ONLINE

Cook Without A Book: Meatless Meals: Recipes And Techniques For Part-Time And Full-Time Vegetarians By Pam Anderson

Truly, Madly, Undead-lyThis irresistible collection features stories of love amid vampires by five of today's hottest authors Kristin Cast (Tempted),

December Lesson: Eat a Rainbow

Bourbon St., Black; The New Orleans Black Jazzman By Jack V. & Barker, Danny Buerkle

Get Instant Access to ebook Cake Design PDF at Our Huge Library CAKE DESIGN PDF. ==> Download: CAKE DESIGN PDF

The Cook's Essential Kitchen Dictionary: A Complete Culinary Resource By Jacques Rolland

Touring In Wine Country: Loire By Hubrecht Duijker

raspador Documentation

Ice Cream Sandwiches: 65 Recipes For Incredibly Cool Treats By Donna Egan READ ONLINE

The Wurst Of Lucky Peach: A Treasury Of Encased Meat By Chris Ying, the editors of Lucky Peach

The Book Of Tea - Primary Source Edition By Kakuzo Okakura READ ONLINE

The Prepper's Cookbook: 300 Recipes To Turn Your Emergency Food Into Nutritious, Delicious, Life- Saving Meals By Tess Pennington

Betty Crocker's New International Cookbook By Betty Crocker

Quick-Fix Vegetarian: Healthy Home-Cooked Meals In 30 Minutes Or Less (Quick-Fix Cooking) By Robin Robertson

Part B. Read the prompts and write a sentence with an appositive that describes...

Gluten-Free Pasta: More Than 100 Fast And Flavorful Recipes With Low- And No-Carb Options By Robin Asbell READ ONLINE

DOWNLOAD OR READ : THE TOTALLY GROSS HISTORY OF ANCIENT EGYPT PDF EBOOK EPUB MOBI

DATE: McDonald s Restaurant

The Wood Pellet Smoker And Grill Cookbook Recipes And Techniques For The Most Flavorful And Delicious Barbecue

Betty Crocker's Microwave Cookbook By Crocker, Betty (1990) Paperback By Betty Crocker

THE HOME BREWER'S RECIPE DATABASE BY LES HOWARTH

Flavorwave Manual READ ONLINE

Smoke & Spice: Cooking With Smoke, The Real Way To Barbecue By Cheryl Alters Jamison

BRAUDEL MEDITERRANEAN PDF

Fun Lunch Box Recipes For Kids: Nutritious And Healthy Lunchbox Cookbook For School Meals & Snacks By Chef Haafjord, Box Kid

DOWNLOAD OR READ : THE PERFECT TEA PARTY DISNEY JUNIOR PDF EBOOK EPUB MOBI

The Sweet Life In Paris: Delicious Adventures In The World's Most Glorious - And Perplexing - City By David Lebovitz

Eat My Dust!: Henry Ford's First Race (Step Into Reading, Step 3) By Monica Kulling READ ONLINE

German Cooking Today By Dr. Oetker Verlag READ ONLINE

How To Feed Your Whole Family A Healthy, Balanced Diet: Simple, Wholesome And Nutritious Recipes For Family Meals By Gill Holcombe

Koolatron Wine Cooler 45 Bottle Manual

Diderot: La Religieuse (Critical Guides To French Texts) By Vivienne Mylne

NIGERIAN COOKBOOK PDF

Lesson 4. Choose Your Plate. In this lesson, students will:

DOWNLOAD OR READ : THE COCKTAIL GUIDE TO THE GALAXY A UNIVERSE OF UNIQUE COCKTAILS FROM THE CELEBRATED DOCTOR WHO BAR PDF EBOOK EPUB MOBI

Instant Pot Vegan Cookbook: Healthy, Easy, Cheap, Delicious Vegan Instant Pot Recipes That Will Save You Time And Money! (Instant Pot Cookbook,

MASTER FORGE GRILL OWNERS MANUAL PDF

News English.com Ready-to-use ESL / EFL Lessons

If searching for a book by Morena Cuadra, Morena Escardo The Everything Peruvian Cookbook: Includes Conchitas a la Parmesana, Chicken Empanadas,

Quick & Easy Family Dinners Cookbook By Gooseberry Patch READ ONLINE

DOWNLOAD OR READ : TIME OUT LONDON BARS PUBS AND CLUBS PDF EBOOK EPUB MOBI

DIGITAL MEDIA KIT 2016

Light Asian Salads - Quick And Healthy Vegetarian Recipes By Lanna Potter

30 Delicious Brownie & Bar Recipes By Lori Burke READ ONLINE

Bake Off Fundraising Pack

THE 4 HOUR BODY TIM FERRISS PDF

Hugh Johnson's Pocket Encyclopedia Of Wine, 1984

Dana Carpender's Carb Gram Counter: Usable Carbs, Protein, Fat, And Calories - Plus Tips On Eating Low-Carb! By Dana Carpender

Teacher s notes and key

Transcription:

Introduction to Data Management CSE 344 Section 6: Relational Calculus and Some XML CSE 344 - Fall 2015 1

Relational Calculus Review Relational predicate P is a formula given by this grammar: P ::= atom P P P P P P not(p) x.p x.p Query Q: Q(x1,, xk) = P CSE 344 - Fall 2015 2

Likes(drinker, beer) Frequents(drinker, bar) Serves(bar, beer) Review Examples Find drinkers that frequent some bar that serves some beer they like. CSE 344 - Fall 2015 3

Likes(drinker, beer) Frequents(drinker, bar) Serves(bar, beer) Review Examples Find drinkers that frequent some bar that serves some beer they like. Q(x) = y. z. Frequents(x, y) Serves(y,z) Likes(x,z) CSE 344 - Fall 2015 4

Likes(drinker, beer) Frequents(drinker, bar) Serves(bar, beer) Review Examples Find drinkers that frequent some bar that serves some beer they like. Q(x) = y. z. Frequents(x, y) Serves(y,z) Likes(x,z) Find drinkers that frequent only bars that serves some beer they like. CSE 344 - Fall 2015 5

Likes(drinker, beer) Frequents(drinker, bar) Serves(bar, beer) Review Examples Find drinkers that frequent some bar that serves some beer they like. Q(x) = y. z. Frequents(x, y) Serves(y,z) Likes(x,z) Find drinkers that frequent only bars that serves some beer they like. Q(x) = y. Frequents(x, y) ( z. Serves(y,z) Likes(x,z)) CSE 344 - Fall 2015 6

Likes(drinker, beer) Frequents(drinker, bar) Serves(bar, beer) Review Examples Find drinkers that frequent some bar that serves some beer they like. Q(x) = y. z. Frequents(x, y) Serves(y,z) Likes(x,z) Find drinkers that frequent only bars that serves some beer they like. Q(x) = y. Frequents(x, y) ( z. Serves(y,z) Likes(x,z)) Find drinkers that frequent some bar that serves only beers they like. CSE 344 - Fall 2015 7

Likes(drinker, beer) Frequents(drinker, bar) Serves(bar, beer) Review Examples Find drinkers that frequent some bar that serves some beer they like. Q(x) = y. z. Frequents(x, y) Serves(y,z) Likes(x,z) Find drinkers that frequent only bars that serves some beer they like. Q(x) = y. Frequents(x, y) ( z. Serves(y,z) Likes(x,z)) Find drinkers that frequent some bar that serves only beers they like. Q(x) = y. Frequents(x, y) z.(serves(y,z) Likes(x,z)) CSE 344 - Fall 2015 8

Likes(drinker, beer) Frequents(drinker, bar) Serves(bar, beer) Review Examples Find drinkers that frequent some bar that serves some beer they like. Q(x) = y. z. Frequents(x, y) Serves(y,z) Likes(x,z) Find drinkers that frequent only bars that serves some beer they like. Q(x) = y. Frequents(x, y) ( z. Serves(y,z) Likes(x,z)) Find drinkers that frequent some bar that serves only beers they like. Q(x) = y. Frequents(x, y) z.(serves(y,z) Likes(x,z)) Find drinkers that frequent only bars that serves only beer they like. CSE 344 - Fall 2015 9

Likes(drinker, beer) Frequents(drinker, bar) Serves(bar, beer) Review Examples Find drinkers that frequent some bar that serves some beer they like. Q(x) = y. z. Frequents(x, y) Serves(y,z) Likes(x,z) Find drinkers that frequent only bars that serves some beer they like. Q(x) = y. Frequents(x, y) ( z. Serves(y,z) Likes(x,z)) Find drinkers that frequent some bar that serves only beers they like. Q(x) = y. Frequents(x, y) z.(serves(y,z) Likes(x,z)) Find drinkers that frequent only bars that serves only beer they like. Q(x) = y. Frequents(x, y) z.(serves(y,z) Likes(x,z)) CSE 344 - Fall 2015 10

Uses(recipe, ingredient_name) Ingredient(name, category) Exercises We have a database of recipes and ingredients. An ingredient has a name and a category (meat, dairy, veggie, etc.). The relation uses captures which recipe uses which ingredient. Write a relational calculus query that returns all recipes that use ingredients from at least two different categories. Q(r) = i1. i2. c1. c2. Uses(r, i1) Uses(r,i2) Ingredient(i1,c1) Ingredient(i2,c2) c1!= c2 CSE 344 - Fall 2015 11

Uses(recipe, ingredient_name) Ingredient(name, category) Exercises We have a database of recipes and ingredients. An ingredient has a name and a category (meat, dairy, veggie, etc.). The relation uses captures which recipe uses which ingredient. Write a relational calculus query that returns all recipes that use only one category of ingredients. Return the recipe and the category. Q(r,c) = i. n. Uses(r,i) Ingredient(n,c) i2.(uses(r,i2) Ingredient(i2,c)) CSE 344 - Fall 2015 12

Uses(recipe, ingredient_name) Ingredient(name, category) Exercises We have a database of recipes and ingredients. An ingredient has a name and a category (meat, dairy, veggie, etc.). The relation uses captures which recipe uses which ingredient. Write a relational calculus query that returns all ingredients that are never used in a recipe. Q(i) = c. Ingredient(i,c) not( r. Uses(r,i)) CSE 344 - Fall 2015 13

Uses(recipe, ingredient_name) Ingredient(name, category) Exercises We have a database of recipes and ingredients. An ingredient has a name and a category (meat, dairy, veggie, etc.). The relation uses captures which recipe uses which ingredient. Write a relational calculus query that returns pairs of recipes that use the same categories of ingredients but never dairy. Q(r1,r2) = i1. i2. c. (c!= Dairy ) Uses(r1,i1) Uses(r2,i2) i3. (Uses(r1,i3) i4. (Uses(r2,i4) Ingredient(i3,c) Ingredient(i4,c)) i5. (Uses(r2,i5) i6. (Uses(r1,i6) Ingredient(i5,c) Ingredient(i6,c))) CSE 344 - Fall 2015 14

XML CSE 344 - Fall 2015 15

Saxon Setup Download Saxon http://sourceforge.net/projects/saxon/files/ Download Mondial dataset and DTD Make sure Java VM is installed

Practice with Saxon Open text editor and save a query: <result> </result> { Xpath expression} Run the program $ java -cp saxon9he.jar net.sf.saxon.query ex.xq > a1.xml To pretty print $ xmllint --format a1.xml