Digital Media Technology Week 13
Exercise 5, week 11
Exercise 6, week 11
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
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 ;
DELETE DATABASE TREASURE ; DROP TABLE CREATOR ;
SELECT TITLE, YEAR FROM TREASURE ; TITLEYEAR Sidereus Nuncius1610 Requiem KV Rabbit Hunt, in the lower left Brueghel 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
SELECT * FROM TREASURE ; treasure_idtitleyearcreatorlibrarysubject 1Sidereus Nuncius161077SCI 2Requiem KV MUS 3Rabbit Hunt, in the lower left Brueghel ART 4De antiquitate Britanicae Ecclesiae ART 5Vedute di Roma con scene di costume HIS 6Corrected page proofs of 'Les Fleurs du mal' HIS 7Vinegar Hill, charge of the 5th Dragoon Guards HIS 8Poster of "Internationale Ausstellung für Buchgewerbe und Graphik" ART 9Fontana dei Fiumi a Piazza Navona ART
SELECT TITLE, YEAR FROM TREASURE ORDER BY YEAR ; TITLEYEAR Rabbit Hunt, in the lower left Brueghel De antiquitate Britanicae Ecclesiae1572 Sidereus Nuncius1610 Fontana dei Fiumi a Piazza Navona1734 Requiem KV 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
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
Functions □ COUNT ( ) ; □ SUM ( ) ; □ AVG ( ) ; □ MIN ( ) ; □ MAX ( ) ;
SELECT COUNT(*) FROM TREASURE ; 9
SELECT COUNTRY_BORN, COUNT(*) FROM CREATOR GROUP BY COUNTRY_BORN ; Query1 COUNTRY_BORN AT1 BE1 DE1 FR1 GB1 IE2 IT2 NL1
Query creator_ id name_lastname_first year _of_ birth year_of _death country _born 2MozartWolfgang Amadeus AT 3Bruegel The Elder Pieter BE 5TiemannWalter DE 1BaudelaireCharles FR 8ParkerMatthew GB 4SadlerWilliam IE 10MolyneuxDaniel IE 6MacchiavelliGiacomo IT 7GalileiGalileo IT 9WittelCaspar van NL
COUNTRY_BORN ie2 it2 SELECT COUNTRY_BORN, COUNT(*) FROM CREATOR GROUP BY COUNTRY_BORN HAVING COUNT(*) >= 2 ;
Joining tables SELECT NAME_FIRST, NAME_LAST, TITLE FROM TREASURE, CREATOR WHERE CREATOR = CREATOR_ID ;
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 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
HTML PHP http SQL SERVER CLIENT HTML db
Digital Media Technology □ Many topics: XML, XHTML, CSS, TEI, XSLT, XPath, PHP, ERD, SQL □ Framework / General principles □ Way of thinking □ Lifecycle of digital objects
Digital Humanities