Presentation is loading. Please wait.

Presentation is loading. Please wait.

Digital Media Technology Week 13. Exercise 5, week 11.

Similar presentations


Presentation on theme: "Digital Media Technology Week 13. Exercise 5, week 11."— Presentation transcript:

1 Digital Media Technology Week 13

2 Exercise 5, week 11

3 Exercise 6, week 11

4 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 ); Structured Query Language

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

6 DELETE DATABASE TREASURE ; DROP TABLE CREATOR ;

7 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

8 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

9 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

10 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

11 Functions □ COUNT ( ) ; □ SUM ( ) ; □ AVG ( ) ; □ MIN ( ) ; □ MAX ( ) ;

12 SELECT COUNT(*) FROM TREASURE ; 9

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

14 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

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

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

17 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

18

19 HTML PHP http SQL SERVER CLIENT HTML db

20

21 Digital Media Technology □ Many topics: XML, XHTML, CSS, TEI, XSLT, XPath, PHP, ERD, SQL □ Framework / General principles □ Way of thinking □ Lifecycle of digital objects

22 Digital Humanities

23


Download ppt "Digital Media Technology Week 13. Exercise 5, week 11."

Similar presentations


Ads by Google