Digital Media Technology Week 10. foreign key primary key TREASURE_IDTITLECREATORLIBRARYSUBJECTYEAR 1Sidereus Nuncius77SCI1610 2Requiem KV 62621MUS1791.

Slides:



Advertisements
Similar presentations
Digital Media Technology Week 11. Implementation Database Design Retrieval Data entry.
Advertisements

COP4540 Database Management System Midterm Review
Digital Media Technology Week 11. □ Implementation □ Database Design □ Retrieval □ Data entry.
Digital Media Technology Week 7. □ Database □ DBMS □ Data vs. Information □ Data redundancy □ Tables, Rows, Columns, Records, Fields □ Relational data.
Digital Media Technology Week 13. Exercise 5, week 11.
Relational Database. Relational database: a set of relations Relation: made up of 2 parts: − Schema : specifies the name of relations, plus name and type.
Keys, Referential Integrity and PHP One to Many on the Web.
Tallahassee, Florida, 2014 COP4710 Database Systems Relational Model Fall 2014.
The Relational Model. Introduction Introduced by Ted Codd at IBM Research in 1970 The relational model represents data in the form of table. Main concept.
SQL Lecture 10 Inst: Haya Sammaneh. Example Instance of Students Relation  Cardinality = 3, degree = 5, all rows distinct.
Overview Begin 6:00 Quiz15 mins6:15 Review Table Terms25 mins6:40 Short Break10 mins6:50 SQL: Creating Tables60 mins7:50 Break10 mins8:00 Lab – Creating.
Accounting System Design
Maintenance Modifying the data –Add records –Delete records –Update records Modifying the design –Add fields into tables –Remove fields from a table –Change.
COP5725 – Principles of Database Management Systems
SQL Keys and Constraints Justin Maksim. Key Declaration Key constraint defined within the CREATE TABLE command Key can be declared using either the PRIMARY.
Mapping of N:M Relationships PERSON-ID TITLE PERSON-NAME DATE-OF-BIRTH PERSON-ID PROJECT-ID HOURS-SPENT PROJECT-ID END-DATE START-DATE E-R Diagram PERSON.
5 Chapter 5 Structured Query Language (SQL1) Revision.
Database Systems Relational Model Concepts Toqir Ahmad Rana Database Management Systems 1 Lecture 17.
Page 1 ISMT E-120 Introduction to Microsoft Access & Relational Databases The Influence of Software and Hardware Technologies on Business Productivity.
Database Systems Lecture 5 Natasha Alechina
Page 1 ISMT E-120 Desktop Applications for Managers Introduction to Microsoft Access.
Chapters 17 & 18 Physical Database Design Methodology.
Digital Media Technology Week 9. The import of books from Britain into the Netherlands between 1850 and 1879 increased from f 21,085 to f 161,925, or.
Digital Media Technology Week 11. Stylesheet languages vs. Querying languages.
1 Translating E/R Diagrams into Relational Schemas.
Database. Basic Definitions Database: A collection of related data. Database Management System (DBMS): A software package/ system to facilitate the creation.
Learningcomputer.com SQL Server 2008 – Entity Relationships in a Database.
Data Modelling – ERD Entity Relationship Diagram’s Entity Relationship Diagrams and how to create them. 1.
Concepts and Terminology Introduction to Database.
Relational Database Management Systems. A set of programs to manage one or more databases Provides means for: Accessing the data Inserting, updating and.
1 The Relational Model Instructor: Mohamed Eltabakh
SQL data definition using Oracle1 SQL Data Definition using Oracle.
PLUG IT IN 3 Fundamentals of Relational Database Operations.
Deanery of Business & Computer Sciences SQL Structured Query Language Implementation Lecture – 8 Database Technology Level I.
SQL Structured Query Language Programming Course.
1 The Relational Model. 2 Why Study the Relational Model? v Most widely used model. – Vendors: IBM, Informix, Microsoft, Oracle, Sybase, etc. v “Legacy.
1.1 CAS CS 460/660 Relational Model. 1.2 Review E/R Model: Entities, relationships, attributes Cardinalities: 1:1, 1:n, m:1, m:n Keys: superkeys, candidate.
SQL Basics. 5/27/2016Chapter 32 of 19 Naming SQL commands are NOT case sensitive SQL commands are NOT case sensitive But user identifier names ARE case.
Relational Database. Database Management System (DBMS)
Slide Chapter 5 The Relational Data Model and Relational Database Constraints.
Database Fundamentals Lecture 4 Useful website for MySQL download language.com/workshops/Default.asp ?workshop=21.
IST 220 Introduction to Databases Course Wrap-up.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
1 The Information School of the University of Washington Dec 1fit advdatabases © 2006 University of Washington Advanced Database Concepts INFO/CSE.
3 & 4 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Keys Consists of one or more attributes that determine other.
An Entity Relationship (ER) Diagram is a graphic that shows the interrelationship between entities in a database.
CS3431-B111 The Relational Model Instructor: Mohamed Eltabakh
ENTITY RELATIONSHIP DIAGRAM ENTITY RELATIONSHIP DIAGRAM IS A SPECIALIZED GRAPHIC THAT ILLUSTRATES THE INTERRELATIONSHIPS BETWEEN ENTITIES IN A DATABASE.
Relational Theory and Design
Chapter 9 Logical Database Design : Mapping ER Model To Tables.
SQL Structured Query Language. Aims  To introduce the implementation of a Physical design using SQL.  To introduce SQL Data Definition Language (DDL).
CS263 Lecture 5: Logical Database Design Can express the structure of a relation by a Tuple, a shorthand notation Name of the relation is followed (in.
1 CS 430 Database Theory Winter 2005 Lecture 4: Relational Model.
1 ER Modeling BUAD/American University Mapping ER modeling to Relationships.
CS34311 The Relational Model. cs34312 Why Relational Model? Currently the most widely used Vendors: Oracle, Microsoft, IBM Older models still used IBM’s.
Digital Media Technology Week 10: Introduction to Relational Databases Peter Verhaar.
Lecture 03 Constraints. Example Schema CONSTRAINTS.
Information System Design “Student Registration System Example”
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
CENG 351 File Structures and Data Management1 Relational Model Chapter 3.
IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign.
Chapter 3 The Relational Data Model and Relational Database Constraints Copyright © 2004 Pearson Education, Inc.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 The Relational Data Model and Relational Database Constraints تنبيه.
SQL: Schema Definition and Constraints Chapter 6 week 6
Digital Media Technology
Instructor: Mohamed Eltabakh
The Relational Model Relational Data Model
CS4222 Principles of Database System
Instructor: Mohamed Eltabakh
CS 405G: Introduction to Database Systems
Presentation transcript:

Digital Media Technology Week 10

foreign key primary key TREASURE_IDTITLECREATORLIBRARYSUBJECTYEAR 1Sidereus Nuncius77SCI1610 2Requiem KV 62621MUS1791 3Rabbit Hunt, in the lower left Brueghel ART1560 4De antiquitate Britanicae Ecclesiae84ART1572 5Vedute di Roma con scene di costume66HIS1810 6Corrected page proofs of 'Les Fleurs du mal'12HIS1857 7Vinegar Hill, charge of the 5th Dragoon Guards45HIS1880 8Poster of "Internationale Ausstellung für Buchgewerbe und Graphik"59ART1914 9Fontana dei Fiumi a Piazza Navona96ART1734 CREATOR_IDNAME_LASTNAME_FIRSTYEAR_OF_BIRTHYEAR_OF_DEATHCOUNTRY_BORN 1BaudelaireCharles FR 2MozartWolfgang Amadeus AT 3Bruegel The ElderPieter BE 4SadlerWilliam IE 5TiemannWalter DE 6MacchiavelliGiacomo IT 7GalileiGalileo IT 8ParkerMatthew GB 9WittelCaspar van NL 10MolyneuxDaniel IE

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

FK = PK

Semantic Web

Entity Relationship Diagrams

PERSON P_ID NAME PHONE DATE_OF_BIRTH Attributes PK is underlined

BOOK PERSON COMPANY

□ Cardinality: how many instances of the entity can be associated with one instance of the related entity? BOOKCOMPANY

STUDENTCOURSE ENROLMENT

PERSON COMPANY many EMPLOYMENT P_IDC_ID P_ID C_ID E_ID many one many one

Making an ERD □ Identify entities □ Consider the cardinality of the relations between these entities □ One-to-one relations must be removed – these entitites can be combined in a single entity □ Change many-to-many relations into one- to-many relations by making use of linking tables □ Add attributes

codename ukGreat Britain frFrance neThe Netherlands beBelgium A look-up table (based on ISO )

NameCountry_born Shelley, Percy ByssheGreat Britain Swinburne, Algernon Charles Britain Cowper, WilliamUnited Kingdom Coleridge, Samuel TaylorU.K.

NameCountry_born Shelley, Percy Byssheuk Swinburne, Algernon Charles uk Cowper, Williamuk Coleridge, Samuel Tayloruk

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.

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

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

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

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 NAME_LAST, NAME_FIRST, (YEAR_OF_DEATH - YEAR_OF_BIRTH) AS AGE FROM CREATOR ; NAME_LASTNAME_FIRSTAGE BaudelaireCharles46 MozartWolfgang Amadeus 35 Bruegel The ElderPieter44 SadlerWilliam57 TiemannWalter75 MacchiavelliGiacomo55 GalileiGalileo78 ParkerMatthew71 WittelCaspar van81 MolyneuxDaniel64

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

SELECT DISTINCT SUBJECT FROM TREASURE ; SUBJECT ART HIS MUS SCI