LIS512 lecture 1 the entity-relationship model Thomas Krichel 2010-09-22.

Slides:



Advertisements
Similar presentations
The Relational Model and Normalization (1)
Advertisements

LIS651 lecture 2 databases, mySQL and PHP mySQL functions Thomas Krichel
CSCI3170 Introduction to Database Systems
LIS512 lecture 2 relational databases Thomas Krichel
UNIVERSITY OF PALESTINE business computer application College of Business Instructor: Mr. Ahmed Abumosameh.
ENTITY RELATIONSHIP MODELLING
Copyright © 2015 Pearson Education, Inc. Database Design Chapters 17 and
8 June Single table database in normal form Fields and records Normal form 1.Header in the first line 2.Same content for every field 3.Each record.
ISP 121 Access Normalization and Relationships. Normalization Say we’re operating a pet day-care and we need to keep information on our pets/customers.
LIS 557 Database Design and Management William Voon Michael Cole Spring '04.
Week 2 Normalization and Queries
Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage.
Database Design Concepts INFO1408 Term 2 week 1 Data validation and Referential integrity.
Attribute databases. GIS Definition Diagram Output Query Results.
Database Design Concepts Info1408
Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage.
Relational Databases What is a relational database? What would we use one for? What do they look like? How can we describe them? How can you create one?
Entity/Relationship Modelling
Page 1 ISMT E-120 Introduction to Microsoft Access & Relational Databases The Influence of Software and Hardware Technologies on Business Productivity.
LIS512 lecture 12 conclusions Thomas Krichel
Microsoft ® Office Access ® 2007 Training Build a database III: Build relationships for a new Access database ICT Staff Development presents:
Page 1 ISMT E-120 Desktop Applications for Managers Introduction to Microsoft Access.
Entity Relationship Modeling
2.3 Organising Data for Effective Retrieval
LIS510 lecture 12 Thomas Krichel today Leftovers from last time. I discuss some elements of Bill Arms’ book on Digital Libraries. –It’s introductory.
Validated.php
Relational Database Concepts. Let’s start with a simple example of a database application Assume that you want to keep track of your clients’ names, addresses,
LIS651 lecture 5 multiple arrays and databases Thomas Krichel
Practice of ER modeling
CHAPTER 8: MANAGING DATA RESOURCES. File Organization Terms Field: group of characters that represent something Record: group of related fields File:
MIS 301 Information Systems in Organizations Dave Salisbury ( )
MIS 301 Information Systems in Organizations Dave Salisbury ( )
Lis512 lecture 4 XML: documents and records. up until now Relational databases can store information that is internal to an organization. But a lot of.
Database Design Using Entity-Relationship Models Transformation of Entity-Relationship Models into Relational Database Design Trees, Networks, and Bills.
Data Modelling. ICT5 Introduction Historical development with most organisations Small-scale origins Individual computers bought for particular applications.
Lecturer: Gareth Jones. How does a relational database organise data? What are the principles of a database management system? What are the principal.
1 n 1 n 1 1 n n Schema for part of a business application relational database.
1 Mathematical Relation A mathematical relation is a subset of a Cartesian Product. A1  A2  A3  …  An = {(x1, x2, x3, …, xn): xi  Ai} R  A1  A2.
Introduction to Databases Trisha Cummings. What is a database? A database is a tool for collecting and organizing information. Databases can store information.
Introduction. » How the course works ˃Homework ˃Project ˃Exams ˃Grades » prerequisite ˃CSCI 6441: Mandatory prerequisite ˃Take the prereq or get permission.
M1G Introduction to Database Development 2. Creating a Database.
CS370 Spring 2007 CS 370 Database Systems Lecture 4 Introduction to Database Design.
Databases. What is a database?  A database is used to store data. The word DATA is actually Latin for FACTS. A database is, therefore, a place, or thing.
Database Beginnings. Scenario so far In our scenario we have people registering for training sessions. –The data about the training sessions was placed.
Entity-Relationship (ER) Modelling ER modelling - Identify entities - Identify relationships - Construct ER diagram - Collect attributes for entities &
DataBase Management System What is DBMS Purpose of DBMS Data Abstraction Data Definition Language Data Manipulation Language Data Models Data Keys Relationships.
Database Management Systems MIT Lesson 02 – Database Design (Entity Relationship Diagram) By S. Sabraz Nawaz.
An Entity Relationship (ER) Diagram is a graphic that shows the interrelationship between entities in a database.
CPSC 603 Database Systems Lecturer: Laurie Webster II, M.S.S.E., M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 2 Introduction to a First Course in Database Systems.
Build a database III: Build relationships for a new Access database Overview: You can relate This course teaches you how to build relationships between.
1 Database Course. 2 General Information TAs: –Sara Cohen –Jonathan Mamou Course Moderated Newsgroup: local.course.db.ta Students.
Spreadsheet vs Database What’s the difference and who cares?
Chapter 56 Relational Database Design Compiled by Eddie Moorcroft.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
3/6: Data Management, pt. 2 Refresh your memory Relational Data Model
CIS 250 Advanced Computer Applications Database Management Systems.
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 1: Introduction to IS2803 Rob Gleasure
1 Geog 357: Data models and DBMS. Geographic Decision Making.
Sample Table Standard Notation Entity name in uppercase
Introduction to Databases Angela Clark University of South Alabama.
6.1 © 2007 by Prentice Hall Chapter 6 (Laudon & Laudon) Foundations of Business Intelligence: Databases and Information Management.
IST 220 – Intro to DB Lecture 4 Database Design thru ER Modeling.
1 Information System Analysis Topic-3. 2 Entity Relationship Diagram \ Definition An entity-relationship (ER) diagram is a specialized graphic that illustrates.
CS 3630 Database Design and Implementation. 2 Mathematical Relation A mathematical relation is a subset of a Cartesian Product. A1  A2  A3  …  An.
Data Modeling AND ER MODELS.
Modeling: Entity-Relationship Diagrams
1 The Relational Data Model David J. Stucki. Relational Model Concepts 2 Fundamental concept: the relation  The Relational Model represents an entire.
Rationale Databases are an integral part of an organization. Aspiring Database Developers should be able to efficiently design and implement databases.
Year 12 > 13 Applied GCE ICT Unit 7 Using Database Software.
Databases and Information Management
Presentation transcript:

LIS512 lecture 1 the entity-relationship model Thomas Krichel

today entities entity sets relations identifiers building a sophisticated description…

entity An entity is something that is – we are interested in to describe – we can distinctly identify What you look at as an entity depends on what you want to be doing. For example, if you look at persons, you may restrict this to living people. Or you may included only people we think have actually lived. FRBR (next week) talks about entities in libraries.

attributes to an entity Each entity is described by a bunch of attributes. Each attributes has a name. Each attribute takes a value. We can say that we have an attribute/value pair. Example “birthday: ”.

another attribute example Let us say we have an entity called person. Each person has – birthday – sex – height – weight We can use this data, together with the present time, to determine if the person is overweight.

another example a person – name: Thomas – – age: 48 some other person – name: Jose – – age: 37

tables We often write information about entities in a table. Each row in the table describes an entity. The different columns contain values of attributes of the entity. Remember, this is just a way to write things.

example name | address | age Thomas | | 48 Jose | | 37 Feng | | 42

records in a table In fact, in the table we have a sequence of records. Each record describes an entity. The fact that there is a sequence is imposed by the fact that we list the records about each entity in a table.

set “set” is the most ambiguous word in the English language. In the mathematical set, it a set is a bunch of elements (or members) without any order between them. Most of the time, entities out there come in sets.

entity sets A group of entities is called an entity set. Each member in the set takes the same attributes. But the value that the attributes take may be different for different members in the set. Usually, entities in an entity set are commonly understood, such as users, books and libraries. But if you think about your problem a bit more, you realize that the issue is not that simple.

entity and entity set example A book is an entity. It has an attribute called “author”. The value is “Karl Marx”. It has an attribute called “title”. The value is “Das Kapital”. A book is something that has a title, an author etc. All books form a set.

relationships The entity relationship model comes to live when we look relationship. We have a relationship between entities sets when elements of one set may be related to elements in another entity set. For example, consider books and people.

symmetric relationships Sometimes relationships are symmetric. When one entity is related to another, the other has exactly the same relationship with the one. “being married to” is a symmetric relationship. “being husband of” is mostly not.

relationship types Usually, relationships are grouped by three types. There are one-to-one relationships. There are one-to-many relationships. There are many-to-many relationships.

one-to-one relationship Look at two entity set. In a one-to-one relationship, each entity in one set is connected to one in the other set. In a library setting, I did not find an example. Look at cars on the road. – each car has one driver – there is one driver in each car one-to-one relationships are uncommon.

many-to-one relationship Consider two entity sets, people and books. Each person has a favorite book. But a book can be the favorite book of more than one person. “is favorite-book of” is a many-to-one relationship between books and people. “has favorite book” is a one-to-many relationship between people and books.

many-to-many relationships Look at two entity sets, libraries and persons. The relationship “patronizes” is a many-to- many relationship between persons and libraries. The relationship “is patronized by” is a many- to-many relationship between libraries and persons.

relationship in the library world Imagine entity sets “libraries”, “books”, “users”. We can draw three relationships. – Users read books. – Users patronize libraries. – Libraries store books.

examples Brentwood Public Library has a copy of Moby Dick. Purchase Public Library has a copy of Moby Dick. Thomas reads Moby Dick. Thomas patronizes Brentwood Public Library.

tables Remember that in a database records are represented as lines in a table. The first line of the table lists the field names. Here is a sample table with two records |name | birthday | | Thomas Krichel| | | Karl Marx | |

identity Consider an extract from the same table |name | birthday | | Thomas Krichel | | Is the record a duplicate? Without further information, we can not tell. Certainly, no computer can tell.

identity and key Identity can only be conferred by a human. Often that is some sort of information worker. A information processing system can not find identity. But there are there are tools that are used to encode the identity in an information system.

key To be able to find what records describe the same entities, databases use a construct called a key. An attribute is a key if the value taken by the attribute must be different for each entity. Unusually, there is only one key attribute. In that case the value taken by the key attribute is called the identifier of the entity.

examples Here is a correct example |key|name | birthday | |2 | Thomas Krichel | | | 1 | Thomas Krichel | | Here is an incorrect example |key|name | birthday | |1 | Thomas Krichel | |

identity Identity is simple when it comes to person. But when it comes to other entities we are interested in the world of libraries. Identifiers and the handling of them is one of the most difficult issues of digital librarianship. If I have two copies of the same book are they the same book or are they different books? FRBR gives us some answer next week…

why bother with identity Once we have identified an entity in an entity set, we can create a relationship with an entity in another set, or in the same set. Once we have done this, we can – encode a much richer description – maintain it at relatively low cost. This can be illustrated with the introduction of a relational database.

relations Not all database system are relational. The most widely used ones are relational. That means you can build relationships between tables and enforce them. I am coming to this from an old example.

relational databases A relational database is a set of tables. There may be relations between the tables. Each table has a number of records. Each record has a number of fields. They give us values that attributes take for the entity described. Let us look at this bottom up.

example: Movie database ID| title | director| date M1| Gone with the wind | F. Ford Coppola | 1963 M2| Room with a view| Coppola, F Ford | 1985 M3| High Noon| Woody Allan| 1974 M4 | Star Wars| Steve Spielberg | 1993 M5| Alien| Allen, Woody | 1987 M6| Blowing in the Wind| Spielberg, Steven| 1962 Single table No relations between tables, of course

problem with this database All data wrong, but this is just for illustration. Name covered inconsistently. There is no way to find films by Woody Allan without having to go through all spelling variations. Mistakes are difficult to correct. We have to wade through all records, a masochist’s pleasure.

Better movie database ID| title |director| year M1| Gone with the wind | D1| 1963 M2| Room with a view| D1| 1985 M3| High Noon| D2| 1974 M4 | Star Wars| D3| 1993 M5| Alien| D2 | 1987 M6| Blowing in the Wind| D3| 1962 ID |director name| birth year D1| Ford Coppola, Francis| 1942 D2| Allan, Woody| 1957 D3| Spielberg, Steven| 1942

Relational database We have a one to many relationship between directors and film – Each film has one director – Each director has produced many films Here it becomes possible for the computer – To know which films have been directed by Woody Allen – To find which films have been directed by a director born in 1942

enforcing relationships Relational database software has ways to enforce relationships. So when you change the record of M5 to say it was directed by director D9, it will complain that no such director has been defined.

Many-to-many relationships Each film has one director, but many actors star in it. Relationship between actors and films is a many to many relationship. Here are a few actors ID| sex| actor name | birth year A1| f| Brigitte Bardot | 1972 A2| m| George Clooney| 1927 A3| f| Marilyn Monroe| 1934

Actor/Movie table actor id| movie id A1| M4 A2| M3 A3| M2 A1| M5 A1| M3 A2| M6 A3| M4 … as many lines as required

relational databases Relational databases are powerful within organizations that have a relatively centralized command and control structure, i.e. within a company and / or a government department. The relational database model has problems when we are working in a coordinated fashion between several providers of information. Imagine the web working an a relational database model!

Thank you for your attention! Please switch off machines b4 leaving!