the systems group at eth zurich xml and databases exercise session 3 ghislain fourny © department...

Post on 20-Dec-2015

215 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

The Systems Groupat ETH Zurich

XML and DatabasesExercise Session 3

Ghislain Fourny

© Department of Computer Science | ETH Zürich

Department of Computer Science

Exercise 1: Comparison with RDB

2

Department of Computer Science

Exercise 1: Primary keys?

3

code name tax flightID seatNo date

credit card

Passport number name address

Airport Flight

Passenger

source

dest

book

1

1

N

N

N

M

Department of Computer Science

Exercise 1: Primary keys

4

code name tax flightID seatNo date

credit card

Passport number name address

Airport Flight

Passenger

source

dest

book

1

1

N

N

N

M

Department of Computer Science

Exercise 1: Primary keys with XML Schema

5

Department of Computer Science

Exercise 1: M-N relationship?

6

code name tax flightID seatNo date

credit card

Passport number name address

Airport Flight

Passenger

source

dest

book

1

1

N

N

N

M

Department of Computer Science

Exercise 1: M-N relationship

7

code name tax flightID seatNo date

credit card

Passport number name address

Airport Flight

Passenger

source

dest

book

1

1

N

N

N

M

Department of Computer Science

Exercise 1: Reservation with XML Schema

8

Department of Computer Science

Exercise 1: Reservation with XML Schema

9

Department of Computer Science

Exercise 2: Foreign-key constraints?

10

Department of Computer Science

Exercise 2: Foreign-key constraints

11

Department of Computer Science

Exercise 1: Foreign-key constraints?

12

Department of Computer Science

Exercise 1: Foreign-key constraints

13

Department of Computer Science

Exercise 1: Foreign-key constraints with XML Schema

14

Department of Computer Science

Exercise 1: Which constraints DTD can express

15

Department of Computer Science

Exercise 1: Which constraints DTD can express

Unique constraints with IDs

But on whole document (in XML Schema,

selector allows to define domain of uniqueness)

References with IDREFs

In DTD, IDs and IDREFs must begin with a letter

– in XML Schema, any value can be used

16

Department of Computer Science 17

Hope to see you next week!Hope to see you next week!

top related