SlideShare a Scribd company logo
2-1 2-1
Chapter 2
DataBase System Concepts and Architecture
2.1 Data Models, Schemas, and Instances
2.2 DBMS Architecture and Data Independence
2.3 Database Languages and Interfaces
2.4 The Database System Environment
2.5 Classification of Database Management Systems
2.6 Summary
Introduction to SQL
SQL is a standard language for accessing and manipulating databases.
*What is SQL?
SQL stands for Structured Query Language
SQL lets you access and manipulate databases
SQL is an ANSI (American National Standards Institute) standard
*What Can SQL do?
SQL can execute queries against a database
SQL can retrieve data from a database
SQL can insert records in a database
SQL can update records in a database
SQL can delete records from a database
SQL can create new databases
SQL can create new tables in a database
SQL can create stored procedures in a database
SQL can create views in a database
SQL can set permissions on tables, procedures, and views
SQL is a Standard - BUT....
Although SQL is an ANSI (American National Standards Institute)
standard, there are many different versions of the SQL language
2-2 2-4
Data Model: A set of concepts to describe the structure of a
database, and certain constraints that the database should obey.
‧data types
‧relationships
Provide data abstraction
Data Model Operations: Operations for specifying database
retrievals and updates by referring to the concepts of the data
model.
‧generic operation: insert, delete, modify, retrieve
‧user-defined operations
2.1 Data Models, Schemas, and Instances
2-2 2-5
2.1.1 Categories of Data Models:
- Conceptual (high-level, semantic) data models: Provide concepts that
are close to the way many users perceive data.
(Also called entity-based or object-based data models.)
‧entity ‧attribute ‧relationship
- Physical (low-level, internal) data models: Provide concepts that
describe details of how data is stored in the computer.
‧record formats ‧record ordering ‧access paths
- Implementation (record-oriented) data models: Provide concepts that
fall between the above two, balancing user views with some computer
storage details.
‧relational ‧network ‧hierarchical
2-3 2-6
2.1.2 Schemas, Instances and Database State
Database Schema (meta-data): The description of a database. Includes
descriptions of the database structure and the constraints that should hold
on the database.
Schema Diagram: A diagrammatic display of (some aspects of ) a
database schema. (refer to Fig 2.1 2-5)
Database Instance: The actual data stored in a database at a particular
moment in time. Also called database state ( or occurrence, snapshot)
(refer to Fig 1.2 2-6)
The database schema changes very infrequently. The database state
changes every time the database is updated. Schema is also called
intension, whereas state is called extension.
Each schema construct has its own current set of instances.
cf database
2-4a 2-7
Figure 2.1 Schema diagram for UNIVERSITY database
schema construct
Known data:
name of record types, data items
2-4 2-8
Figure 1.2
UNIVERSITY Database
2-3 2-9
define
empty state
initial state
load
state
update
update
valid state
satisfy database schema
2-5 2-10
2.2 DBMS Architecture and Data Independence
Proposed to support DBMS characteristics of:
- Insulation of programs and data/program and operations
(program-data and program-operation independence)
- Support of multiple views of the data.
- Use of catalog (database description)
Defines DBMS schema at three levels: (see 2-9)
- Internal schema at the internal level to describe data storage structures and access
paths. Typically uses a physical data model.
- Conceptual schema at the conceptual level to describe the structure and constraints
for the whole database. Uses a conceptual or an implementation data model.
- External schema at the external level to describe the various user views. Usually
uses the same data model as the conceptual level or high-level data model.
Mappings among schema levels are also needed. Programs refer to an external schema,
and are mapped by the DBMS to the internal schema for execution
2.2.1 Three-Schema Architecture
2-6 2-11
Figure 2.2 The Three-schema architecture 2-6
2-7 2-12
2.2.2 Data Independence
Logical Data Independence: The capacity to change the conceptual schema without
having to change the external schemas and their application programs.
Physical Data Independence: The capacity to change the internal schema without
having to change the conceptual schema.
When a schema at a lower level is changed, only the mappings between this
schema and higher-lever schemas need to be changed in a DBMS that fully supports
data independence. The higher-level schemas themselves are unchanged. Hence, the
application programs need not be changed since they refer to the external schemas.
By adding or removing a record type or data
item to
· expand the database (2-11)
· reduce the database
Reorganize physical files to improve performance
e.g. List all sections offered in Fall 1998
Disadvantages of two levels of mappings:
Overhead during compilation or execution of a query or program
2-7a 2-13
UNIVERSITY Conceptual Schema
STUDENT (Name, Student Number, Class, Major)
COURSE (Course Name, Course Number, Credit, Dept)
PREREQUISITE (Course Number, Prerequisite Number)
SECTION (Section Id, Course Number, Semester, Year, Instructor)
GRADE_REPORT(Student Number, Section Id , Grade)
UNIVERSITY External Schema
TRANSCRIPT(Student Name, Course Number, Grade, Semester, Year, Section Id)
derived from STUDENT, SECTION, GRADE_REPORT
PREREQUISITES(Course Name, Course Number, Prerequisites)
derived from PREREQUISITE, COURSE
Change GRADE-REPORT Schema Construct
GRADE_REPORT (Student Number, Student Name, Section Id, Course Number, Grade)
Change Mapping (& View Definition)
TRANSCRIPT derived from SECTION, GRADE_REPORT
2-8 2-14
2.3 Database Languages and Interfaces
Data Definition Language (DDL): Used by the DBA and database designers to
specify the conceptual schema of a database. In many DBMSs, the DDL is also
used to define internal and external schemas (views). In some DBMSs, separate
storage definition language (SDL) and view definition language (VDL) are
used to define internal and external schemas.
Data Manipulation Language (DML): Used to specify database retrievals and
updates (insertion, deletion, modifications)
- DML commands (data sublanguage) can be embedded in a general-purpose
programming language (host language).
- Alternatively, stand-alone DML commands can be applied directly (query
language).
provide appropriate languages and interfaces for each category of users.
2.3.1 DBMS Languages
DDL Compiler
2-9 2-15
Types of DML
-Procedural DML:
• Also called record-at-a-time (record-oriented) or low-level DML
• Must be embedded in a programming language.
• Searches for and retrieves individual database records and uses looping
and other constructs of the host programming language to retrieve multiple
records.
-Declarative or non-procedural DML:
• Also called set-at-a-time (set-oriented) or high-level DML.
• Can be used as a stand-alone query language or can be embedded in a
programming language.
• Searches for and retrieves information from multiple related database
records in a single command.
- host language: general-purpose language
- data sublanguage: DML
- C++
2-10 2-16
2.3.2 DBMS Interfaces
- Stand-alone query language interfaces. (casual end user)
- Programmer interfaces for embedding DML in programming
languages: (programmer)
-Pre-compiler Approach
-Procedure (Subroutine) Call Approach
- User-friendly interfaces:
-Menu-based Interfaces for Browsing.
-Forms-based Interfaces.
-Graphical User Interfaces.
-Natural language Interfaces
-Combination of the above
-Interfaces for Parametic Users (using function keys)
- Interfaces for the DBA:
-Creating accounts, granting authorizations
-Setting system parameters
-Changing schemas or access path
2-11 2-17
2.4.1 DBMS Component Modules
2.4 The Database System Environment
Figure 2.3
2-12 2-18
2.4.2 Database System Utilities
To perform certain functions such as:
- Loading data stored in files into a database. Conversion tool
- Backing up the database periodically on storage.
- File reorganizing database file structures.
- Report generation utilities.
- Performance monitoring utilities.
- Other functions, such as sorting, user monitoring,
data compression, etc.
2-12 2-19
Data dictionary utility:
- Used to store schema descriptions and other information such as design
decisions, application program descriptions, user information, usage
standards, etc. (comment)
-Active data dictionary is accessed by DBMS software and users/DBA.
-Passive data dictionary is accessed by users/DBA only.
Communications Facilities
- Allow users at locations remote from the database system site to access
the database.
DB (DBMS)/DC (Data Communication System)
2.4.3 Tools, Application Environments, and
Communications Facilities
2-13 2-20
2.5 Classification of Database Management Systems
Based on the data model used:
•Data models
-Traditional: Relational, Network (see 2-19), Hierarchical
- Emerging: Object-oriented, Semantic, Entity- Relationship, other.
Other classifications:
•Number of users : Single-user (typically used with personal computers) vs.
multi-user (most DBMSs)
•Number of sites:
Centralized (uses a single computer) vs. distributed (uses multiple computers).
Homogeneous vs. Heterogeneous
• Cost of DBMS software. $10,000~100,000
$100~3,000
•Types of access paths used. (inverted file structures, …)
•Purpose general purpose
special purpose
e.g. airline reservations, telephone directory, on-line transaction
processing system
2-14 2-21
Figure 2.4 A Network Schema
Ad

More Related Content

What's hot (20)

SQL Commands
SQL Commands SQL Commands
SQL Commands
Sachidananda M H
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
Ram Kedem
 
Types Of Join In Sql Server - Join With Example In Sql Server
Types Of Join In Sql Server - Join With Example In Sql ServerTypes Of Join In Sql Server - Join With Example In Sql Server
Types Of Join In Sql Server - Join With Example In Sql Server
programmings guru
 
SQL Queries
SQL QueriesSQL Queries
SQL Queries
Nilt1234
 
SQL JOINS
SQL JOINSSQL JOINS
SQL JOINS
Swapnali Pawar
 
Introduction to-sql
Introduction to-sqlIntroduction to-sql
Introduction to-sql
BG Java EE Course
 
Group By, Having Clause and Order By clause
Group By, Having Clause and Order By clause Group By, Having Clause and Order By clause
Group By, Having Clause and Order By clause
Deepam Aggarwal
 
Sql commands
Sql commandsSql commands
Sql commands
Balakumaran Arunachalam
 
Introduction to sql
Introduction to sqlIntroduction to sql
Introduction to sql
VARSHAKUMARI49
 
Basic SQL and History
 Basic SQL and History Basic SQL and History
Basic SQL and History
SomeshwarMoholkar
 
Mysql
MysqlMysql
Mysql
TSUBHASHRI
 
PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts
Bharat Kalia
 
Sql and Sql commands
Sql and Sql commandsSql and Sql commands
Sql and Sql commands
Knowledge Center Computer
 
Sql operators & functions 3
Sql operators & functions 3Sql operators & functions 3
Sql operators & functions 3
Dr. C.V. Suresh Babu
 
AGGREGATE FUNCTION.pptx
AGGREGATE FUNCTION.pptxAGGREGATE FUNCTION.pptx
AGGREGATE FUNCTION.pptx
Anusha sivakumar
 
SQL Views
SQL ViewsSQL Views
SQL Views
baabtra.com - No. 1 supplier of quality freshers
 
MySQL Basics
MySQL BasicsMySQL Basics
MySQL Basics
mysql content
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
baabtra.com - No. 1 supplier of quality freshers
 
Sql commands
Sql commandsSql commands
Sql commands
Prof. Dr. K. Adisesha
 
Sql subquery
Sql  subquerySql  subquery
Sql subquery
Raveena Thakur
 

Similar to Introduction to SQL (20)

Database system
Database systemDatabase system
Database system
ikjsamuel
 
Database system
Database systemDatabase system
Database system
ikjsamuel
 
Database system-DBMS
Database system-DBMSDatabase system-DBMS
Database system-DBMS
ikjsamuel
 
Database system
Database systemDatabase system
Database system
ikjsamuel
 
Chapter 2.pdfChapter 2.pdfChapter 2.pdfChapter 2.pdf
Chapter 2.pdfChapter 2.pdfChapter 2.pdfChapter 2.pdfChapter 2.pdfChapter 2.pdfChapter 2.pdfChapter 2.pdf
Chapter 2.pdfChapter 2.pdfChapter 2.pdfChapter 2.pdf
temesgenabebe1
 
Chapter02
Chapter02Chapter02
Chapter02
sasa_eldoby
 
Database Management system, database architecture unikkkkkkkkkkkkkkk
Database Management system, database architecture unikkkkkkkkkkkkkkkDatabase Management system, database architecture unikkkkkkkkkkkkkkk
Database Management system, database architecture unikkkkkkkkkkkkkkk
sandhyakiran10
 
Chapter (Two) The best lecture PowerPoint
Chapter (Two) The best lecture PowerPointChapter (Two) The best lecture PowerPoint
Chapter (Two) The best lecture PowerPoint
afendimohammed288
 
INTRODUCTION TO DATABASE
INTRODUCTION TO DATABASEINTRODUCTION TO DATABASE
INTRODUCTION TO DATABASE
Muhammad Bilal Tariq
 
Db architecture
Db architectureDb architecture
Db architecture
Mr Patrick NIYISHAKA
 
Fundamentals of database system - Database System Concepts and Architecture
Fundamentals of database system - Database System Concepts and ArchitectureFundamentals of database system - Database System Concepts and Architecture
Fundamentals of database system - Database System Concepts and Architecture
Mustafa Kamel Mohammadi
 
Lec02_Database System Concepts and Architecture_part1.pptx
Lec02_Database System Concepts and Architecture_part1.pptxLec02_Database System Concepts and Architecture_part1.pptx
Lec02_Database System Concepts and Architecture_part1.pptx
AhmedSalama337512
 
ch02-Database System Concepts and Architecture.ppt
ch02-Database System Concepts and Architecture.pptch02-Database System Concepts and Architecture.ppt
ch02-Database System Concepts and Architecture.ppt
vivekananda34
 
DATABASE FUNCTIONS
DATABASE FUNCTIONSDATABASE FUNCTIONS
DATABASE FUNCTIONS
ghazi103
 
Database concepts and Archeticture Ch2 with in class Activities
Database concepts and Archeticture Ch2 with in class ActivitiesDatabase concepts and Archeticture Ch2 with in class Activities
Database concepts and Archeticture Ch2 with in class Activities
Zainab Almugbel
 
BM322_03.pptx123456786546654525165654646564
BM322_03.pptx123456786546654525165654646564BM322_03.pptx123456786546654525165654646564
BM322_03.pptx123456786546654525165654646564
DrMoizAkhtar
 
Database Design Slide 1
Database Design Slide 1Database Design Slide 1
Database Design Slide 1
ahfiki
 
2 database system concepts and architecture
2 database system concepts and architecture2 database system concepts and architecture
2 database system concepts and architecture
Kumar
 
Dbms module i
Dbms module iDbms module i
Dbms module i
SANTOSH RATH
 
2nd chapter dbms.pptx
2nd chapter dbms.pptx2nd chapter dbms.pptx
2nd chapter dbms.pptx
kavitha623544
 
Database system
Database systemDatabase system
Database system
ikjsamuel
 
Database system
Database systemDatabase system
Database system
ikjsamuel
 
Database system-DBMS
Database system-DBMSDatabase system-DBMS
Database system-DBMS
ikjsamuel
 
Database system
Database systemDatabase system
Database system
ikjsamuel
 
Chapter 2.pdfChapter 2.pdfChapter 2.pdfChapter 2.pdf
Chapter 2.pdfChapter 2.pdfChapter 2.pdfChapter 2.pdfChapter 2.pdfChapter 2.pdfChapter 2.pdfChapter 2.pdf
Chapter 2.pdfChapter 2.pdfChapter 2.pdfChapter 2.pdf
temesgenabebe1
 
Database Management system, database architecture unikkkkkkkkkkkkkkk
Database Management system, database architecture unikkkkkkkkkkkkkkkDatabase Management system, database architecture unikkkkkkkkkkkkkkk
Database Management system, database architecture unikkkkkkkkkkkkkkk
sandhyakiran10
 
Chapter (Two) The best lecture PowerPoint
Chapter (Two) The best lecture PowerPointChapter (Two) The best lecture PowerPoint
Chapter (Two) The best lecture PowerPoint
afendimohammed288
 
Fundamentals of database system - Database System Concepts and Architecture
Fundamentals of database system - Database System Concepts and ArchitectureFundamentals of database system - Database System Concepts and Architecture
Fundamentals of database system - Database System Concepts and Architecture
Mustafa Kamel Mohammadi
 
Lec02_Database System Concepts and Architecture_part1.pptx
Lec02_Database System Concepts and Architecture_part1.pptxLec02_Database System Concepts and Architecture_part1.pptx
Lec02_Database System Concepts and Architecture_part1.pptx
AhmedSalama337512
 
ch02-Database System Concepts and Architecture.ppt
ch02-Database System Concepts and Architecture.pptch02-Database System Concepts and Architecture.ppt
ch02-Database System Concepts and Architecture.ppt
vivekananda34
 
DATABASE FUNCTIONS
DATABASE FUNCTIONSDATABASE FUNCTIONS
DATABASE FUNCTIONS
ghazi103
 
Database concepts and Archeticture Ch2 with in class Activities
Database concepts and Archeticture Ch2 with in class ActivitiesDatabase concepts and Archeticture Ch2 with in class Activities
Database concepts and Archeticture Ch2 with in class Activities
Zainab Almugbel
 
BM322_03.pptx123456786546654525165654646564
BM322_03.pptx123456786546654525165654646564BM322_03.pptx123456786546654525165654646564
BM322_03.pptx123456786546654525165654646564
DrMoizAkhtar
 
Database Design Slide 1
Database Design Slide 1Database Design Slide 1
Database Design Slide 1
ahfiki
 
2 database system concepts and architecture
2 database system concepts and architecture2 database system concepts and architecture
2 database system concepts and architecture
Kumar
 
2nd chapter dbms.pptx
2nd chapter dbms.pptx2nd chapter dbms.pptx
2nd chapter dbms.pptx
kavitha623544
 
Ad

More from Dr. Thippeswamy S. (19)

Bacterial Examination of Water of different sources.ppt
Bacterial Examination of Water of different sources.pptBacterial Examination of Water of different sources.ppt
Bacterial Examination of Water of different sources.ppt
Dr. Thippeswamy S.
 
Seven QC Tools New approach.pptx
Seven QC Tools New approach.pptxSeven QC Tools New approach.pptx
Seven QC Tools New approach.pptx
Dr. Thippeswamy S.
 
Soil Erosion.pptx
Soil Erosion.pptxSoil Erosion.pptx
Soil Erosion.pptx
Dr. Thippeswamy S.
 
Database Normalization.pptx
Database Normalization.pptxDatabase Normalization.pptx
Database Normalization.pptx
Dr. Thippeswamy S.
 
cloudapplications.pptx
cloudapplications.pptxcloudapplications.pptx
cloudapplications.pptx
Dr. Thippeswamy S.
 
12575474.ppt
12575474.ppt12575474.ppt
12575474.ppt
Dr. Thippeswamy S.
 
djypllh5r1gjbaekxgwv-signature-cc6692615bbc55079760b9b0c6636bc58ec509cd0446cb...
djypllh5r1gjbaekxgwv-signature-cc6692615bbc55079760b9b0c6636bc58ec509cd0446cb...djypllh5r1gjbaekxgwv-signature-cc6692615bbc55079760b9b0c6636bc58ec509cd0446cb...
djypllh5r1gjbaekxgwv-signature-cc6692615bbc55079760b9b0c6636bc58ec509cd0446cb...
Dr. Thippeswamy S.
 
deploymentmodelsofcloudcomputing-230211123637-08174981.pptx
deploymentmodelsofcloudcomputing-230211123637-08174981.pptxdeploymentmodelsofcloudcomputing-230211123637-08174981.pptx
deploymentmodelsofcloudcomputing-230211123637-08174981.pptx
Dr. Thippeswamy S.
 
DBMS.pptx
DBMS.pptxDBMS.pptx
DBMS.pptx
Dr. Thippeswamy S.
 
Normalization DBMS.ppt
Normalization DBMS.pptNormalization DBMS.ppt
Normalization DBMS.ppt
Dr. Thippeswamy S.
 
Normalization Alg.ppt
Normalization Alg.pptNormalization Alg.ppt
Normalization Alg.ppt
Dr. Thippeswamy S.
 
introduction to matlab.pptx
introduction to matlab.pptxintroduction to matlab.pptx
introduction to matlab.pptx
Dr. Thippeswamy S.
 
Conceptual Data Modeling
Conceptual Data ModelingConceptual Data Modeling
Conceptual Data Modeling
Dr. Thippeswamy S.
 
Chp-1.pptx
Chp-1.pptxChp-1.pptx
Chp-1.pptx
Dr. Thippeswamy S.
 
Mod-2.pptx
Mod-2.pptxMod-2.pptx
Mod-2.pptx
Dr. Thippeswamy S.
 
module 5.1.pptx
module 5.1.pptxmodule 5.1.pptx
module 5.1.pptx
Dr. Thippeswamy S.
 
module 5.pptx
module 5.pptxmodule 5.pptx
module 5.pptx
Dr. Thippeswamy S.
 
Module 2 (1).pptx
Module 2 (1).pptxModule 2 (1).pptx
Module 2 (1).pptx
Dr. Thippeswamy S.
 
23. Journal of Mycology and Plant pathology.pdf
23. Journal of Mycology and Plant pathology.pdf23. Journal of Mycology and Plant pathology.pdf
23. Journal of Mycology and Plant pathology.pdf
Dr. Thippeswamy S.
 
Ad

Recently uploaded (20)

QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)
Vəhid Gəruslu
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
introduction to machine learining for beginers
introduction to machine learining for beginersintroduction to machine learining for beginers
introduction to machine learining for beginers
JoydebSheet
 
some basics electrical and electronics knowledge
some basics electrical and electronics knowledgesome basics electrical and electronics knowledge
some basics electrical and electronics knowledge
nguyentrungdo88
 
The Gaussian Process Modeling Module in UQLab
The Gaussian Process Modeling Module in UQLabThe Gaussian Process Modeling Module in UQLab
The Gaussian Process Modeling Module in UQLab
Journal of Soft Computing in Civil Engineering
 
ELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdfELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdf
Shiju Jacob
 
Introduction to FLUID MECHANICS & KINEMATICS
Introduction to FLUID MECHANICS &  KINEMATICSIntroduction to FLUID MECHANICS &  KINEMATICS
Introduction to FLUID MECHANICS & KINEMATICS
narayanaswamygdas
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptxLidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
RishavKumar530754
 
"Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G...
"Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G..."Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G...
"Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G...
Infopitaara
 
Avnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights FlyerAvnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights Flyer
WillDavies22
 
Level 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical SafetyLevel 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical Safety
JoseAlbertoCariasDel
 
new ppt artificial intelligence historyyy
new ppt artificial intelligence historyyynew ppt artificial intelligence historyyy
new ppt artificial intelligence historyyy
PianoPianist
 
Metal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistryMetal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistry
mee23nu
 
Degree_of_Automation.pdf for Instrumentation and industrial specialist
Degree_of_Automation.pdf for  Instrumentation  and industrial specialistDegree_of_Automation.pdf for  Instrumentation  and industrial specialist
Degree_of_Automation.pdf for Instrumentation and industrial specialist
shreyabhosale19
 
Value Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous SecurityValue Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous Security
Marc Hornbeek
 
fluke dealers in bangalore..............
fluke dealers in bangalore..............fluke dealers in bangalore..............
fluke dealers in bangalore..............
Haresh Vaswani
 
Oil-gas_Unconventional oil and gass_reseviours.pdf
Oil-gas_Unconventional oil and gass_reseviours.pdfOil-gas_Unconventional oil and gass_reseviours.pdf
Oil-gas_Unconventional oil and gass_reseviours.pdf
M7md3li2
 
Data Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptxData Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptx
RushaliDeshmukh2
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)
Vəhid Gəruslu
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
introduction to machine learining for beginers
introduction to machine learining for beginersintroduction to machine learining for beginers
introduction to machine learining for beginers
JoydebSheet
 
some basics electrical and electronics knowledge
some basics electrical and electronics knowledgesome basics electrical and electronics knowledge
some basics electrical and electronics knowledge
nguyentrungdo88
 
ELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdfELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdf
Shiju Jacob
 
Introduction to FLUID MECHANICS & KINEMATICS
Introduction to FLUID MECHANICS &  KINEMATICSIntroduction to FLUID MECHANICS &  KINEMATICS
Introduction to FLUID MECHANICS & KINEMATICS
narayanaswamygdas
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptxLidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
RishavKumar530754
 
"Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G...
"Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G..."Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G...
"Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G...
Infopitaara
 
Avnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights FlyerAvnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights Flyer
WillDavies22
 
Level 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical SafetyLevel 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical Safety
JoseAlbertoCariasDel
 
new ppt artificial intelligence historyyy
new ppt artificial intelligence historyyynew ppt artificial intelligence historyyy
new ppt artificial intelligence historyyy
PianoPianist
 
Metal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistryMetal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistry
mee23nu
 
Degree_of_Automation.pdf for Instrumentation and industrial specialist
Degree_of_Automation.pdf for  Instrumentation  and industrial specialistDegree_of_Automation.pdf for  Instrumentation  and industrial specialist
Degree_of_Automation.pdf for Instrumentation and industrial specialist
shreyabhosale19
 
Value Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous SecurityValue Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous Security
Marc Hornbeek
 
fluke dealers in bangalore..............
fluke dealers in bangalore..............fluke dealers in bangalore..............
fluke dealers in bangalore..............
Haresh Vaswani
 
Oil-gas_Unconventional oil and gass_reseviours.pdf
Oil-gas_Unconventional oil and gass_reseviours.pdfOil-gas_Unconventional oil and gass_reseviours.pdf
Oil-gas_Unconventional oil and gass_reseviours.pdf
M7md3li2
 
Data Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptxData Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptx
RushaliDeshmukh2
 

Introduction to SQL

  • 1. 2-1 2-1 Chapter 2 DataBase System Concepts and Architecture 2.1 Data Models, Schemas, and Instances 2.2 DBMS Architecture and Data Independence 2.3 Database Languages and Interfaces 2.4 The Database System Environment 2.5 Classification of Database Management Systems 2.6 Summary
  • 2. Introduction to SQL SQL is a standard language for accessing and manipulating databases. *What is SQL? SQL stands for Structured Query Language SQL lets you access and manipulate databases SQL is an ANSI (American National Standards Institute) standard *What Can SQL do? SQL can execute queries against a database SQL can retrieve data from a database SQL can insert records in a database SQL can update records in a database SQL can delete records from a database SQL can create new databases SQL can create new tables in a database SQL can create stored procedures in a database
  • 3. SQL can create views in a database SQL can set permissions on tables, procedures, and views SQL is a Standard - BUT.... Although SQL is an ANSI (American National Standards Institute) standard, there are many different versions of the SQL language
  • 4. 2-2 2-4 Data Model: A set of concepts to describe the structure of a database, and certain constraints that the database should obey. ‧data types ‧relationships Provide data abstraction Data Model Operations: Operations for specifying database retrievals and updates by referring to the concepts of the data model. ‧generic operation: insert, delete, modify, retrieve ‧user-defined operations 2.1 Data Models, Schemas, and Instances
  • 5. 2-2 2-5 2.1.1 Categories of Data Models: - Conceptual (high-level, semantic) data models: Provide concepts that are close to the way many users perceive data. (Also called entity-based or object-based data models.) ‧entity ‧attribute ‧relationship - Physical (low-level, internal) data models: Provide concepts that describe details of how data is stored in the computer. ‧record formats ‧record ordering ‧access paths - Implementation (record-oriented) data models: Provide concepts that fall between the above two, balancing user views with some computer storage details. ‧relational ‧network ‧hierarchical
  • 6. 2-3 2-6 2.1.2 Schemas, Instances and Database State Database Schema (meta-data): The description of a database. Includes descriptions of the database structure and the constraints that should hold on the database. Schema Diagram: A diagrammatic display of (some aspects of ) a database schema. (refer to Fig 2.1 2-5) Database Instance: The actual data stored in a database at a particular moment in time. Also called database state ( or occurrence, snapshot) (refer to Fig 1.2 2-6) The database schema changes very infrequently. The database state changes every time the database is updated. Schema is also called intension, whereas state is called extension. Each schema construct has its own current set of instances. cf database
  • 7. 2-4a 2-7 Figure 2.1 Schema diagram for UNIVERSITY database schema construct Known data: name of record types, data items
  • 9. 2-3 2-9 define empty state initial state load state update update valid state satisfy database schema
  • 10. 2-5 2-10 2.2 DBMS Architecture and Data Independence Proposed to support DBMS characteristics of: - Insulation of programs and data/program and operations (program-data and program-operation independence) - Support of multiple views of the data. - Use of catalog (database description) Defines DBMS schema at three levels: (see 2-9) - Internal schema at the internal level to describe data storage structures and access paths. Typically uses a physical data model. - Conceptual schema at the conceptual level to describe the structure and constraints for the whole database. Uses a conceptual or an implementation data model. - External schema at the external level to describe the various user views. Usually uses the same data model as the conceptual level or high-level data model. Mappings among schema levels are also needed. Programs refer to an external schema, and are mapped by the DBMS to the internal schema for execution 2.2.1 Three-Schema Architecture
  • 11. 2-6 2-11 Figure 2.2 The Three-schema architecture 2-6
  • 12. 2-7 2-12 2.2.2 Data Independence Logical Data Independence: The capacity to change the conceptual schema without having to change the external schemas and their application programs. Physical Data Independence: The capacity to change the internal schema without having to change the conceptual schema. When a schema at a lower level is changed, only the mappings between this schema and higher-lever schemas need to be changed in a DBMS that fully supports data independence. The higher-level schemas themselves are unchanged. Hence, the application programs need not be changed since they refer to the external schemas. By adding or removing a record type or data item to · expand the database (2-11) · reduce the database Reorganize physical files to improve performance e.g. List all sections offered in Fall 1998 Disadvantages of two levels of mappings: Overhead during compilation or execution of a query or program
  • 13. 2-7a 2-13 UNIVERSITY Conceptual Schema STUDENT (Name, Student Number, Class, Major) COURSE (Course Name, Course Number, Credit, Dept) PREREQUISITE (Course Number, Prerequisite Number) SECTION (Section Id, Course Number, Semester, Year, Instructor) GRADE_REPORT(Student Number, Section Id , Grade) UNIVERSITY External Schema TRANSCRIPT(Student Name, Course Number, Grade, Semester, Year, Section Id) derived from STUDENT, SECTION, GRADE_REPORT PREREQUISITES(Course Name, Course Number, Prerequisites) derived from PREREQUISITE, COURSE Change GRADE-REPORT Schema Construct GRADE_REPORT (Student Number, Student Name, Section Id, Course Number, Grade) Change Mapping (& View Definition) TRANSCRIPT derived from SECTION, GRADE_REPORT
  • 14. 2-8 2-14 2.3 Database Languages and Interfaces Data Definition Language (DDL): Used by the DBA and database designers to specify the conceptual schema of a database. In many DBMSs, the DDL is also used to define internal and external schemas (views). In some DBMSs, separate storage definition language (SDL) and view definition language (VDL) are used to define internal and external schemas. Data Manipulation Language (DML): Used to specify database retrievals and updates (insertion, deletion, modifications) - DML commands (data sublanguage) can be embedded in a general-purpose programming language (host language). - Alternatively, stand-alone DML commands can be applied directly (query language). provide appropriate languages and interfaces for each category of users. 2.3.1 DBMS Languages DDL Compiler
  • 15. 2-9 2-15 Types of DML -Procedural DML: • Also called record-at-a-time (record-oriented) or low-level DML • Must be embedded in a programming language. • Searches for and retrieves individual database records and uses looping and other constructs of the host programming language to retrieve multiple records. -Declarative or non-procedural DML: • Also called set-at-a-time (set-oriented) or high-level DML. • Can be used as a stand-alone query language or can be embedded in a programming language. • Searches for and retrieves information from multiple related database records in a single command. - host language: general-purpose language - data sublanguage: DML - C++
  • 16. 2-10 2-16 2.3.2 DBMS Interfaces - Stand-alone query language interfaces. (casual end user) - Programmer interfaces for embedding DML in programming languages: (programmer) -Pre-compiler Approach -Procedure (Subroutine) Call Approach - User-friendly interfaces: -Menu-based Interfaces for Browsing. -Forms-based Interfaces. -Graphical User Interfaces. -Natural language Interfaces -Combination of the above -Interfaces for Parametic Users (using function keys) - Interfaces for the DBA: -Creating accounts, granting authorizations -Setting system parameters -Changing schemas or access path
  • 17. 2-11 2-17 2.4.1 DBMS Component Modules 2.4 The Database System Environment Figure 2.3
  • 18. 2-12 2-18 2.4.2 Database System Utilities To perform certain functions such as: - Loading data stored in files into a database. Conversion tool - Backing up the database periodically on storage. - File reorganizing database file structures. - Report generation utilities. - Performance monitoring utilities. - Other functions, such as sorting, user monitoring, data compression, etc.
  • 19. 2-12 2-19 Data dictionary utility: - Used to store schema descriptions and other information such as design decisions, application program descriptions, user information, usage standards, etc. (comment) -Active data dictionary is accessed by DBMS software and users/DBA. -Passive data dictionary is accessed by users/DBA only. Communications Facilities - Allow users at locations remote from the database system site to access the database. DB (DBMS)/DC (Data Communication System) 2.4.3 Tools, Application Environments, and Communications Facilities
  • 20. 2-13 2-20 2.5 Classification of Database Management Systems Based on the data model used: •Data models -Traditional: Relational, Network (see 2-19), Hierarchical - Emerging: Object-oriented, Semantic, Entity- Relationship, other. Other classifications: •Number of users : Single-user (typically used with personal computers) vs. multi-user (most DBMSs) •Number of sites: Centralized (uses a single computer) vs. distributed (uses multiple computers). Homogeneous vs. Heterogeneous • Cost of DBMS software. $10,000~100,000 $100~3,000 •Types of access paths used. (inverted file structures, …) •Purpose general purpose special purpose e.g. airline reservations, telephone directory, on-line transaction processing system
  • 21. 2-14 2-21 Figure 2.4 A Network Schema