1 / 10

Semi-structured data - exercises

Semi-structured data - exercises. Exercise 1. Represent the relations below using the OEM data model. Answer exercise 1 - the OEM model. Exercise 2. Using the data model from the previous question, formulate the following queries using Lorel:

Download Presentation

Semi-structured data - exercises

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Semi-structured data-exercises

  2. Exercise 1 • Represent the relations below using the OEM data model.

  3. Answer exercise 1 - the OEM model

  4. Exercise 2 • Using the data model from the previous question, formulate the following queries using Lorel: • find all the restaurants that are located in Linkoping • find the address (city and street) of the “Hamlet” restaurant • list the restaurants by city (equivalent of GROUP BY)

  5. Answer Exercise 2 find all the restaurants that are located in Linkoping select R.name from DB.Restaurants.T R, DB.RestCities.T RC, DB.Cities.T C where R.r_id = RC.r_id and RC.c_id = C.c_id and C.name = “Linköping” list the restaurants by city (equivalent of GROUP BY) select C.name, (select R.name from DB.Restaurants .T R, DB.RestCities.T RC where R.r_id = RC.r_id and RC.c_id = C.c_id) from DB.Cities.T C

  6. Exercise 3 Restaurantguide • Draw strong and the minimal Data Guides forthe restaurant guide data model below.

  7. Answer Exercise 3 - Strong Data Guide Restaurantguide 41 restaurant cafe 66 67 42 43 nearby nearby category name address contact category name address contact 46 47 44 45 48 49 50 51 street zipcode reservation manager city street city zipcode reservation manager 52 53 54 55 56 57 58 59 60 61 phone phone phone phone 62 63 64 65

  8. Answer Exercise 3 - Strong Data Guide - continued nearby nearby 43 66 67 category name address contact name address contact 69 70 48 68 73 74 75 street zipcode reservation manager city reservation 57 58 59 71 61 56 phone 72

  9. 41: 1 42: 2,3 43: 4 44: 5 45: 6,9 46: 7,10 47: 8, 11 48: 12 49: 13 50: 14 51: 15 52: 16 53: 17 54: 18 55: 19 56: 20 57: 21 58: 22 59: 23 60: 24 61: 25 62: 26 63: 27 64: 28 65: 29 66: 3,4 67: 3 68: 9,13 69: 10,14 70: 11,15 71: 20,24 72: 27,28 73: 9 74: 10 75: 11

  10. Answer Exercise 3 - Minimal Data Guide Restaurantguide 80 restaurant cafe nearby 81 category name address contact 84 85 82 83 reservation manager street zipcode city 86 87 88 89 phone 90

More Related