Presentation is loading. Please wait.

Presentation is loading. Please wait.

Digital Media Technology Week 11. □ Implementation □ Database Design □ Retrieval □ Data entry.

Similar presentations


Presentation on theme: "Digital Media Technology Week 11. □ Implementation □ Database Design □ Retrieval □ Data entry."— Presentation transcript:

1 Digital Media Technology Week 11

2 □ Implementation □ Database Design □ Retrieval □ Data entry

3 □ XPath - SQL □ DTD/Schema - ERD Similarities betweeen techniques and concepts

4 Booktrade Database □ Indexes to transcriptions from the Bohn archivetranscriptions from the Bohn archive □ Relations between letters, persons, companies, titles

5 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 );

6 INSERT INTO CREATOR VALUES ('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') ; UPDATE CREATOR SET NAME_LAST='Charles Pierre' WHERE PID= 1 ;

7 DELETE DATABASE TREASURE ; DROP TABLE CREATOR ;

8 SELECT TITLE, YEAR FROM TREASURE ; TITLEYEAR Sidereus Nuncius1610 Requiem KV 6261791 Rabbit Hunt, in the lower left Brueghel 1560. 1560 De antiquitate Britanicae Ecclesiae1572 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 Navona1734

9 SELECT * FROM TREASURE ; treasure_idtitleyearcreatorlibrarysubject 1Sidereus Nuncius161077SCI 2Requiem KV 626179121MUS 3Rabbit Hunt, in the lower left Brueghel 1560. 156033ART 4De antiquitate Britanicae Ecclesiae 157284ART 5Vedute di Roma con scene di costume 181066HIS 6Corrected page proofs of 'Les Fleurs du mal' 185712HIS 7Vinegar Hill, charge of the 5th Dragoon Guards 188045HIS 8Poster of "Internationale Ausstellung für Buchgewerbe und Graphik" 191458ART 9Fontana dei Fiumi a Piazza Navona 173496ART

10 SELECT TITLE, YEAR FROM TREASURE ORDER BY YEAR ; TITLEYEAR Rabbit Hunt, in the lower left Brueghel 1560. 1560 De antiquitate Britanicae Ecclesiae1572 Sidereus Nuncius1610 Fontana dei Fiumi a Piazza Navona1734 Requiem KV 6261791 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

11 SELECT TITLE, YEAR FROM TREASURE WHERE YEAR > 1800 ; TITLEYEAR 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

12 SELECT DISTINCT SUBJECT FROM TREASURE ; SUBJECT ART HIS MUS SCI

13 SQL Functions □ COUNT ( ) ; □ SUM ( ) ; □ AVG ( ) ; □ MIN ( ) ; □ MAX ( ) ;

14 SELECT COUNT(*) FROM TREASURE ; 9

15 SELECT COUNTRY_BORN, COUNT(*) FROM CREATOR GROUP BY COUNTRY_BORN ; Query1 COUNTRY_BORN AT1 BE1 DE1 FR1 GB1 IE2 IT2 NL1

16 Query1 1 1 1 1 creator_ id name_lastname_first year _of_ birth year_of _death country _born 2MozartWolfgang Amadeus 17561791AT 3Bruegel The Elder Pieter15251569BE 5TiemannWalter18761951DE 1BaudelaireCharles18211867FR 8ParkerMatthew15041575GB 4SadlerWilliam17821839IE 10MolyneuxDaniel15681632IE 6MacchiavelliGiacomo17561811IT 7GalileiGalileo15641642IT 9WittelCaspar van16551736NL 1 1 1 1 2 2 1

17 COUNTRY_BORN ie2 it2 SELECT COUNTRY_BORN, COUNT(*) FROM CREATOR GROUP BY COUNTRY_BORN HAVING COUNT(*) >= 2 ;

18 Joining tables SELECT NAME_FIRST, NAME_FIRST, TITLE FROM TREASURE, CREATOR WHERE CREATOR = CREATOR_ID ;

19 NAME_FIRSTNAME_LASTTITLE Charles Corrected page proofs of 'Les Fleurs du mal' Wolfgang Amadeus Requiem KV 626 Pieter Rabbit Hunt, in the lower left Brueghel 1560. William Vinegar Hill, charge of the 5th Dragoon Guards Walter Poster of "Internationale Ausstellung für Buchgewerbe und Graphik" Giacomo Vedute di Roma con scene di costume Galileo Sidereus Nuncius Matthew De antiquitate Britanicae Ecclesiae Caspar van Fontana dei Fiumi a Piazza Navona

20

21 HTML PHP http SQL SERVER CLIENT HTML db


Download ppt "Digital Media Technology Week 11. □ Implementation □ Database Design □ Retrieval □ Data entry."

Similar presentations


Ads by Google