SlideShare a Scribd company logo
1 of 54
Information and Communication
Technologies (ICT)
Database Systems
Lecture 5
• Overview of Today’s Lecture
• Fundamentals of database systems: concept, characteristic,
architecture
• Data models. Normalization. Data integrity restrictions
• Query optimization and processing
• The basics of SQL. Parallel processing of data and their recovery
• Design and development of databases
• Object-relational mapping (ORM) programming technology
• Distributed, parallel and heterogeneous databases
1
2
Database
What is a database ?
Give examples of databases
3
Database
What is a database ?
•A collection of files storing related data
Give examples of databases
•Accounts database; payroll database; ENU’s
students database; Amazon’s products database;
airline reservation database
4
Database Management System
What is a DBMS ?
Give examples of DBMS
5
Database Management System
What is a DBMS ?
•A big C/C++ program written by someone else that
allows us to manage efficiently a large database
and allows it to persist over long periods of time
Give examples of DBMS
•DB2 (IBM), SQL Server (MS), Oracle, Sybase
•MySQL, Postgres, …
6
What the Database Systems Does
1. Create/store large datasets
2. Search/query/update
3. Change the structure
4. Concurrent access to many user
5. Recover from crashes
6. Security
7
Enters a DMBS
Data files
Database server
(someone else’s
C program) Applications
connection
(ODBC, JDBC)
“Two tier system” or “client-server”
8
Data Independence
Directors: Movie_Directors:
Movies:
id fName lName
15901 Francis Ford Coppola
. . .
mid Title Year
130128 The Godfather 1972
. . .
id mid
15901 130128
. . .
Logical view
Directors_file
Directors_fname_index_file
Moviews_title_index_file
Movies_file Physical view
What is Database ?
A Database is a structured collection of data
that allows people to extract information in
a way that meets their needs. The data can
include text, numbers, pictures: anything
that can be stored in a computer;
A Database a collection of data that is
organized especially to be used by a
computer;
9
Database Management System (DBMS)
• DBMS contains information about a particular
enterprise
• Collection of interrelated data
• Set of programs to access the data
• An environment that is both convenient and efficient to use
• Database Applications:
• Banking: transactions
• Airlines: reservations, schedules
• Universities: registration, grades
• Sales: customers, products, purchases
• Online retailers: order tracking, customized recommendations
• Manufacturing: production, inventory, orders, supply chain
• Human resources: employee records, salaries, tax deductions
• Databases can be very large.
• Databases touch all aspects of our lives
10
University Database Example
•Application program examples
• Add new students, instructors, and courses
• Register students for courses, and generate class rosters
• Assign grades to students, compute grade point averages
(GPA) and generate transcripts
•In the early days, database applications were built
directly on top of file systems
11
What are databases used for?
To store information about people, for example:
• patients in a hospital
• students at a school.
To store information about things, for example:
• cars to be sold
• books in a library.
To store information about events, for example:
• hotel bookings
• results of races.
12
Concepts of Database
•Field (Column): a single piece of information. Could be
a name, or a number. In some cases, it may even be a
null or empty value.
•Record (Row): a collection of related fields. A number
of pieces of information that relate to the same
object. For example: If you keep records on an
employee, you might have their name, address, social
security number, phone number, etc…Each piece of the
information relates back to one employee. This would
be the employee’s record.
•Table (File): a collection of related records. If you put all
the employee records together, you have a table of
employees.
13
Table
Record 1 Field 1 Field 2 Field 3 Field 4
Record 2 Field 1 Field 2 Field 3 Field 4
Record 3 Field 1 Field 2 Field 3 Field 4
Record 4 Field 1 Field 2 Field 3 Field 4
Record 5 Field 1 Field 2 Field 3 Field 4
The structure of Database
14
Data Models
•A collection of tools for describing
• Data
• Data relationships
• Data semantics
• Data constraints
•Relational model
•Entity-Relationship data model (mainly for
database design)
•Object-based data models (Object-oriented and
Object-relational)
•Semistructured data model (XML)
•Other older models:
• Network model
• Hierarchical model
15
Hierarchical model.
In a hierarchical model, data is organized into
an inverted tree-like structure. This structure
arranges the various data elements in a
hierarchy and helps to establish logical
relationships among data elements of
multiple files. Each unit in the model is a
record which is also known as a node. Each
record has a single parent.
16
Hierarchical model.
17
Network model.
•The network model tends to store records with links to
other records. Each record in the database can have
multiple parents, i.e., the relationships among data
elements can have a many to many relationships. So,
this model is an expansion to the hierarchical structure,
allowing many-to-many relationships in a tree-like
structure that allows multiple parents.
•The network model provides greater advantage than the
hierarchical model in that it promotes greater flexibility
and data accessibility.
18
Network model.
19
The relational model for the database management is a
database model based on relations. The basic data
structure of the relational model is a table where
information about a particular entity (say, a student) is
represented in columns and rows. The columns
enumerate the various attributes (i.e. characteristics) of
an entity (e.g. student name, address, registration
_number). The rows (also called records) represent
instances of an entity (e.g. specific student).
Relational model.
20
Relational Model
• All the data is stored in various tables.
• Example of tabular data in the relational model Columns
Rows
21
A Sample Relational Database
22
Relational model
23
•In the object oriented data model the (OODM). Both
data and their relationship are contained in a single
structure known us an object.
•An object includes information about relationship
between the facts within the object, as well as
information about its relationship with other objects.
•It is said to be ‘’SEMANTIC DATA MODEL’’
•The OO Data model components An object is the
abstraction of the real- word entity. An object
represents only one occurrence of entity.
• Attributes describe the property of an object.
Object-Oriented model.
24
25
Normalization of databases is a process
of transformation of database to the
kind answering the normalized forms.
Normalization
26
Normalization
In the theory of relational databases, it is accepted to
distinguish four types of limitations of integrity:
•Limitation of database is name a limit on values that it is
let to accept to the indicated database.
•Limiting to the variable of relation is name a limit on
values that it is let to accept to the indicated variable of
relation.
•Limitation of attribute is name a limit on values that it is
let to accept to the indicated attribute.
•Limitation of type is not that another, as determination
of great number of values this type consists of that.
27
Data integrity restrictions
Integrity of a DB doesn't guarantee reliability (truth) of
the information which is contained in it, but provides at
least plausibility of this information, rejecting certainly
improbable, impossible values. Thus, it isn't necessary
to confuse integrity (consistency) of a DB to truth of a
DB. Truth and consistency — not same.
28
Database System (DBS)
A database management system (DBMS) is system
software for creating and managing databases. The DBMS
provides users and programmers with a systematic way to
create, retrieve, update and manage data.
The DBMS essentially serves as an interface between
the database and end users or application programs,
ensuring that data is consistently organized and remains
easily accessible.
29
Data Definition Language (DDL)
• Specification notation for defining the database schema
Example: create table instructor (
ID char(5),
name varchar(20),
dept_name varchar(20),
salary numeric(8,2))
• DDL compiler generates a set of table templates stored in a
data dictionary
• Data dictionary contains metadata (i.e., data about data)
• Database schema
• Integrity constraints
• Primary key (ID uniquely identifies instructors)
• Authorization
• Who can access what
30
Data Manipulation Language (DML)
•Language for accessing and manipulating the data
organized by the appropriate data model
• DML also known as query language
•Two classes of languages
• Pure – used for proving properties about computational
power and for optimization
• Relational Algebra
• Tuple relational calculus
• Domain relational calculus
• Commercial – used in commercial systems
• SQL is the most widely used commercial language
31
The basics of SQL
SQL stands for Structured Query Language.
SQL is used to communicate with a database. According to
ANSI (American National Standards Institute), it is the
standard language for relational database management
systems. SQL statements are used to perform tasks such
as update data on a database, or retrieve data from a
database. Some common relational database
management systems that use SQL are: Oracle, Sybase,
Microsoft SQL Server, Access, Ingres, etc.
32
In the general terms, "SQL the database" is the general
name for the relational database management system
(RDMS). For some systems, "database" also concerns to
group of tables, data, the configuration information
which are essentially separate part from other, similar
constructions. In this case, each installation of SQL of
the database can consist of several databases. In other
systems, they are mentioned as tables.
The basics of SQL
33
Here is a sample table called "weather".
Weather
city state high low
Phoenix Arizona 105 90
Tucson Arizona 101 92
Flagstaff Arizona 88 69
San Diego California 77 60
Albuquerque
New
Mexico
80 72
34
One of the major operations which are executed by
data full operation is selection of the information
which is stored in the database. For this purpose,
the user shall execute a request (query).
The basics of SQL
35
There are four main types of requests of data in SQL
which relate to so-called language of a manipulation data
(DataManipulationLanguage or DML):
• SELECT – to choose lines from tables;
• INSERT – to add a line to the table;
• UPDATE – to change lines in the table;
• DELETE – to remove lines in the table;
Each of these requests has different operators and
functions which are used to make some dataful actions.
The basics of SQL
36
Design and development of databases
Design of databases — process of creation of the
database scheme and determination of necessary
integrity constraints.
Main objectives of design of databases:
• Support of storage in a DB of all necessary information.
• A data acquisition possibility on all necessary requests.
• Abbreviation of redundancy and duplicating of data.
• Support of integrity of the database.
Main design stages of databases
37
Object-Relational Data Models
•Relational model: flat, “atomic” values
•Object Relational Data Models
• Extend the relational data model by including object
orientation and constructs to deal with added data types.
• Allow attributes of tuples to have complex types,
including non-atomic values such as nested relations.
• Preserve relational foundations, in particular the
declarative access to data, while extending modeling
power.
• Provide upward compatibility with existing relational
languages.
38
Object-relational mapping (ORM)
ORM or Object-relational mapping is a technology of
programming which allows to transform incompatible
types of models to OOP, in particular, between the
data store and subjects to programming. ORM is used
for simplification of process of saving objects in a
relational database and their extraction, in case of this
ORM itself cares for data transformation between two
incompatible statuses.
39
Object-relational mapping (ORM)
40
The majority of ORM tools considerably rely on meta
data of the database and objects so objects need to
know nothing about a database structure, and the
database — nothing about how data are organized in
the application. ORM provides complete division of
tasks in well programmed applications in case of which
both the database, and the application can work data
full everyone in the root form.
Object-relational mapping (ORM)
41
XML: Extensible Markup Language
•Defined by the WWW Consortium (W3C)
•Originally intended as a document markup language
not a database language
•The ability to specify new tags, and to create nested
tag structures made XML a great way to exchange
data, not just documents
•XML has become the basis for all new generation
data interchange formats.
•A wide variety of tools is available for parsing,
browsing and querying XML documents/data
42
Database Users and Administrators
Database
43
Database Architecture
The architecture of a database systems is greatly
influenced by the underlying computer system on
which the database is running:
•Centralized
•Client-server
•Parallel (multi-processor)
•Distributed
44
Distributed, parallel and heterogeneous databases
A distributed database is a database in
which portions of the database are
stored in multiple physical locations and
processing is distributed among multiple
database nodes.
45
Distributed database
46
Parallel DB
Parallel database system seeks to improve
performance through parallelization of
various operations such as loading data
,building indexes, and evaluating queries
by using multiple CPUs and Disks in
Parallel.
47
Parallel DB
48
Heterogeneous database
In a heterogeneous distributed database, different
sites have different operating systems, DBMS products
and data models.
Its properties are :
• Different sites use dissimilar schemas and software.
• The system may be composed of a variety of DBMSs like
relational, network, hierarchical or object oriented.
• Query processing is complex due to dissimilar schemas.
• Transaction processing is complex due to dissimilar
software.
• A site may not be aware of other sites and so there is
limited co-operation in processing user requests.
49
Heterogeneous database
50
History of Database Systems
•1950s and early 1960s:
• Data processing using magnetic tapes for storage
• Tapes provided only sequential access
• Punched cards for input
•Late 1960s and 1970s:
• Hard disks allowed direct access to data
• Network and hierarchical data models in widespread use
• Ted Codd defines the relational data model
• Would win the ACM Turing Award for this work
• IBM Research begins System R prototype
• UC Berkeley begins Ingres prototype
• High-performance (for the era) transaction processing
51
History (cont.)
• 1980s:
• Research relational prototypes evolve into commercial systems
• SQL becomes industrial standard
• Parallel and distributed database systems
• Object-oriented database systems
• 1990s:
• Large decision support and data-mining applications
• Large multi-terabyte data warehouses
• Emergence of Web commerce
• Early 2000s:
• XML and XQuery standards
• Automated database administration
• Later 2000s:
• Giant data storage systems
• Google BigTable, Yahoo PNuts, Amazon, ..
52
Questions:
1. Database is …
2. Database management system is …
3. Examples of DBMS
4. Types of DBMS
5. Relational DBMS
6. Concept of DBMS
53

More Related Content

Similar to lecture5 (1) (2).pptx

Week 1 and 2 Getting started with DBMS.pptx
Week 1 and 2 Getting started with DBMS.pptxWeek 1 and 2 Getting started with DBMS.pptx
Week 1 and 2 Getting started with DBMS.pptx
Riannel Tecson
 
Info systems databases
Info systems databasesInfo systems databases
Info systems databases
MR Z
 
introduction-to-dbms-unit-1.ppt
introduction-to-dbms-unit-1.pptintroduction-to-dbms-unit-1.ppt
introduction-to-dbms-unit-1.ppt
rekhasai2468
 
Utsav Mahendra : Introduction to Database and managemnet
Utsav Mahendra : Introduction to Database and managemnetUtsav Mahendra : Introduction to Database and managemnet
Utsav Mahendra : Introduction to Database and managemnet
Utsav Mahendra
 

Similar to lecture5 (1) (2).pptx (20)

Database systems introduction
Database systems introductionDatabase systems introduction
Database systems introduction
 
Mis assignment (database)
Mis assignment (database)Mis assignment (database)
Mis assignment (database)
 
Introduction of Database
Introduction of Database Introduction of Database
Introduction of Database
 
T-SQL
T-SQLT-SQL
T-SQL
 
dbms introduction.pptx
dbms introduction.pptxdbms introduction.pptx
dbms introduction.pptx
 
Types of data bases
Types of data basesTypes of data bases
Types of data bases
 
DatabaseManagementSystem.pptx
DatabaseManagementSystem.pptxDatabaseManagementSystem.pptx
DatabaseManagementSystem.pptx
 
Chapter 7. Databases Chapter In Introduction to Computer. Pptx
Chapter 7. Databases Chapter In Introduction to Computer. PptxChapter 7. Databases Chapter In Introduction to Computer. Pptx
Chapter 7. Databases Chapter In Introduction to Computer. Pptx
 
Week 1 and 2 Getting started with DBMS.pptx
Week 1 and 2 Getting started with DBMS.pptxWeek 1 and 2 Getting started with DBMS.pptx
Week 1 and 2 Getting started with DBMS.pptx
 
Info systems databases
Info systems databasesInfo systems databases
Info systems databases
 
Dbms
DbmsDbms
Dbms
 
introduction-to-dbms-unit-1.ppt
introduction-to-dbms-unit-1.pptintroduction-to-dbms-unit-1.ppt
introduction-to-dbms-unit-1.ppt
 
IM.pptx
IM.pptxIM.pptx
IM.pptx
 
BAB 7 Pangkalan data new
BAB 7   Pangkalan data newBAB 7   Pangkalan data new
BAB 7 Pangkalan data new
 
Relational Database explanation with detail.pdf
Relational Database explanation with detail.pdfRelational Database explanation with detail.pdf
Relational Database explanation with detail.pdf
 
PPT-UEU-Basis-Data-Pertemuan-1.pptx
PPT-UEU-Basis-Data-Pertemuan-1.pptxPPT-UEU-Basis-Data-Pertemuan-1.pptx
PPT-UEU-Basis-Data-Pertemuan-1.pptx
 
Utsav Mahendra : Introduction to Database and managemnet
Utsav Mahendra : Introduction to Database and managemnetUtsav Mahendra : Introduction to Database and managemnet
Utsav Mahendra : Introduction to Database and managemnet
 
DATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEMDATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEM
 
lecture 1.pdf
lecture 1.pdflecture 1.pdf
lecture 1.pdf
 
DBMS
DBMS DBMS
DBMS
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

lecture5 (1) (2).pptx

  • 2. Lecture 5 • Overview of Today’s Lecture • Fundamentals of database systems: concept, characteristic, architecture • Data models. Normalization. Data integrity restrictions • Query optimization and processing • The basics of SQL. Parallel processing of data and their recovery • Design and development of databases • Object-relational mapping (ORM) programming technology • Distributed, parallel and heterogeneous databases 1
  • 3. 2 Database What is a database ? Give examples of databases
  • 4. 3 Database What is a database ? •A collection of files storing related data Give examples of databases •Accounts database; payroll database; ENU’s students database; Amazon’s products database; airline reservation database
  • 5. 4 Database Management System What is a DBMS ? Give examples of DBMS
  • 6. 5 Database Management System What is a DBMS ? •A big C/C++ program written by someone else that allows us to manage efficiently a large database and allows it to persist over long periods of time Give examples of DBMS •DB2 (IBM), SQL Server (MS), Oracle, Sybase •MySQL, Postgres, …
  • 7. 6 What the Database Systems Does 1. Create/store large datasets 2. Search/query/update 3. Change the structure 4. Concurrent access to many user 5. Recover from crashes 6. Security
  • 8. 7 Enters a DMBS Data files Database server (someone else’s C program) Applications connection (ODBC, JDBC) “Two tier system” or “client-server”
  • 9. 8 Data Independence Directors: Movie_Directors: Movies: id fName lName 15901 Francis Ford Coppola . . . mid Title Year 130128 The Godfather 1972 . . . id mid 15901 130128 . . . Logical view Directors_file Directors_fname_index_file Moviews_title_index_file Movies_file Physical view
  • 10. What is Database ? A Database is a structured collection of data that allows people to extract information in a way that meets their needs. The data can include text, numbers, pictures: anything that can be stored in a computer; A Database a collection of data that is organized especially to be used by a computer; 9
  • 11. Database Management System (DBMS) • DBMS contains information about a particular enterprise • Collection of interrelated data • Set of programs to access the data • An environment that is both convenient and efficient to use • Database Applications: • Banking: transactions • Airlines: reservations, schedules • Universities: registration, grades • Sales: customers, products, purchases • Online retailers: order tracking, customized recommendations • Manufacturing: production, inventory, orders, supply chain • Human resources: employee records, salaries, tax deductions • Databases can be very large. • Databases touch all aspects of our lives 10
  • 12. University Database Example •Application program examples • Add new students, instructors, and courses • Register students for courses, and generate class rosters • Assign grades to students, compute grade point averages (GPA) and generate transcripts •In the early days, database applications were built directly on top of file systems 11
  • 13. What are databases used for? To store information about people, for example: • patients in a hospital • students at a school. To store information about things, for example: • cars to be sold • books in a library. To store information about events, for example: • hotel bookings • results of races. 12
  • 14. Concepts of Database •Field (Column): a single piece of information. Could be a name, or a number. In some cases, it may even be a null or empty value. •Record (Row): a collection of related fields. A number of pieces of information that relate to the same object. For example: If you keep records on an employee, you might have their name, address, social security number, phone number, etc…Each piece of the information relates back to one employee. This would be the employee’s record. •Table (File): a collection of related records. If you put all the employee records together, you have a table of employees. 13
  • 15. Table Record 1 Field 1 Field 2 Field 3 Field 4 Record 2 Field 1 Field 2 Field 3 Field 4 Record 3 Field 1 Field 2 Field 3 Field 4 Record 4 Field 1 Field 2 Field 3 Field 4 Record 5 Field 1 Field 2 Field 3 Field 4 The structure of Database 14
  • 16. Data Models •A collection of tools for describing • Data • Data relationships • Data semantics • Data constraints •Relational model •Entity-Relationship data model (mainly for database design) •Object-based data models (Object-oriented and Object-relational) •Semistructured data model (XML) •Other older models: • Network model • Hierarchical model 15
  • 17. Hierarchical model. In a hierarchical model, data is organized into an inverted tree-like structure. This structure arranges the various data elements in a hierarchy and helps to establish logical relationships among data elements of multiple files. Each unit in the model is a record which is also known as a node. Each record has a single parent. 16
  • 19. Network model. •The network model tends to store records with links to other records. Each record in the database can have multiple parents, i.e., the relationships among data elements can have a many to many relationships. So, this model is an expansion to the hierarchical structure, allowing many-to-many relationships in a tree-like structure that allows multiple parents. •The network model provides greater advantage than the hierarchical model in that it promotes greater flexibility and data accessibility. 18
  • 21. The relational model for the database management is a database model based on relations. The basic data structure of the relational model is a table where information about a particular entity (say, a student) is represented in columns and rows. The columns enumerate the various attributes (i.e. characteristics) of an entity (e.g. student name, address, registration _number). The rows (also called records) represent instances of an entity (e.g. specific student). Relational model. 20
  • 22. Relational Model • All the data is stored in various tables. • Example of tabular data in the relational model Columns Rows 21
  • 23. A Sample Relational Database 22
  • 25. •In the object oriented data model the (OODM). Both data and their relationship are contained in a single structure known us an object. •An object includes information about relationship between the facts within the object, as well as information about its relationship with other objects. •It is said to be ‘’SEMANTIC DATA MODEL’’ •The OO Data model components An object is the abstraction of the real- word entity. An object represents only one occurrence of entity. • Attributes describe the property of an object. Object-Oriented model. 24
  • 26. 25
  • 27. Normalization of databases is a process of transformation of database to the kind answering the normalized forms. Normalization 26
  • 28. Normalization In the theory of relational databases, it is accepted to distinguish four types of limitations of integrity: •Limitation of database is name a limit on values that it is let to accept to the indicated database. •Limiting to the variable of relation is name a limit on values that it is let to accept to the indicated variable of relation. •Limitation of attribute is name a limit on values that it is let to accept to the indicated attribute. •Limitation of type is not that another, as determination of great number of values this type consists of that. 27
  • 29. Data integrity restrictions Integrity of a DB doesn't guarantee reliability (truth) of the information which is contained in it, but provides at least plausibility of this information, rejecting certainly improbable, impossible values. Thus, it isn't necessary to confuse integrity (consistency) of a DB to truth of a DB. Truth and consistency — not same. 28
  • 30. Database System (DBS) A database management system (DBMS) is system software for creating and managing databases. The DBMS provides users and programmers with a systematic way to create, retrieve, update and manage data. The DBMS essentially serves as an interface between the database and end users or application programs, ensuring that data is consistently organized and remains easily accessible. 29
  • 31. Data Definition Language (DDL) • Specification notation for defining the database schema Example: create table instructor ( ID char(5), name varchar(20), dept_name varchar(20), salary numeric(8,2)) • DDL compiler generates a set of table templates stored in a data dictionary • Data dictionary contains metadata (i.e., data about data) • Database schema • Integrity constraints • Primary key (ID uniquely identifies instructors) • Authorization • Who can access what 30
  • 32. Data Manipulation Language (DML) •Language for accessing and manipulating the data organized by the appropriate data model • DML also known as query language •Two classes of languages • Pure – used for proving properties about computational power and for optimization • Relational Algebra • Tuple relational calculus • Domain relational calculus • Commercial – used in commercial systems • SQL is the most widely used commercial language 31
  • 33. The basics of SQL SQL stands for Structured Query Language. SQL is used to communicate with a database. According to ANSI (American National Standards Institute), it is the standard language for relational database management systems. SQL statements are used to perform tasks such as update data on a database, or retrieve data from a database. Some common relational database management systems that use SQL are: Oracle, Sybase, Microsoft SQL Server, Access, Ingres, etc. 32
  • 34. In the general terms, "SQL the database" is the general name for the relational database management system (RDMS). For some systems, "database" also concerns to group of tables, data, the configuration information which are essentially separate part from other, similar constructions. In this case, each installation of SQL of the database can consist of several databases. In other systems, they are mentioned as tables. The basics of SQL 33
  • 35. Here is a sample table called "weather". Weather city state high low Phoenix Arizona 105 90 Tucson Arizona 101 92 Flagstaff Arizona 88 69 San Diego California 77 60 Albuquerque New Mexico 80 72 34
  • 36. One of the major operations which are executed by data full operation is selection of the information which is stored in the database. For this purpose, the user shall execute a request (query). The basics of SQL 35
  • 37. There are four main types of requests of data in SQL which relate to so-called language of a manipulation data (DataManipulationLanguage or DML): • SELECT – to choose lines from tables; • INSERT – to add a line to the table; • UPDATE – to change lines in the table; • DELETE – to remove lines in the table; Each of these requests has different operators and functions which are used to make some dataful actions. The basics of SQL 36
  • 38. Design and development of databases Design of databases — process of creation of the database scheme and determination of necessary integrity constraints. Main objectives of design of databases: • Support of storage in a DB of all necessary information. • A data acquisition possibility on all necessary requests. • Abbreviation of redundancy and duplicating of data. • Support of integrity of the database. Main design stages of databases 37
  • 39. Object-Relational Data Models •Relational model: flat, “atomic” values •Object Relational Data Models • Extend the relational data model by including object orientation and constructs to deal with added data types. • Allow attributes of tuples to have complex types, including non-atomic values such as nested relations. • Preserve relational foundations, in particular the declarative access to data, while extending modeling power. • Provide upward compatibility with existing relational languages. 38
  • 40. Object-relational mapping (ORM) ORM or Object-relational mapping is a technology of programming which allows to transform incompatible types of models to OOP, in particular, between the data store and subjects to programming. ORM is used for simplification of process of saving objects in a relational database and their extraction, in case of this ORM itself cares for data transformation between two incompatible statuses. 39
  • 42. The majority of ORM tools considerably rely on meta data of the database and objects so objects need to know nothing about a database structure, and the database — nothing about how data are organized in the application. ORM provides complete division of tasks in well programmed applications in case of which both the database, and the application can work data full everyone in the root form. Object-relational mapping (ORM) 41
  • 43. XML: Extensible Markup Language •Defined by the WWW Consortium (W3C) •Originally intended as a document markup language not a database language •The ability to specify new tags, and to create nested tag structures made XML a great way to exchange data, not just documents •XML has become the basis for all new generation data interchange formats. •A wide variety of tools is available for parsing, browsing and querying XML documents/data 42
  • 44. Database Users and Administrators Database 43
  • 45. Database Architecture The architecture of a database systems is greatly influenced by the underlying computer system on which the database is running: •Centralized •Client-server •Parallel (multi-processor) •Distributed 44
  • 46. Distributed, parallel and heterogeneous databases A distributed database is a database in which portions of the database are stored in multiple physical locations and processing is distributed among multiple database nodes. 45
  • 48. Parallel DB Parallel database system seeks to improve performance through parallelization of various operations such as loading data ,building indexes, and evaluating queries by using multiple CPUs and Disks in Parallel. 47
  • 50. Heterogeneous database In a heterogeneous distributed database, different sites have different operating systems, DBMS products and data models. Its properties are : • Different sites use dissimilar schemas and software. • The system may be composed of a variety of DBMSs like relational, network, hierarchical or object oriented. • Query processing is complex due to dissimilar schemas. • Transaction processing is complex due to dissimilar software. • A site may not be aware of other sites and so there is limited co-operation in processing user requests. 49
  • 52. History of Database Systems •1950s and early 1960s: • Data processing using magnetic tapes for storage • Tapes provided only sequential access • Punched cards for input •Late 1960s and 1970s: • Hard disks allowed direct access to data • Network and hierarchical data models in widespread use • Ted Codd defines the relational data model • Would win the ACM Turing Award for this work • IBM Research begins System R prototype • UC Berkeley begins Ingres prototype • High-performance (for the era) transaction processing 51
  • 53. History (cont.) • 1980s: • Research relational prototypes evolve into commercial systems • SQL becomes industrial standard • Parallel and distributed database systems • Object-oriented database systems • 1990s: • Large decision support and data-mining applications • Large multi-terabyte data warehouses • Emergence of Web commerce • Early 2000s: • XML and XQuery standards • Automated database administration • Later 2000s: • Giant data storage systems • Google BigTable, Yahoo PNuts, Amazon, .. 52
  • 54. Questions: 1. Database is … 2. Database management system is … 3. Examples of DBMS 4. Types of DBMS 5. Relational DBMS 6. Concept of DBMS 53