digital media technology week 12. □ remaining sql theory □ mysql □ data visualisation...

21
Digital Media Technology Week 12

Upload: beverley-whitehead

Post on 08-Jan-2018

216 views

Category:

Documents


1 download

DESCRIPTION

□ Database Design □ Data Retrieval □ Implementation □ Data Entry □ Data Visualisation

TRANSCRIPT

Page 1: Digital Media Technology Week 12. □ Remaining SQL theory □ MySQL □ Data visualisation Today’s lecture

Digital Media Technology

Week 12

Page 2: Digital Media Technology Week 12. □ Remaining SQL theory □ MySQL □ Data visualisation Today’s lecture

□ Remaining SQL theory

□ MySQL

□ Data visualisation

Today’s lecture

Page 3: Digital Media Technology Week 12. □ Remaining SQL theory □ MySQL □ Data visualisation Today’s lecture

□ Database Design

□ Data Retrieval

□ Implementation□ Data Entry

□ Data Visualisation

Page 4: Digital Media Technology Week 12. □ Remaining SQL theory □ MySQL □ Data visualisation Today’s lecture

□ Relation model developed by E.F. Codd in 1970□ SEQUEL implemented by Chamberlin and Boyce in 1974; Design driven by “the need for linear

notation, and the need for readable programs that are easy to maintain and modify”. □ First SQL-based RDBS, Oracle, launched in 1979□ ANSI-standard in 1986 and ISO-standard in 1987

SQL

Page 5: Digital Media Technology Week 12. □ Remaining SQL theory □ MySQL □ Data visualisation Today’s lecture

Open standards□ Adopted and maintained by an authorised standisation organization□ Documentation is fully available□ No constraints on the use or the re-use of the standard (interoperability)

Proprietary standards□ Risk of “vendor-lock in”□ Migration and system integration is often complicated

Open vs. Proprietary Standards

Page 6: Digital Media Technology Week 12. □ Remaining SQL theory □ MySQL □ Data visualisation Today’s lecture

The year of the oldest treasure in the database

SELECT MIN(YEAR)FROM TREASURE ;

1560

Query:

Result:

Page 7: Digital Media Technology Week 12. □ Remaining SQL theory □ MySQL □ Data visualisation Today’s lecture

The number of countries in the table CREATOR

SELECT COUNT( DISTINCT COUNTRY_BORN )FROM CREATOR ;

8

Query:

Result:

Page 8: Digital Media Technology Week 12. □ Remaining SQL theory □ MySQL □ Data visualisation Today’s lecture

The number of persons for each country in the table CREATOR

AT

BE

DE

FR

GB

IE

IE

IT

IT

NL

11111

2

2

1

SELECT COUNTRY_BORN , COUNT(*)

FROM CREATOR

GROUP BY COUNTRY_BORN ;

Query:

Page 9: Digital Media Technology Week 12. □ Remaining SQL theory □ MySQL □ Data visualisation Today’s lecture

Libraries that are represented by two or more treasures.

SELECT LIBRARY , COUNT(*) FROM TREASURE GROUP BY LIBRARY HAVING COUNT(*) >= 2 ;

6 2

Query:

Result:

Page 10: Digital Media Technology Week 12. □ Remaining SQL theory □ MySQL □ Data visualisation Today’s lecture

Joining tables

□ After “FROM”: Mention the two tables that you want to join□ After “WHERE”: Explain HOW the tables are related (PK = FK)

□ INNER JOIN May result in a loss of information

Page 11: Digital Media Technology Week 12. □ Remaining SQL theory □ MySQL □ Data visualisation Today’s lecture

Subjects that have been assigned to two or more treasures in the database

SELECT S.SUBJECT , COUNT(*)FROM TREASURE T, SUBJECT SWHERE T.SUBJECT = S.CODE GROUP BY S.SUBJECT HAVING COUNT(*) > 1

Query:

Result:

Art and architecture 4History 3

Page 12: Digital Media Technology Week 12. □ Remaining SQL theory □ MySQL □ Data visualisation Today’s lecture

□ MySQL: open source RDBMS

□ Extensive documentation on MySQL website

□ Databases are built using SQL queries

Page 13: Digital Media Technology Week 12. □ Remaining SQL theory □ MySQL □ Data visualisation Today’s lecture

□ MySQL may be used via command prompt;

□ Database can also be accessed, for instance, via PHP (PHPmyAdmin)

Page 14: Digital Media Technology Week 12. □ Remaining SQL theory □ MySQL □ Data visualisation Today’s lecture

<html> <head> <title></title> </head> <body> <?php $time = date("h") ; if ( $time < 12 ) { print "Good morning!" ; } elsif ( $time < 18) { print "Good afternoon!" ; } else { print "Good evening!" ; } ?> </body></html>

Page 15: Digital Media Technology Week 12. □ Remaining SQL theory □ MySQL □ Data visualisation Today’s lecture

HTMLPHP

http

SERVER

CLIENT

HTML

Page 17: Digital Media Technology Week 12. □ Remaining SQL theory □ MySQL □ Data visualisation Today’s lecture

HTMLPHP

http

MySQL

SERVER

CLIENT

HTMLdb

Page 18: Digital Media Technology Week 12. □ Remaining SQL theory □ MySQL □ Data visualisation Today’s lecture

Public interface

Page 19: Digital Media Technology Week 12. □ Remaining SQL theory □ MySQL □ Data visualisation Today’s lecture

Visualisation code libraries

□ D3.js

□ Google charts

Page 20: Digital Media Technology Week 12. □ Remaining SQL theory □ MySQL □ Data visualisation Today’s lecture

Visualisation of BTCP data

□ Line charts

□ Bar charts

□ Georeferencing

Page 21: Digital Media Technology Week 12. □ Remaining SQL theory □ MySQL □ Data visualisation Today’s lecture

BTCP Database