Relational Model Reading: C&B, Chap 2, 3 & 4. Dept. of Computing Science, University of Aberdeen 2 In this lecture you will learn The concept of Model.

Slides:



Advertisements
Similar presentations
Three-Step Database Design
Advertisements

Relational Database and Data Modeling
CS2008 Data Management CS5035 Introduction to Database Systems Nigel Beacham based on materials by Dr Yaji.
B+-Trees Reading: C&B Ch 23 & 29. Dept. of Computing Science, University of Aberdeen2 Recap of Data Storage in Files Data is stored in files using primary.
SQL - III Reading: C&B, Chap 6, 7, 8 & 9. Dept. of Computing Science, University of Aberdeen 2 In this lecture you will learn the concept of joining tables.
Database Design: ER Modelling
Data Definition and Integrity Constraints
Database Design: ER Modelling (Continued)
File Organization & Indexing Reading: C&B, Ch 18 & 23.
SQL-II Reading: C&B, Chap 6, 7, 8 & 9. Dept. of Computing Science, University of Aberdeen2 In this lecture you will learn how to sort and group query.
Lecture # 7.
Chapter 10: Designing Databases
Creating Tables. 2 home back first prev next last What Will I Learn? List and provide an example of each of the number, character, and date data types.
Post Exam Study Database Design
Databases MMG508. DB Properties  Definition of a database: “A database is a collection of interrelated data items that are managed as a single unit”
CSC271 Database Systems Lecture # 5. Summary: Previous Lecture  Database languages  Functions of a DBMS  DBMS environment  Data models and their categories.
Relational Model (CB Chapter 4) CPSC 356 Database Ellen Walker Hiram College.
1 Basic DB Terms Data: Meaningful facts, text, graphics, images, sound, video segments –A collection of individual responses from a marketing research.
Chapter 3. 2 Chapter 3 - Objectives Terminology of relational model. Terminology of relational model. How tables are used to represent data. How tables.
Relational Database Management System A type of database in which records are stored in relational form is called relational database management system.
Chapter 4 Object and Object-Relational Databases (Part ½: Object-Oriented Concepts) Lecturer: H.Ben Othmen Department of Computer Science, Umm Al-Qura.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
IST Databases and DBMSs Todd S. Bacastow January 2005.
INTRODUCTION TO DATABASE USING MS ACCESS 2013 PART 2 NOVEMBER 4, 2014.
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
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.
Information storage: Introduction of database 10/7/2004 Xiangming Mu.
© Pearson Education Limited, Chapter 2 The Relational Model Transparencies.
44220: Database Design & Implementation Logical Data Modelling Ian Perry Room: C48 Tel Ext.: 7287
Relational Model Session 6 Course Name: Database System Year : 2012.
Chapter 3 The Relational Model Transparencies Last Updated: Pebruari 2011 By M. Arief
Introduction to SQL Steve Perry
Chapter One (Introduction) Objectives Introduction to Database Management Systems (DBMS) Relational Databases Model Restrictions of RD Database Life Cycle.
CS 474 Database Design and Application Terminology Jan 11, 2000.
1 11/3/05CS360 Windows Programming Databases and Data Representation.
FEN  Concepts and terminology  Operations (relational algebra)  Integrity constraints The relational model.
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.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 2: Intro to Relational.
University of Sunderland COM 220Lecture Two Slide 1 Database Theory.
10/17/2012ISC471/HCI571 Isabelle Bichindaritz 1 Technologies Databases.
MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj RM/SQL Lecture 1 ©Akhilesh Bajaj, 2000, 2002, 2003, All.
Lecture2: Database Environment Prepared by L. Nouf Almujally & Aisha AlArfaj 1 Ref. Chapter2 College of Computer and Information Sciences - Information.
1 Chapter 1 Introduction. 2 Introduction n Definition A database management system (DBMS) is a general-purpose software system that facilitates the process.
9/7/2012ISC329 Isabelle Bichindaritz1 The Relational Database Model.
Relational Data Model Ch. 7.1 – 7.3 John Ortiz Lecture 3Relational Data Model2 Why Study Relational Model?  Most widely used model.  Vendors: IBM,
Lecture2: Database Environment Prepared by L. Nouf Almujally 1 Ref. Chapter2 Lecture2.
FEN Introduction to the database field:  Applications, concepts and terminology Seminar: Introduction to relational databases.
FEN Introduction to the database field:  The Relational Model Seminar: Introduction to relational databases.
Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
The University of Akron Dept of Business Technology Computer Information Systems The Relational Model: Concepts 2440: 180 Database Concepts Instructor:
12/2/2015CPSC , CPSC , Lecture 41 Relational Model.
L8-2-S1 Misc Topics © M.E. Fayad SJSU -- CmpE Database Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of.
44271: Database Design & Implementation Logical Data Modelling (Avoiding Database Anomalies) Ian Perry Room: C49 Tel Ext.: 7287
The relational model A data model (in general) : Integrated collection of concepts for describing data (data requirements). Relational model was introduced.
Jemerson Pedernal IT 2.1 FUNDAMENTALS OF DATABASE APPLICATIONS by PEDERNAL, JEMERSON G. [BS-Computer Science] Palawan State University Computer Network.
Database Systems Logical Data Modelling Tutor:Ian Perry Tel: Web:
Chapter 3 The Relational Database Model. Database Systems, 10th Edition 2 * Relational model * View data logically rather than physically * Table * Structural.
The relational model1 The relational model Mathematical basis for relational databases.
Chapter 3 The Relational Model. Objectives u Terminology of relational model. u How tables are used to represent data. u Connection between mathematical.
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.
Rationale Databases are an integral part of an organization. Aspiring Database Developers should be able to efficiently design and implement databases.
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.
The Relational Model May Aldoayan.
Data Base System Lecture 6: Relational Model
Database.
The Relational Model Textbook /7/2018.
INTRODUCTION A Database system is basically a computer based record keeping system. The collection of data, usually referred to as the database, contains.
Presentation transcript:

Relational Model Reading: C&B, Chap 2, 3 & 4

Dept. of Computing Science, University of Aberdeen 2 In this lecture you will learn The concept of Model Simple definitions of terminology in Relational Model Why relational model is important? Initial idea of Relational Querying

Dept. of Computing Science, University of Aberdeen 3 Introduction DBMS models data with respect to –Machine physical storage of data involves low level details that are not important for user –User logical view of data (tables) We focus on Users DATA MODEL

Dept. of Computing Science, University of Aberdeen 4 The Concept of Model A model represents something. –At a level of detail suitable for its purpose For example, an architects model of a bridge –Architects model brings the bridge to life even before its construction Models can be: –Blueprints for building the real somethings (such as bridges) –Useful for testing (model a bridge and test it before construction) –Handy for learning (you start driving lessons on a simulator) All our thinking is based on models of things –We build models of everything Thinking with models is considered SMART

Dept. of Computing Science, University of Aberdeen 5 Learning with Relational Model Theory of databases involves many models –Relational model, ER model Relational model is the users data model and we learn it first DBMSs that use relational model are called Relational Database Management Systems (RDBMS) Apply our learning on a few real RDBMS (MSAccess & MYSQL) –Mostly in practical classes –Also in lectures Hopefully this training will help us with other RDBMS as well (such as SQL Server and Oracle)

Dept. of Computing Science, University of Aberdeen 6 Why Relational Model? Most modern database software is based on relational model –Relational model is what the user sees in a RDBMS Relational Model has a simple logical structure (as we will see later) It is intuitive (as we will see later) Relational model has its origins in sound mathematics –Set theory and theory of relations (hence the name relational) –We study the mathematics later in the course Relational Model describes the pure concepts behind real database systems –Real systems at times may have unfaithful implementations of these pure concepts

Dept. of Computing Science, University of Aberdeen 7 What is relational model? A logical representation of a database Proposed by IBMs E. F. Codd in 1970 –Won a Turing Award for the model!! Earlier data models were not relational. They were –Hierarchical (tree) or –Network (graph) We focus on relational models in this course

Dept. of Computing Science, University of Aberdeen 8 Relational Model is simple Relational Database: a collection of connected tables (relations) –Named Tables (relations) have Named Columns (attributes) Unnamed Rows (tuples) –Domain: a set of allowable values for one or more columns –Relationships – links or connections –Keys (primary, foreign) –Integrity Constraints Its that simple!

Dept. of Computing Science, University of Aberdeen 9 Example: DreamHome DreamHome models data in a typical real estate business –you will use this database in the practical DreamHome has data related to –Branch offices –Staff in each branch office –… Branch office data –Branch number –Address Staff data –Staff number –Staff details Since staff belong to a branch office, there is a relationship between staff data and branch office data. –Staff and Branch tables are linked (connected)

Dept. of Computing Science, University of Aberdeen 10 Example: DreamHome 2 branchNoStreetCityPostcode B00522 Deer RdLondonSW1 4EH B00716 Argyll StAberdeenAB2 3SU B Main StGlasgowG11 9QX B00432 Clover DrBristolBS99 1NZ B00256 Clover DrLondonNW10 6EU staffNofNameLNamePositionSexDOBSalarybranchNo SL21JohnWhiteManagerM1-Oct B005 SG37AnnBeechAssistantF10-Nov B003 SG14DavidFordSupervisorM24-Mar B003 SA9MaryHoweAssistantF19-Feb B007 SG5SusanBrandManagerF13-Jun B003 SL41JulieLeeAssistantF13-Jun B005 Relation Attributes Branch Staff Primary KeyForeign Key

Dept. of Computing Science, University of Aberdeen 11 Relation (Table) Relation has two parts –Schema Name of the relation and the set of attributes & their respective domains For example, Branch (branchNo:domain1, street: domain2, city:domain3, postcode:domain4) –Instance Set of attributes and their values in a tuple For example, (branchNo:B005, street: 22 Dee Street, city:Aberdeen,postcode:AB25 1AB)

Dept. of Computing Science, University of Aberdeen 12 Key A key is an attribute or set of attributes that uniquely identify a row A table may have many candidate keys Primary Key: Key selected for unique identification of rows –For example, branchNo in the Branch table –Cannot be NULL Foreign Key: an attribute or a set of attributes in one table that refer to a row in another table –For example, branchNo in Staff table

Dept. of Computing Science, University of Aberdeen 13 Properties of relations Rows & columns can be in any order no two rows are identical all values belonging to a particular attribute are from the same domain attributes are atomic attributes may have a null value (but not the primary key)

Dept. of Computing Science, University of Aberdeen 14 Relational model is intuitive Many common datasets naturally fit relational model Telephone directory –Directory(Name:domain1, Address:domain2, TelNo:domain3) Class Attendance Sheets –Attendance(Name:domain1, IDNo:domain2, Signature: domain3) Try with other datasets you know

Dept. of Computing Science, University of Aberdeen 15 Data Retrieval: Relational Querying The main strength of relational model: supports simple yet powerful data retrieval (querying in general) –The whole purpose of modelling data is to be able to retrieve data items efficiently Output of a query is modelled as a relation (table) In RDBMS users view data always in terms of tables –if you learn relational model well you can find it easy to use databases SQL (see-quel): a popular query language for relational databases.

Dept. of Computing Science, University of Aberdeen 16 Example: Relational Querying Consider the branch relation from the DreamHome database Query: we want a list of branches in London Output is a sub-relation (sub-table) of the Branch relation (table) branchNoStreetCityPostcode B00522 Deer RdLondonSW1 4EH B00716 Argyll StAberdeenAB2 3SU B Main StGlasgowG11 9QX B00432 Clover DrBristolBS99 1NZ B00256 Clover DrLondonNW10 6EU branchNoStreetCityPostcode B00522 Deer RdLondonSW1 4EH B00256 Clover DrLondonNW10 6EU London Branches Branch

Dept. of Computing Science, University of Aberdeen 17 Conclusion Relational model of database: a collection of connected tables –Conceptually relational model is simple –Querying the data is the main goal of relational modelling User interactions with RDBMS are through SQL (Query language) only We now focus on learning SQL –Later we will learn how to organize data into a relational model (under database design)