Day 2 - Basic Database Backbone

Slides:



Advertisements
Similar presentations
Day 3 - Basics of MySQL What is MySQL What is MySQL How to make basic tables How to make basic tables Simple MySQL commands. Simple MySQL commands.
Advertisements

Slides adapted from A. Silberschatz et al. Database System Concepts, 5th Ed. Database Management Systems I Alex Coman, Winter 2006 Entity-Relationship.
Databases Revision.
--The Entity Relationship Model(1)--1 The Entity Relationship Model.
Your name here The lecture notes are based on using Microsoft Access interactively as part of the lecture.
The Entity-Relationship Data Model
Example BigHit Video Inc. wants to create an information system for online sales of movies in both DVD and videotape format. People will be allowed to.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Reduction of an E-R Schema to Tables A database which conforms to an E-R diagram can be represented.
An Example: Video Rental System Video Rental Database Videos RentalsCustomers.
MySql In Action Step by step method to create your own database.
Database. Basic Definitions Database: A collection of related data. Database Management System (DBMS): A software package/ system to facilitate the creation.
Copyright © 2003 Addison-Wesley Jesper Rosholm Tørresø.
CS411 Database Systems Kazuhiro Minami 02: The Entity-Relationship Model.
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
Information Systems: Databases Define the role of general information systems Describe the elements of a database management system (DBMS) Describe the.
Conceptual Data Modeling, Entity Relationship Diagrams
CSC 240 (Blum)1 Introduction to Database. CSC 240 (Blum)2 Data versus Information When people distinguish between data and information, –Data is simply.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T5: Designing Database Applications Business Driven Technology.
Chapter 7 Database Design and The E–R Model. 2 Goals n Facilitate DB design and represent the overall logical structure of the DB. n Definition Entities.
Entity-Relationship (ER) Modelling ER modelling - Identify entities - Identify relationships - Construct ER diagram - Collect attributes for entities &
EXAMPLE. Subclasses and Superclasses Entity type may have sub-grouping that need to be represented explicitly. –Example: Employee may grouped into.
Copyright © 2003 Addison-Wesley Sree Nilakanta. Copyright © 2003 Addison-Wesley Developing Relational Models What is the relational model and what is.
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.
 Entity-relationship models (ERM) Entity-relationship models (ERM)  Simple E-R Diagram Simple E-R Diagram  Weak Entity Weak Entity  Strong Entity.
 An entity-relationship diagram (ERD) is a specialized graphic that illustrates the interrelationships between entities in a database.
ICOM 5016 – Introduction to Database Systems Lecture 9 Dr. Manuel Rodriguez Department of Electrical and Computer Engineering University of Puerto Rico,
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.
UNIT_2 1 DATABASE MANAGEMENT SYSTEM[DBMS] [Unit: 2] Prepared By Lavlesh Pandit SPCE MCA, Visnagar.
Databases Illuminated Chapter 3 The Entity Relationship Model.
Copyright © Curt Hill Entities and Relationships The basics and what they have to do with database.
Database Design – Lecture 7
Done By : Gillian Swaby. Objectives: 1. What is an Entity-Relationship Diagram? 2.What are the symbols used in ERD? Explain each. 3. What is a one- to-
Understand Primary, Foreign, and Composite Keys Database Administration Fundamentals LESSON 4.2.
* Database is a group of related objects * Objects can be Tables, Forms, Queries or Reports * All data reside in Tables * A Row in a Table is a record.
Moya messam.  Definition: An entity-relationship (ER) diagram is a specialized graphic that illustrates the interrelationships between entities in a.
Database -Entity-Relationship Model 2012/03/05.
High-level Database Models Prof. Yin-Fu Huang CSIE, NYUST Chapter 4.
Order Database – ER Diagram
Assignements.
Information System & Database Design
Lecture 5: Conceptual Database Design
Entity Relationship Diagram
Modeling Constraints Extracting constraints is what modeling is all about. But how do we express them? Examples: Keys: social security number uniquely.
COP Introduction to Database Structures
Order Database – ER Diagram
© The McGraw-Hill Companies, All Rights Reserved APPENDIX C DESIGNING DATABASES APPENDIX C DESIGNING DATABASES.
Entity-Relationship Model
Chapter 7 Entity-Relationship Model
Conceptual Database Design
Chapter 12 Information Systems.
Entity-Relationship Model
Outline of the ER Model By S.Saha
Order Database – ER Diagram
Order Database – ER Diagram
CSCI-100 Introduction to Computing
Converting ER-Diagrams to Table Definitions
Order Database – ER Diagram
Entity Relationship Diagrams ERDs
The Entity-Relationship Model
Database Modeling using Entity Relationship Model (E-R Model)
Chapter 1: The Database Environment
Lecture 9: The E/R Model II
Order Database – ER Diagram
Weak Entity Sets An entity set that does not have a primary key is referred to as a weak entity set. The existence of a weak entity set depends on the.
Projecting output in MySql
DBMS ER-Relational Mapping
Database Dr. Roueida Mohammed.
SQL NOT NULL Constraint
SQL AUTO INCREMENT Field
Presentation transcript:

Day 2 - Basic Database Backbone How to Model a Database Using E/R Diagrams How an E/R Diagram Translates to a Real Database

How do I model a database? Why do I need to model a system? Gives a team a basis to design a system on. Design Issues Entity Designs and Relationships Domain/Range Constraints of the System Good Entity Relationship Design Entity/Relationship Model Used to model the relationships between different objects in the database. Parallel structure to an object-oriented approach of thinking. CSE 498 Day 2 - Basic Database Backbone

Day 2 - Basic Database Backbone E/R Diagram Parts Entities Attributes & Keys Relationships Entity Major objects in a database. Strong Entity: Records are uniquely identified by its attribute(s). Weak Entity: Records are uniquely identified by its relationship(s). Weak entities are shown with double borders around the entity block. Customers Customers CSE 498 Day 2 - Basic Database Backbone

Day 2 - Basic Database Backbone Attributes & Keys Attribute A piece of information that defines a part of the entity. Drawn as ovals that link off an entity. Example: LastName Customers FirstName CustID Age Address Key Attribute(s) that uniquely identify an entity. Drawn by underlining the attribute name in the E/R diagram. Example shown above. CSE 498 Day 2 - Basic Database Backbone

Day 2 - Basic Database Backbone Relationships Relationship Diagram definition of how entities relate to each other. Drawn as a line between two objects with a diamond defining the relationship. An arrow defines the direction of the relationship. Weak relationships are drawn as double lines. Three types of relationships… 1 to 1 (One To One) N to 1 (Many To One) N to M (Many To Many) Rented By Rented By Rented By CSE 498 Day 2 - Basic Database Backbone

Example Simple Movie DB Customers CustID LastName FirstName Address CatID CatName Age Category In Category MovieID Rented By Title Rentals CopyNum Movie Rented CheckOut Duration Cost CheckOutDate CSE 498 Day 2 - Basic Database Backbone

How does an E/R translate to a DB? All entities become tables. All attributes become columns in the tables. Relationships are tricky… One-To-One and Many-To-One relationships are handled by adding in the keys from the higher level table to the lower level table. Many-To-Many relationships are handled by creating a table that has the keys from both entities to define the different relations. CSE 498 Day 2 - Basic Database Backbone

Movie E/R Diagram Translated to a DB Customer CustID (integer) -- Key LastName (VarChar) FirstName (VarChar) Address (VarChar) Age (int) CheckOut CustID (integer) -- Key MovieID (integer) -- Key CheckOutDate (Date/Time) Duration (integer) Cost (Money) Category CatID (integer) -- Key CatName (VarChar) Rentals MovieID (integer) -- Key Title (VarChar) CopyNum (integer) CatID (integer) CSE 498 Day 2 - Basic Database Backbone