SlideShare a Scribd company logo
1 of 16
Lecture 02
 The Relational Data Model
Advantages of Database
Advantages of Database
•   Data Consistency
•   Better Data Security
•   Faster Application Development
•   Economy of Scale
•   Better Concurrency Control
•   Better Backup and Recovery Facility
The Range of
            Database Applications
• Personal Database – standalone desktop database

• Workgroup Database – local area network (<25 users)

• Department Database – local area network (25-100 users)

• Enterprise Database – wide-area network (hundreds or thousands of
  users)
Evolution of DB Systems
•   Flat files - 1960s - 1980s
•   Hierarchical – 1970s - 1990s
•   Network – 1970s - 1990s
•   Relational – 1980s - present
•   Object-oriented – 1990s - present
•   Object-relational – 1990s - present
•   Data warehousing – 1980s - present
•   Web-enabled – 1990s - present
Models, Schemas and States
• A data model defines the constructs
    available for defining a schema
   – defines possible schemas

• A schema defines the constructs
    available for storing the data
   – defines database structure
   – limits the possible database states

• A database state (or instance) is all
    the data at some point in time
   the database content
Models, Schemas and States
• data model
   – fixed by the DBMS
   – Defined by DB designer

• schema
   – defined by the DB designer
   – generally fixed once defined *

• database state
   – changes over time due to user updates
          * schema modifications are possible once the database
            is populated, but this generally causes difficulties
RELATION SCHEMAS
AND
RELATION INSTANCES
Relation Schemas
• A relation is defined by
    a name and
    a set of attributes

• Each attribute has a name and a domain
   – a domain is a set of possible values
   – all domains are sets of atomic values
   – RDM does not recommend complex data types
   – domains may contain a special null value
Definition: Relation Schema
• Relation Schema
                 R(A1, A2, … , An)
    – R is the relation name
    – A1 … An are the attribute names

• Domains are denoted by

                     dom(Ai)
• degree = the number of attributes
Characteristics of Relations
• A relation is a set
   – tuples are unordered
   – no duplicate tuples

• Attribute values within tuples are ordered
   – values are matched to attributes by position
Characteristics of Relations
• Values in tuples are atomic

• Each Column has distinct name

• The values of the attribute come from the same domain

• The order of the column is immaterial

• Each row/tuple/record is distinct
SQL: Relation States
• A relation is viewed as a table

• The attributes define the columns of the table

• Each row in the table holds related
    values for each attribute
   – a row often represents a conceptual entity (object)

• Values in each column must come
    from the domain of the attribute
Example Schema
Cs 371-lecture-02

More Related Content

What's hot (9)

GraphDatabases
GraphDatabasesGraphDatabases
GraphDatabases
 
Pega test topics - data modeling
Pega  test topics -  data modelingPega  test topics -  data modeling
Pega test topics - data modeling
 
CS3270 - DATABASE SYSTEM - Lecture (2)
CS3270 - DATABASE SYSTEM - Lecture (2)CS3270 - DATABASE SYSTEM - Lecture (2)
CS3270 - DATABASE SYSTEM - Lecture (2)
 
MySQL Cursors
MySQL CursorsMySQL Cursors
MySQL Cursors
 
The Smartpath Information Systems | BASIC RDBMS CONCEPTS
The Smartpath Information Systems | BASIC RDBMS CONCEPTSThe Smartpath Information Systems | BASIC RDBMS CONCEPTS
The Smartpath Information Systems | BASIC RDBMS CONCEPTS
 
Types of no sql databases
Types of no sql databasesTypes of no sql databases
Types of no sql databases
 
Sql performance tuning
Sql performance tuningSql performance tuning
Sql performance tuning
 
Advanced database protocols
Advanced database protocolsAdvanced database protocols
Advanced database protocols
 
intro for sql
intro for sql intro for sql
intro for sql
 

Similar to Cs 371-lecture-02

Similar to Cs 371-lecture-02 (20)

relational database
relational databaserelational database
relational database
 
DB2 on Mainframe
DB2 on MainframeDB2 on Mainframe
DB2 on Mainframe
 
No SQL
No SQLNo SQL
No SQL
 
Relational Database.pptx
Relational Database.pptxRelational Database.pptx
Relational Database.pptx
 
DBMS & Data Models - In Introduction
DBMS & Data Models - In IntroductionDBMS & Data Models - In Introduction
DBMS & Data Models - In Introduction
 
Sql server ___________session_1-intro
Sql server  ___________session_1-introSql server  ___________session_1-intro
Sql server ___________session_1-intro
 
demo2.ppt
demo2.pptdemo2.ppt
demo2.ppt
 
Data base management system and Architecture ppt.
Data base management system and Architecture ppt.Data base management system and Architecture ppt.
Data base management system and Architecture ppt.
 
Db sys concept
Db sys conceptDb sys concept
Db sys concept
 
Dbms Lec Uog 02
Dbms Lec Uog 02Dbms Lec Uog 02
Dbms Lec Uog 02
 
Ch1.2_DB system Concepts and Architecture.pptx
Ch1.2_DB system Concepts and Architecture.pptxCh1.2_DB system Concepts and Architecture.pptx
Ch1.2_DB system Concepts and Architecture.pptx
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
DBMS
DBMS DBMS
DBMS
 
RELATIONAL MODEL OF DATABASES AND OTHER CONCEPTS OF DATABASES​
RELATIONAL MODEL OF DATABASES AND OTHER CONCEPTS OF DATABASES​RELATIONAL MODEL OF DATABASES AND OTHER CONCEPTS OF DATABASES​
RELATIONAL MODEL OF DATABASES AND OTHER CONCEPTS OF DATABASES​
 
(Dbms) class 1 & 2 (Presentation)
(Dbms) class 1 & 2 (Presentation)(Dbms) class 1 & 2 (Presentation)
(Dbms) class 1 & 2 (Presentation)
 
History of database processing module 1 (2)
History of database processing module 1 (2)History of database processing module 1 (2)
History of database processing module 1 (2)
 
Database system concepts
Database system conceptsDatabase system concepts
Database system concepts
 
Chapter – 2 Data Models.pdf
Chapter – 2 Data Models.pdfChapter – 2 Data Models.pdf
Chapter – 2 Data Models.pdf
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Database.ppt
Database.pptDatabase.ppt
Database.ppt
 

Cs 371-lecture-02

  • 1. Lecture 02 The Relational Data Model
  • 3. Advantages of Database • Data Consistency • Better Data Security • Faster Application Development • Economy of Scale • Better Concurrency Control • Better Backup and Recovery Facility
  • 4. The Range of Database Applications • Personal Database – standalone desktop database • Workgroup Database – local area network (<25 users) • Department Database – local area network (25-100 users) • Enterprise Database – wide-area network (hundreds or thousands of users)
  • 5. Evolution of DB Systems • Flat files - 1960s - 1980s • Hierarchical – 1970s - 1990s • Network – 1970s - 1990s • Relational – 1980s - present • Object-oriented – 1990s - present • Object-relational – 1990s - present • Data warehousing – 1980s - present • Web-enabled – 1990s - present
  • 6. Models, Schemas and States • A data model defines the constructs available for defining a schema – defines possible schemas • A schema defines the constructs available for storing the data – defines database structure – limits the possible database states • A database state (or instance) is all the data at some point in time  the database content
  • 7. Models, Schemas and States • data model – fixed by the DBMS – Defined by DB designer • schema – defined by the DB designer – generally fixed once defined * • database state – changes over time due to user updates * schema modifications are possible once the database is populated, but this generally causes difficulties
  • 9. Relation Schemas • A relation is defined by a name and a set of attributes • Each attribute has a name and a domain – a domain is a set of possible values – all domains are sets of atomic values – RDM does not recommend complex data types – domains may contain a special null value
  • 10.
  • 11. Definition: Relation Schema • Relation Schema R(A1, A2, … , An) – R is the relation name – A1 … An are the attribute names • Domains are denoted by dom(Ai) • degree = the number of attributes
  • 12. Characteristics of Relations • A relation is a set – tuples are unordered – no duplicate tuples • Attribute values within tuples are ordered – values are matched to attributes by position
  • 13. Characteristics of Relations • Values in tuples are atomic • Each Column has distinct name • The values of the attribute come from the same domain • The order of the column is immaterial • Each row/tuple/record is distinct
  • 14. SQL: Relation States • A relation is viewed as a table • The attributes define the columns of the table • Each row in the table holds related values for each attribute – a row often represents a conceptual entity (object) • Values in each column must come from the domain of the attribute