Relational Database. Database Management System (DBMS)

Slides:



Advertisements
Similar presentations
Relational Database and Data Modeling
Advertisements

The Relational Model Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Relational Database. Relational database: a set of relations Relation: made up of 2 parts: − Schema : specifies the name of relations, plus name and type.
Chapter 3 : Relational Model
Relational Model (CB Chapter 4) CPSC 356 Database Ellen Walker Hiram College.
SQL Lecture 10 Inst: Haya Sammaneh. Example Instance of Students Relation  Cardinality = 3, degree = 5, all rows distinct.
Accounting System Design
The Relational Model System Development Life Cycle Normalisation
Chapter 3 The Relational Model Transparencies © Pearson Education Limited 1995, 2005.
Chapter 3. 2 Chapter 3 - Objectives Terminology of relational model. Terminology of relational model. How tables are used to represent data. How tables.
Data Management Design
Introduction to Databases Transparencies
1 Minggu 2, Pertemuan 3 The Relational Model Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.
Chapter 1 INTRODUCTION TO DATABASE.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
1 Pertemuan 04 MODEL RELASIONAL Matakuliah: >/ > Tahun: > Versi: >
Thomas Connolly and Carolyn Begg’s
Relational Database Management System A type of database in which records are stored in relational form is called relational database management system.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Database Architecture The Relational Database Model.
IST Databases and DBMSs Todd S. Bacastow January 2005.
Chapter 3 Relational Model Chapter 4 in Textbook.
CSC271 Database Systems Lecture # 6. Summary: Previous Lecture  Relational model terminology  Mathematical relations  Database relations  Properties.
Relational Model & Relational Algebra. 2 Relational Model u Terminology of relational model. u How tables are used to represent data. u Connection between.
Lecture 2 The Relational Model. Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical relations.
Chapter 4 The Relational Model Pearson Education © 2014.
© Pearson Education Limited, Chapter 2 The Relational Model Transparencies.
Relational Model Session 6 Course Name: Database System Year : 2012.
Chapter 4 The Relational Model.
Chapter 3 The Relational Model Transparencies Last Updated: Pebruari 2011 By M. Arief
RAJIKA TANDON DATABASES CSE 781 – Database Management Systems Instructor: Dr. A. Goel.
Module 3: The Relational Model.  Overview Terminology Relational Data Structure Mathematical Relations Database Relations Relational Keys Relational.
Chapter 3 The Relational Model. 2 Chapter 3 - Objectives u Terminology of relational model. u How tables are used to represent data. u Connection between.
1 The Relational Database Model. 2 Learning Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical.
9/7/2012ISC329 Isabelle Bichindaritz1 The Relational Database Model.
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.
1 Relational Databases and SQL. Learning Objectives Understand techniques to model complex accounting phenomena in an E-R diagram Develop E-R diagrams.
The Relational Model Pertemuan 03 Matakuliah: M0564 /Pengantar Sistem Basis Data Tahun : 2008.
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.
Chapter 1 Introduction to Databases © Pearson Education Limited 1995, 2005.
The University of Akron Dept of Business Technology Computer Information Systems The Relational Model: Concepts 2440: 180 Database Concepts Instructor:
1 Introduction to Databases. 2 Examples of Database Applications u Purchases from the supermarket u Purchases using your credit card u Booking a holiday.
Relational Theory and Design
Programming Logic and Design Fourth Edition, Comprehensive Chapter 16 Using Relational Databases.
12/2/2015CPSC , CPSC , Lecture 41 Relational Model.
The Relational Model. 2 Relational Model Terminology u A relation is a table with columns and rows. –Only applies to logical structure of the database,
Chapter 3: Relational Databases
The Relational Model © Pearson Education Limited 1995, 2005 Bayu Adhi Tama, M.T.I.
CSCI 6315 Applied Database Systems Review for Midterm Exam I Xiang Lian The University of Texas Rio Grande Valley Edinburg, TX 78539
Chapter 3 The Relational Model. Objectives u Terminology of relational model. u How tables are used to represent data. u Connection between mathematical.
Microsoft Access CS 110 Fall Entity Relationship Model Entities Entities Principal data object about which information is to be collectedPrincipal.
Chapter 4 The Relational Model Pearson Education © 2009.
LECTURE TWO Introduction to Databases: Data models Relational database concepts Introduction to DDL & DML.
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 4 Relational Databases
The Relational Database Model
Chapter 3 The Relational Model.
Chapter 4 The Relational Model Pearson Education © 2009.
Chapter 4 The Relational Model Pearson Education © 2009.
Chapter 4+17 The Relational Model Pearson Education © 2014.
Chapter 4 The Relational Model Pearson Education © 2009.
The Relational Model Transparencies
Chapter 4 The Relational Model Pearson Education © 2009.
Chapter 4 The Relational Model Pearson Education © 2009.
Design tools and techniques for a relational database system
Chapter 4 The Relational Model Pearson Education © 2009.
INSTRUCTOR: MRS T.G. ZHOU
Chapter 3 The Relational Model
Presentation transcript:

Relational Database

Database Management System (DBMS)

Database Approach Data definition language (DDL). –Permits specification of data types, structures and any data constraints. –All specifications are stored in the database. Data manipulation language (DML). –General enquiry facility (query language) of the data.

Database Approach Controlled access to database may include: –A security system. –An integrity system. –A concurrency control system. –A recovery control system. –A user-accessible catalog. A view mechanism. –Provides users with only the data they want or need to use.

Views Allows each user to have his or her own view of the database. A view is essentially some subset of the database.

Views Benefits include: –Reduce complexity; –Provide a level of security; –Provide a mechanism to customize the appearance of the database; –Present a consistent, unchanging picture of the structure of the database, even if the underlying database is changed.

Practice Open Microsoft Access Open Example database Insert 3 records into the Department table DeptManager Description Marketing Accounting Customer service Create a query to select all department with Dept=“001”

Basics of the Relational Model The relational model represents information in tables (called relations) –Each table represents a set of entities –Each column of a table represents the attribute values of the entities –Each row of a table represents a single entity The rows of a relational table are unique Every table must have a key

Relation Schemas and Keys A key declaration is a constraint –A table is not allowed to have 2 different rows that have the same value for the key –Database systems enforce key constraints By blocking any attempt to modify a table that will result in a violation of the key constraint A relation schema is the specification of the structure of a table –Name of the table –Name and type of each attribute –Declaration of the key

Relational Model Terminology A relation is a table with columns and rows. –Only applies to logical structure of the database, not the physical structure. –Attribute is a named column of a relation. Domain is the set of allowable values for one or more attributes.

Relational Model Terminology Tuple is a row of a relation. Degree is the number of attributes in a relation. Cardinality is the number of tuples in a relation. Relational Database is a collection of normalized relations with distinct relation names.

Instances of Branch and Staff (part) Relations

Examples of Attribute Domains

Alternative Terminology for Relational Model

Properties of Relations Relation name is distinct from all other relation names in relational schema. Each cell of relation contains exactly one atomic (single) value. Each attribute has a distinct name. Values of an attribute are all from the same domain.

Properties of Relations Each tuple is distinct; there are no duplicate tuples. Order of attributes has no significance. Order of tuples has no significance, theoretically.

Practice Inside Microsoft Access, and Example database. Open the table Department (by double click) Repeat the first row of the table Department (creating duplication tuples/record/row)

Relational Keys Primary Key –Candidate key selected to identify tuples uniquely within relation. Alternate Keys –Candidate keys that are not selected to be primary key. Foreign Key –Attribute, or set of attributes, within one relation that matches candidate key of some (possibly same) relation.

Relational Integrity Null –Represents value for an attribute that is currently unknown or not applicable for tuple. –Deals with incomplete or exceptional data. –Represents the absence of a value and is not the same as zero or spaces, which are values.

Relational Integrity Data integrity: state that said the data contained in a database is correct Entity Integrity –In a base relation, no attribute of a primary key can be null. Referential Integrity –If 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.

Relational Integrity

Enterprise Constraints/User-defined constraints –Additional rules specified by users or database administrators.

Views Base Relation –Named relation corresponding to an entity in conceptual schema, whose tuples are physically stored in database. View –Dynamic result of one or more relational operations operating on base relations to produce another relation.

Relationship types One-to-One relationship: each record is related to only one record in the related table. One-to-Many relationship: each record in a table can have multiple related records Many-to-Many relationship: each record in a table can be related to multiple records in another table and vice versa.

Practice Create a table “Employee” with 3 fields: –SSN: char (11) –Name: char(100) –Salary: double Set SSN as the primary key Select Tools -> Relationships -> Select tables Department -> Add, then Employee -> Add. In the Relationship window, draw a connection from Employee table to Department table

Our Database ISBN Title AuthorID Genre Year PublisherID Pages Price Cover Subject AuthorId Name PublisherId PublisherName Website AuthorBook Publisher UserId Password AddressStreet AddressTown Zipcode TransactionId User TransactionId UserId BookId Date Status Transaction

Projects Project 1 (database) –Part 1: create database, tables, populate data, make links between tables –Part 2: modified existing database, add more tables, links –Part 3: query –Part 4: database front-end (form) –Part 5: advanced forms –Part 6: reports