1 / 26

Digital Media Technology

Digital Media Technology. Week 12. Attributes, values and queries Angular brackets, tags and series. Database DBMS Tables, Rows, Columns, Records, Fields Relational data model Data redundancy. foreign key. primary key. FK = PK. Entity Relationship Diagrams. PERSON. P_ID NAME E-MAIL

havard
Download Presentation

Digital Media Technology

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Digital Media Technology Week 12

  2. Attributes, values and queries Angular brackets, tags and series

  3. Database • DBMS • Tables, Rows, Columns, Records, Fields • Relational data model • Data redundancy

  4. foreign key primary key

  5. FK = PK

  6. Entity Relationship Diagrams

  7. PERSON P_ID NAME E-MAIL PHONE DATE_OF_BIRTH Attributes PK is underlined

  8. COMPANY BOOK PERSON

  9. Cardinality of many is represented by a line ending in a crow's foot.

  10. COMPANY PERSON P_ID C_ID many many one one EMPLOYMENT E_ID P_ID C_ID many many

  11. A look-up table (based on ISO 3166-1993 )

  12. 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.

  13. 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 );

  14. Implementation • Data entry • Database Design • Data Retrieval

  15. Interpretation continuum Data: relatively unstructured Information: very structured Source: Obrst and Liu, Knowledge representation, Ontological Engineering and Topic Maps, in: XML Topic Maps, 2003

  16. SQL: Structured Query Language • Supported by most RDBMSs. • Makes use of regular English words

  17. SELECT TITLE, YEAR FROM TREASURE ;

  18. SELECT * FROM TREASURE ;

  19. SELECT TITLE, YEARFROM TREASUREORDER BY YEAR ;

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

  21. SELECT TITLE, YEAR FROM TREASURE WHERE YEAR > 1800 ;

  22. SELECT DISTINCT SUBJECT FROM TREASURE ;

  23. Exercise 5

  24. Exercise 6

More Related