+ All Categories
Home > Documents > Digital Media Technology

Digital Media Technology

Date post: 22-Feb-2016
Category:
Upload: platt
View: 32 times
Download: 0 times
Share this document with a friend
Description:
Digital Media Technology. Week 10. foreign key. primary key. CREATE TABLE TREASURE ( TREASURE_ID INT (4) NOT NULL AUTO_INCREMENT, TITLE VARCHAR (150), CREATOR INT, LIBRARY CHAR(6), SUBJECT CHAR(3), YEAR INT (4), PRIMARY KEY (TREASURE_ID), - PowerPoint PPT Presentation
27
Digital Media Technology Week 10
Transcript
Page 1: Digital Media Technology

Digital Media Technology

Week 10

Page 2: Digital Media Technology

foreign keyprimary key

TREASURE_ID TITLE CREATOR LIBRARY SUBJECT YEAR

1 Sidereus Nuncius 7 7 SCI 1610

2 Requiem KV 626 2 1 MUS 1791

3 Rabbit Hunt, in the lower left Brueghel 1560. 3 3 ART 1560

4 De antiquitate Britanicae Ecclesiae 8 4 ART 1572

5 Vedute di Roma con scene di costume 6 6 HIS 1810

6 Corrected page proofs of 'Les Fleurs du mal' 1 2 HIS 1857

7 Vinegar Hill, charge of the 5th Dragoon Guards 4 5 HIS 1880

8 Poster of "Internationale Ausstellung für Buchgewerbe und Graphik" 5 9 ART 1914

9 Fontana dei Fiumi a Piazza Navona 9 6 ART 1734

CREATOR_ID NAME_LAST NAME_FIRST YEAR_OF_BIRTH YEAR_OF_DEATH COUNTRY_BORN

1 Baudelaire Charles 1821 1867 FR

2 Mozart Wolfgang Amadeus 1756 1791 AT

3 Bruegel The Elder Pieter 1525 1569 BE

4 Sadler William 1782 1839 IE

5 Tiemann Walter 1876 1951 DE

6 Macchiavelli Giacomo 1756 1811 IT

7 Galilei Galileo 1564 1642 IT

8 Parker Matthew 1504 1575 GB

9 Wittel Caspar van 1655 1736 NL

10 Molyneux Daniel 1568 1632 IE

Page 3: Digital Media Technology

CREATE TABLE TREASURE(

TREASURE_ID INT (4) NOT NULL AUTO_INCREMENT,TITLE VARCHAR (150),CREATOR INT,LIBRARY CHAR(6), SUBJECT CHAR(3), YEAR INT (4),

PRIMARY KEY (TREASURE_ID),

FOREIGN KEY (CREATOR) REFERENCES CREATOR ON DELETE RESTRICT ON UPDATE CASCADE, FOREIGN KEY (LIBRARY) REFERENCES LIBRARY ON DELETE RESTRICT ON UPDATE CASCADE,FOREIGN KEY (SUBJECT) REFERENCES SUBJECT ON DELETE RESTRICT ON UPDATE CASCADE

);

Page 4: Digital Media Technology

FK = PK

Page 5: Digital Media Technology

Semantic Web

Page 6: Digital Media Technology

Entity Relationship Diagrams

Page 7: Digital Media Technology

PERSON

P_IDNAMEE-MAILPHONEDATE_OF_BIRTH

Attributes

PK is underlined

Page 8: Digital Media Technology

BOOK

PERSON

COMPANY

Page 9: Digital Media Technology

□ Cardinality: how many instances of the entity can be associated with one instance of the related entity?

BOOK COMPANY

Page 10: Digital Media Technology

STUDENT COURSE

ENROLMENT

Page 11: Digital Media Technology

PERSON COMPANY

many many

EMPLOYMENT

P_ID C_ID

P_IDC_ID

E_ID

many

one

many

one

Page 12: Digital Media Technology

Making an ERD□ Identify entities□ Consider the cardinality of the relations

between these entities□ One-to-one relations must be removed –

these entitites can be combined in a single entity

□ Change many-to-many relations into one-to-many relations by making use of linking tables

□ Add attributes

Page 13: Digital Media Technology

code nameuk Great Britainfr Francene The Netherlandsbe Belgium

A look-up table

(based on ISO 3166-1993 )

Page 14: Digital Media Technology

Name Country_bornShelley, Percy Bysshe Great BritainSwinburne, Algernon Charles

Britain

Cowper, William United KingdomColeridge, Samuel Taylor U.K.

Page 15: Digital Media Technology

Name Country_bornShelley, Percy Bysshe ukSwinburne, Algernon Charles

uk

Cowper, William ukColeridge, Samuel Taylor uk

Page 16: Digital Media Technology

Referential Integrity

□ Each foreign key should correspond to an existing primary key.

□ Most DBMSs take measures to prevents users or applications from entering inconsistent data.

Page 17: Digital Media Technology

CREATE TABLE BOOK( B_ID INT NOT NULL AUTO_INCREMENT,

TITLE VARCHAR (50), AUTHOR INT,LANGUAGE VARCHAR (40),PUBLISHER INT,EXTENT INT,YEAR INT(4),PRIMARY KEY (B_ID),FOREIGN KEY (AUTHOR) REFERENCES

PERSON ON DELETE RESTRICT ON UPDATE CASCADE,

FOREIGN KEY (PUBLISHER) REFERENCES COMPANY ON DELETE RESTRICT ON UPDATE CASCADE );

Page 18: Digital Media Technology

Interpretation continuum

Data: relatively unstructured

Information: very structured

Source: Obrst and Liu, Knowledge representation, Ontological Engineering and Topic Maps, in: XML Topic Maps, 2003

Page 19: Digital Media Technology

□ SQL: Structured Query Language

□ Supported by most RDBMSs.

□ Makes use of regular English words

Page 20: Digital Media Technology

SELECT TITLE, YEARFROM TREASURE ;

TITLE YEARSidereus Nuncius 1610

Requiem KV 626 1791

Rabbit Hunt, in the lower left Brueghel 1560.

1560

De antiquitate Britanicae Ecclesiae 1572

Vedute di Roma con scene di costume

1810

Corrected page proofs of 'Les Fleurs du mal'

1857

Vinegar Hill, charge of the 5th Dragoon Guards

1880

Poster of "Internationale Ausstellung für Buchgewerbe und Graphik"

1914

Fontana dei Fiumi a Piazza Navona 1734

Page 21: Digital Media Technology

SELECT * FROM TREASURE ;

treasure_id title year creator library subject1 Sidereus Nuncius 1610 7 7 SCI

2 Requiem KV 626 1791 2 1 MUS

3 Rabbit Hunt, in the lower left Brueghel 1560.

1560 3 3 ART

4 De antiquitate Britanicae Ecclesiae

1572 8 4 ART

5 Vedute di Roma con scene di costume

1810 6 6 HIS

6 Corrected page proofs of 'Les Fleurs du mal'

1857 1 2 HIS

7 Vinegar Hill, charge of the 5th Dragoon Guards

1880 4 5 HIS

8 Poster of "Internationale Ausstellung für Buchgewerbe und Graphik"

1914 5 8 ART

9 Fontana dei Fiumi a Piazza Navona

1734 9 6 ART

Page 22: Digital Media Technology

SELECT TITLE, YEARFROM TREASUREORDER BY YEAR ;

TITLE YEARRabbit Hunt, in the lower left Brueghel 1560.

1560

De antiquitate Britanicae Ecclesiae 1572

Sidereus Nuncius 1610

Fontana dei Fiumi a Piazza Navona 1734

Requiem KV 626 1791

Vedute di Roma con scene di costume

1810

Corrected page proofs of 'Les Fleurs du mal'

1857

Vinegar Hill, charge of the 5th Dragoon Guards

1880

Poster of "Internationale Ausstellung für Buchgewerbe und Graphik"

1914

Page 23: Digital Media Technology

SELECT NAME_LAST, NAME_FIRST, (YEAR_OF_DEATH - YEAR_OF_BIRTH) AS AGE FROM CREATOR ;

NAME_LAST NAME_FIRST AGEBaudelaire Charles 46

Mozart Wolfgang Amadeus

35

Bruegel The Elder Pieter 44

Sadler William 57

Tiemann Walter 75

Macchiavelli Giacomo 55

Galilei Galileo 78

Parker Matthew 71

Wittel Caspar van 81

Molyneux Daniel 64

Page 24: Digital Media Technology

SELECT TITLE, YEARFROM TREASUREWHERE YEAR > 1800 ;

TITLE YEARVedute di Roma con scene di costume

1810

Corrected page proofs of 'Les Fleurs du mal'

1857

Vinegar Hill, charge of the 5th Dragoon Guards

1880

Poster of "Internationale Ausstellung für Buchgewerbe und Graphik"

1914

Page 25: Digital Media Technology

SELECT DISTINCT SUBJECTFROM TREASURE ;

SUBJECTART

HIS

MUS

SCI

Page 26: Digital Media Technology
Page 27: Digital Media Technology

Recommended