Switch off your Mobiles Phones or Change Profile to Silent Mode

Slides:



Advertisements
Similar presentations
Relational Database and Data Modeling
Advertisements

The Relational Model and Relational Algebra Nothing is so practical as a good theory Kurt Lewin, 1945.
Relational Database. Relational database: a set of relations Relation: made up of 2 parts: − Schema : specifies the name of relations, plus name and type.
Database Systems: Design, Implementation, and Management Tenth Edition
Database Systems: Design, Implementation, and Management Tenth Edition
Database Systems: Design, Implementation, and Management Tenth Edition
1 © 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the.
Chapter 2 Data Models.
Database Systems: Design, Implementation, and Management Ninth Edition
Chapter 2 Data Models Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
ETEC 100 Information Technology
Chapter 2 Data Models Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
1 Basic DB Terms Data: Meaningful facts, text, graphics, images, sound, video segments –A collection of individual responses from a marketing research.
Chapter 2 Data Models Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Data Models.
Introduction to Databases Transparencies
The Relational Database Model. 2 Objectives How relational database model takes a logical view of data Understand how the relational model’s basic components.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 2 Data Models Database Systems, 8th Edition 1.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
The Relational Model Codd (1970): based on set theory Relational model: represents the database as a collection of relations (a table of values --> file)
Mgt 20600: IT Management & Applications Databases Tuesday April 4, 2006.
Academic Year 2014 Spring.
Academic Year 2014 Spring.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Entity-Relationship Design
LECTURE 2 DATABASE SYSTEM CONCEPTS AND ARCHITECTURE.
2 1 Chapter 2 Data Model Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Lecture 2 The Relational Model. Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical relations.
Module Title? DBMS E-R Model to Relational Model.
Chapter 4 The Relational Model.
Chapter 3 The Relational Model Transparencies Last Updated: Pebruari 2011 By M. Arief
2 1 Chapter 2 Data Models Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Database Design - Lecture 2
Database Systems: Design, Implementation, and Management Ninth Edition
Concepts and Terminology Introduction to Database.
Fundamentals of Relational Database Yong Choi School of Business CSUB, Bakersfield.
Switch off your Mobiles Phones or Change Profile to Silent Mode.
Switch off your Mobiles Phones or Change Profile to Silent Mode.
Chapter 2 Data Models Database Systems: Design, Implementation, and Management, Rob and Coronel Adapted for INFS-3200.
Chapter # 2 Data Models BIS Database Systems A.Thanop Somprasong
Data Integrity An empty database is a correct database.
Lecture2: Database Environment Prepared by L. Nouf Almujally & Aisha AlArfaj 1 Ref. Chapter2 College of Computer and Information Sciences - Information.
1 Chapter 2 Data Model Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
1 Relational Databases and SQL. Learning Objectives Understand techniques to model complex accounting phenomena in an E-R diagram Develop E-R diagrams.
Lecture2: Database Environment Prepared by L. Nouf Almujally 1 Ref. Chapter2 Lecture2.
Switch off your Mobiles Phones or Change Profile to Silent Mode.
Relational Database. Database Management System (DBMS)
Lecture # 3 & 4 Chapter # 2 Database System Concepts and Architecture Muhammad Emran Database Systems 1.
Slide Chapter 5 The Relational Data Model and Relational Database Constraints.
DataBase Management System What is DBMS Purpose of DBMS Data Abstraction Data Definition Language Data Manipulation Language Data Models Data Keys Relationships.
Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network.
Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
Switch off your Mobiles Phones or Change Profile to Silent Mode.
Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design.
The relational model A data model (in general) : Integrated collection of concepts for describing data (data requirements). Relational model was introduced.
CHAPTER 2 : RELATIONAL DATA MODEL Prepared by : nbs.
2 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Data Models Why data models are important About the basic data-modeling.
LECTURE TWO Introduction to Databases: Data models Relational database concepts Introduction to DDL & DML.
Data Models. 2 The Importance of Data Models Data models –Relatively simple representations, usually graphical, of complex real-world data structures.
1 © 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the.
Learn about: Data modeling and why data models are important Basic data-modeling building blocks What business rules are and how they influence database.
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.
Database Systems: Design, Implementation, and Management Tenth Edition
Tables and Their Characteristics
Lecture 2 The Relational Model
Chapter 4 Relational Databases
Chapter 4 Entity Relationship (ER) Modeling
Data Model.
Chapter 2 Data Models Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
INSTRUCTOR: MRS T.G. ZHOU
Presentation transcript:

Switch off your Mobiles Phones or Change Profile to Silent Mode * 07/16/96 Switch off your Mobiles Phones or Change Profile to Silent Mode *

Relational Model

Topics Database Models Keys Relational Integrity Business Rule Hierarchical Model Network Model Relational Model Entity Relationship Model Object Oriented Model Keys Primary Keys Foreign Keys Relational Integrity Business Rule

Database Models A way of thinking about data in a database is called a logical database model (or implementation model). Types of Logical Model Hierarchical Model Network Model Relational Model Entity Relationship Model Object Oriented Model

Database Models

Hierarchical Model Developed in the 1960s To manage large amounts of data for complex manufacturing projects such as Apollo rocket that landed on moon (1969) Its basic logical structure is represented by an upside-down tree. The hierarchical structure contains levels, or segments. A segment is equivalent of a file system’s record type.

Hierarchical Model Within the hierarchy, a higher layer is perceived as the parent of the segment directly beneath it, which is called the child. The hierarchical model depicts a set of one-to-many (1:M) relationships between a parent and its children segments. Each parent can have many children, but each child has only one parent.

Hierarchical Model

Hierarchical Model

Hierarchical Model Hierarchical views can differ between user group

Network Model Network Model was created to represent complex data relationships more effectively than hierarchical model, to improve database performance, and to impose a database standard. User perceives the network database as a collection of records in 1:M relationships. Unlike the Hierarchical Model, Network Model allows a record to have more than one parent.

Network Model Some important concepts are: Schema, which is the conceptual organization of entire database as viewed by database administrator. Subschema, which defines portion of database “seen” by application programs that actually produce desired information from data contained within the database.

Network Model Data Manipulation Language (DML), which defines environment in which data can be managed and to work with data in database. A schema Data Definition Language (DDL), which enables the database administrator to define the schema components.

Network Model

Network Model

Relational Model Relational Model was introduced in 1970 by E. F. Codd (of IBM) in his landmark paper “A Relational Model of Data for Large Shared Databanks” Data model that represents data in form of tables or relation.

Relational Model Relational database model consists of following three components: Data structure: Data are organized in form of tables or relations. Data manipulation: Powerful operations such as SQL languages or Query-by-example, are used to manipulate data stored in database. Data integrity: Business rules are specified to maintain integrity of data when they are manipulated.

Relational Model Physical Properties A relation consists of 1 or more columns and 0 or more rows. A row is called a tuple. Each relation is given a unique name. Each column has a name unique within the relation. Each row contains an instance of the data associated with the relation. A relation with no rows is empty (contains no data), but still exists.

Relational Model Logical Properties Columns are unordered, left to right. This property is designed to preserve the independence of each column. Rows are unordered, top to bottom. This is designed to preserve the independence of each row. No row may be duplicated in a given relation. Uniqueness in a relation is guaranteed by the designation of a Primary Key for each relation.

Relational Model A Candidate Key is an attribute that uniquely identifies a row in that relation. A Primary Key is a candidate key that has been selected to be unique identifier for each row. Primary key values cannot be null, since they would then not identify a row. Columns can be interchanged without changing the meaning or use of relation. It makes no difference as whether to insert a new row in front or at end of table.

Relational Model

Entity Relationship Model Peter Chen first introduced the ER data model in 1976 Graphical representation of entities and their relationships in database structure. ER Models are normally represented in an Entity Relationship Diagram (ERD) to model database components. It complemented Relational Data model. Relational Data Model and ERM combined to provide foundation for structured database design.

Entity Relationship Model

Object Oriented Model Object-Oriented Data Model (OODM), both data and their relationships are contained in a single structure known as an object OODM reflects a very different way to define and use entities. Object is described by its factual content. Object includes information about relationships between the facts within the object, as well as information about its relationships with other objects.

Object Oriented Model Facts within object are given greater meaning. OODM is said to be a Semantic Data Model because semantic indicates meaning. OODM is the basis for Object-Oriented Database Management System (OODBMS).

Object Oriented Model

Database Models Earlier Models Relational Model Difficult to change structure Unplanned queries difficult to support Have to ‘navigate’ through the database Data stored in linked sets physically Programmer must be aware of structure Relational Model Easy to understand concepts Logical/Physical aspects clearly separated No (visible) physical pointers used Easy to set-up and change Set-oriented (not record-oriented)

Keys Choice of Primary Key is an important design issue Eg. An attribute list for a PERSON entity Surname Firstname DOB Gender Passport number Driving Licence number Election number Citizenship number

Primary Keys PRIMARY KEY for a table T1 is a column PK of T1 such that, at any given time, no two rows of T1 have same value for PK. An entity’s primary key is one or more of its attributes which together uniquely identify an occurrence of the entity.

Primary Keys STUDENT (Student-ID, Student-Name, Address) STUDENT Tom 12a Clover Street S1002 Alex Flat B High Street S1003 Brown 218 Tulip Road

Primary Keys FEATURES Can never take on a particular set of values in more than one occurrence of the entity. No primary key attribute can have a null value. Every attribute in the primary key is mandatory.

Foreign Key FOREIGN KEY is a column FK of some table T2 such that, at any given time, every (non NULL) value of FK in T2 is required to be equal to the value of the PRIMARY KEY PK in some row of some base table T1. Foreign keys are the ‘glue’ that holds the database together and rrepresents certain relationships between tuples. CUSTOMER ORDER-LINE ORDER places comprised of

Foreign Key LECTURER-LOCATION(Department*, Location LECTURER(Lecture-Id, Lecture-Name, Department, Salary) Lecturer-id Lecturer-name Department Salary W01 Emma Greg Computing 35,000 S01 Wendy Holder 42,000 D01 Amy King Accounting 27,000 J02 Bob Jones 29,000 N01 Bob Whales 36,500 J01 Jack Nelson History 41,500 Department Location Computing Moorgate Accounting Staples History Lewiston LECTURER-LOCATION(Department*, Location

Foreign Key CUSTOMER ORDER ORDER-LINE Cust-id Cust-name Credit-Status Business-type 1001 Smith Excellent Retail 1910 Jones Good Wholesale 2450 Brown Fair Multiple ORDER Order-no Date Cust-id* 100 01/02/06 1910 101 04/06/06 1001 102 15/06/06 ORDER-LINE Order-no* Item-no Item-name Quality 100 11 Spade 15 92 Shovel 10 101 12 102 50

Foreign Key Feature: Feature: There is no requirement that a Foreign Key be a component of the Primary Key. DEPARTMENT Dept-code …… EMPLOYEE Empl-no …… Dept-code* Feature: A foreign key will be composite if the primary key it matches is composite. VEHICLE Manufacturer-name Model-name …… VEHICLE-IN-STOCK Vehicle-no Manufacturer-name* Model-name* …

Foreign Key Feature: Many-To-Many relationships are always decomposed with Foreign keys making up a composite Primary Key. SUPPLIER Supp-no …… PART Part-no …… SUPPLY Supp-no* Part-no* ……

Foreign Key Feature: Note that T1 and T2 do not have to be distinct EMPLOYEE Empl-no …… Mgr-no*

Foreign Key Feature: There is no requirement that a given Primary Key value must appear in a corresponding Foreign Key. CUSTOMER Cust-id Cust-name Credit-Status Business-type 1001 Smith Excellent Retail 1910 Jones Good Wholesale 2450 Brown Fair Multiple ORDER Order-no Date Cust-id* 100 01/02/06 1910 101 04/06/06 1001 102 15/06/06

Domains The range of values that the entries in a particular column can take is known as the domain. Example: The domain of gender has only two values (e.g. Male/Female). The domain of start date could be any valid date greater than 01/01/2006. The domain of salary may be restricted to the range 20,000 - 80,000.

Relational Integrity Integrity in a database is concerned with the database having correct and consistent data. Domain Integrity Rule Every attribute is required to satisfy the constraint that its values are drawn from the relevant domain. Entity Integrity Rule No component of the primary key of a base relation is allowed to accept nulls.

Relational Integrity Referential Integrity Rule The database must not contain any unmatched foreign key values. User-Defined or Application-Specific Integrity

Referential Integrity If a foreign key exists in a relation, either foreign key value must match a candidate key value of some tuple in its home relation or foreign key value must be wholly null. CUSTOMER ORDER places

Referential Integrity CUSTOMER(Cust-id, Cust-name, Credit-status, Business-type Cust-id Cust-name Credit-Status Business-type 1001 Smith Excellent Retail 1910 Jones Good Wholesale 2450 Brown Fair Multiple ORDER(Order-no, Date, Cust-id*) Order-no Date Cust-id* 100 01/02/06 1910 101 04/06/06 1001 102 15/06/06

Referential Integrity For Deletion and Update RESTRICTED Operation is ‘restricted’ to the case where no such matching occurs. i.e. attempt to delete (update) customer id 1001 fails. CASCADES Operation cascades to delete matches as well. i.e. delete (update) customer id 1001 and orders 101.

Referential Integrity For Deletion and Update NULLIFIES Foreign key is set to null in all matches and record is deleted (updated). i.e. delete (update) record, set cust-id in orders 101 to null.

Business Rules Brief, precise, and unambiguous description of a policy, procedure, or principle within a specific organization’s environment Apply to any organization that stores and uses data to generate information Description of operations that help to create and enforce actions within that organization’s environment

Business Rules Must be rendered in writing Must be kept up to date Sometimes are external to organization Must be easy to understand and widely disseminated Describe characteristics of the data as viewed by company

Sources of Business Rules Company Managers Policy Makers Department Managers Written Documentation Procedures Standards Operations manuals Direct interviews with end users

Importance of Business Rules Promote creation of accurate data model Standardize company’s view of data Constitute a communications tool between users and designers Allow designer to understand nature, role, and scope of data Allow designer to understand business processes Allow designer to develop appropriate relationship participation rules and constraints

Any Questions?