Chapter 3 An Introduction to Relational Databases.

Slides:



Advertisements
Similar presentations
Introduction to Relational Database Systems 1 Lecture 4.
Advertisements

The Relational Model and Relational Algebra Nothing is so practical as a good theory Kurt Lewin, 1945.
Chapter 3 An Introduction to Relational Databases.
Foundations of Relational Implementation n Defining Relational Data n Relational Data Manipulation n Relational Algebra.
Chapter 5 Types. 5-2 Topics in this Chapter Values vs. Variables Types vs. Representations Type Definition Operators Type Generators SQL Facilities.
D ATABASE S YSTEMS I A DMIN S TUFF. 2 Mid-term exam Tuesday, Oct 2:30pm Room 3005 (usual room) Closed book No cheating, blah blah No class on Oct.
Midterm Review Lecture 14b. 14 Lectures So Far 1.Introduction 2.The Relational Model 3.Disks and Files 4.Relational Algebra 5.File Org, Indexes 6.Relational.
Database management concepts Database Management Systems (DBMS) An example of a database (relational) Database schema (e.g. relational) Data independence.
The Relational Database Model
1 A Closer Look Chapter 2. 2 Underlying Concepts of Databases and Transaction Processing.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Chapter 1 An Overview of Database Management. 1-2 Topics in this Chapter What is a Database System? What is a Database? Why Database? Data Independence.
Mgt 20600: IT Management & Applications Databases Tuesday April 4, 2006.
Information systems and databases Database information systems Read the textbook: Chapter 2: Information systems and databases FOR MORE INFO...
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
An Introduction to Database Management Systems R. Nakatsu.
Introduction To Databases IDIA 618 Fall 2014 Bridget M. Blodgett.
Chapter 6 Relations. Topics in this Chapter Tuples Relation Types Relation Values Relation Variables SQL Facilities.
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
Module Title? DBMS E-R Model to Relational Model.
Introduction –All information systems create, read, update and delete data. This data is stored in files and databases. Files are collections of similar.
Chapter 3 An Introduction to Relational Databases.
Chapter 9 Integrity. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.9-2 Topics in this Chapter Predicates and Propositions Internal vs.
Chapter One (Introduction) Objectives Introduction to Database Management Systems (DBMS) Relational Databases Model Restrictions of RD Database Life Cycle.
CHAPTER 8: MANAGING DATA RESOURCES. File Organization Terms Field: group of characters that represent something Record: group of related fields File:
Distribution of Marks For Second Semester Internal Sessional Evaluation External Evaluation Assignment /Project QuizzesClass Attendance Mid-Term Test Total.
CODD’s 12 RULES OF RELATIONAL DATABASE
Page 1 Topic 4 Relational Databases CPS510 Database Systems Abdolreza Abhari School of Computer Science Ryerson University.
DBSQL 3-1 Copyright © Genetic Computer School 2009 Chapter 3 Relational Database Model.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
GUS: 0262 Fundamentals of GIS Lecture Presentation 3: Relational Data Model Jeremy Mennis Department of Geography and Urban Studies Temple University.
Lecture 8 Database Theory & Practice (2) : The Relational Data Model UFCEKG-20-2 Data, Schemas & Applications.
Lecture2: Database Environment Prepared by L. Nouf Almujally & Aisha AlArfaj 1 Ref. Chapter2 College of Computer and Information Sciences - Information.
MSc IT UFIE8K-15-M Data Management Prakash Chatterjee Room 3P16
An Introduction to Relational Databases Prof. Yin-Fu Huang CSIE, NYUST Chapter 3.
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.
Lecture2: Database Environment Prepared by L. Nouf Almujally 1 Ref. Chapter2 Lecture2.
Relational Database. Database Management System (DBMS)
CHAPTER 3 DATABASES AND DATA WAREHOUSES. 2 OPENING CASE STUDY Chrysler Spins a Competitive Advantage with Supply Chain Management Software Chapter 2 –
6.1 © 2010 by Prentice Hall 6 Chapter Foundations of Business Intelligence: Databases and Information Management.
Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
Chapter 9 Database Systems Introduction to CS 1 st Semester, 2014 Sanghyun Park.
Chapter 9 Database Systems © 2007 Pearson Addison-Wesley. All rights reserved.
Introduction.  Administration  Simple DBMS  CMPT 454 Topics John Edgar2.
The relational model A data model (in general) : Integrated collection of concepts for describing data (data requirements). Relational model was introduced.
Principles of Database Design, Part I AIMS 2710 R. Nakatsu.
Mining real world data RDBMS and SQL. Index RDBMS introduction SQL (Structured Query language)
Chapter 13.3: Databases Invitation to Computer Science, Java Version, Second Edition.
ASET 1 Amity School of Engineering & Technology B. Tech. (CSE/IT), III Semester Database Management Systems Jitendra Rajpurohit.
1 CS 430 Database Theory Winter 2005 Lecture 7: Designing a Database Logical Level.
Chapter 1: Introduction. 1.2 Database Management System (DBMS) DBMS contains information about a particular enterprise Collection of interrelated data.
Faeez, Franz & Syamim.   Database – collection of persistent data  Database Management System (DBMS) – software system that supports creation, population,
LECTURE TWO Introduction to Databases: Data models Relational database concepts Introduction to DDL & DML.
Database Concepts and Applications in HRIS
Chapter 3 An Introduction to Relational Databases.
1 Section 1 - Introduction to SQL u SQL is an abbreviation for Structured Query Language. u It is generally pronounced “Sequel” u SQL is a unified language.
STRUCTURE OF PRESENTATION :
Chapter 9 Database Systems
Lecture 2 The Relational Model
STRUCTURE OF PRESENTATION :
Translation of ER-diagram into Relational Schema
Chapter 3 The Relational Database Model
Database Fundamentals
Database management concepts
Database management concepts
Lecture 16 : The Relational Data Model
Lecture 16 : The Relational Data Model
Presentation transcript:

Chapter 3 An Introduction to Relational Databases

3-2 Topics in this Chapter The Relational Model Relations and Relvars What Relations Mean Optimization The Catalog Base Relvars and Views Transactions

3-3 The Relational Model – Informally Structural –Data is perceived by users as tables Integrity –Data subject to specific integrity requirements Manipulation –Operators derive tables from other tables Restrict Project Join

3-4 The Relational Model – Operators, Informally Restrict –Extracts specified rows (a/k/a “Select”) Project –Extracts specified columns Join –Combines two tables into one –Based on common values in common column

3-5 The Relational Model – Materialization, and Set Processing, Informally Materialized evaluation of operators –Generates tables for all steps Pipelined evaluation of operators –Piecemeal intermediate steps Relational operators are set operators –No “row at a time” processing

3-6 The Relational Model – Logical/Physical, Informally Data is perceived by the user as tables DBMS can store the data on disk in other formats –Sequential files, indexes, pointer chains, hashing The Information Principle: Information represented by rows and columns, only No user-detected pointers Tables are joined logically based on user understood column values

3-7 The Relational Model – Integrity, Informally Every table has a “primary key” –Column whose value implies values in the other columns Some tables have a “foreign key” –References primary key of another table –Used to maintain links between tables –Column whose value implies values in columns in another table

3-8 The Relational Model – More Formally An open-ended collection of scalar types A relation type generator Facilities to define relation variables in generated types A relation assignment operator to assign values to relation variables An open-ended set of relational operators used to derive relation values from other relation values

3-9 Relations Relation is a mathematical term A table is a relation, mathematically speaking Codd was the first to promulgate this Relations have tuples or rows, not records And attributes or columns, not fields In Codd we trust

3-10 Relations and Relvars Relation is a mathematical term A relation is inherently a specific set of values A relation variable, or relvar, is the structure into which values are set Relvars can have different values at different times Most writers use “relation” (or “table’) to mean both the structure and the instantiated values But not from this Date forward

3-11 Formally, What Relations Mean: Relations vs. Types Relational model includes an open-ended set of types i.e. users can define their own types A type can be regarded as the set of all its possible instances e.g. Emp# as a type is the set of all possible employee numbers

3-12 Formally, What Relations Mean: Types and their Predicates Every relation – that is to say – every relation value – is divided into two – head and body Head has name and type for the column Body has rows that conform to the head e.g. Emp# is the name of the column, and could also be its type, if we have defined such a type; otherwise the type could be NUM

3-13 Formally, What Relations Mean: Types and their Predicates, continued For any relation, the head denotes a predicate A predicate is a truth-valued function that can take (as any function can) parameters For any relation, each row of the body denotes a true proposition A true proposition is obtained from the predicate by instantiating it (sending in arguments in place of the parameters)

3-14 Formally, What Relations Mean: Types and their Predicates, continued Predicate example: –Employee EMP# is named ENAME, works in department DEPT#, and earns salary SALARY –EMP#, ENAME, DEPT#, and SALARY are parameters as well as table column headings True proposition example: –Employee E1 is named Lopez, works in department D1, and earns salary 40k –E1, Lopez, D1, and 40k are arguments as well as table atomic values

3-15 Formally, What Relations Mean: Types and their Predicates, continued Types are sets of things we can talk about Relations are sets of things we say about the things we can talk about A relvar is a predicate A relation is a set of true propositions

3-16 Optimization Relational operators are set operators Relational languages are less procedural than procedural languages Relational languages function at a higher level of abstraction than do procedural languages Relational Database Management implementations require an optimizer Optimizer handles the “how” after the user specifies the “what result”

3-17 The Catalog System catalog is required to keep track of all database objects Can be thought of as a dictionary Implemented in relvars (known to the DBMS as tables) that can be queried

3-18 Base Relvars and Views Base relvars –Created in SQL via CREATE TABLE Views can be derived from base relvars –Created in SQL via CREATE VIEW View relvars are stored in the catalog View values do not exist separately View values are whatever populates the base relation at the time the user queries the view The user perceives the view as a real relation

3-19 Transactions A transaction is a logical unit of work May encompass one or many operations –SQL uses BEGIN TRANSACTION, COMMIT, and ROLLBACK to support transactions Transactions are atomic, durable, isolated, and serializable