SlideShare a Scribd company logo
1
INTRODUCTION
lecture1
2
Data base concept
• Data is a meaningless static value. What does 3421 means?
• Information is the data you process in a manner that makes it meaningful.
Information can be provided only if proper data exists.
• A database (DB) is a collection of related persistent data. Can be generated &
maintained manually or automatically
• Data is what you store in database.
• Information is what you retrieve from a database.
• A database application is a collection of data and the programs that allow the
manipulation of these data to meet the information needs of an enterprise
Database Properties
3
 Represents the real world
 Logically coherent collection of data.
 Designed, built, populated with data for a specific purpose. It has an intended
group of users and their applications.
 Can be of any size and any degree of complexity.
 Can be generated and maintained manually or using a computer.
A computerized DB can be created by:
 A Group of application programs
 Or by Database Management System (DBMS)
•DBMS is a collection of programs that enables users to create, maintain
and use a database.
• Facilitates the process of:
• Defining: specifying data types, structures, & constraints for data.
• Manipulating: querying the database to retrieve or update data
and generating reports from the data.
• Sharing: accessing the database concurrently.
• Protects the database and maintains it over a long period of time.
• Examples: Oracle, MS Access, DB2, Informix, MySQL, SyBase.
What is Database Management System (DBMS)
?
4
• Banking: all transactions.
• Hotels: reservation.
• Airlines: reservation, schedules.
• Libraries: catalog.
• Universities: registration, grades.
• Sales: customers, products, purchases.
• Manufacturing: production, inventory, orders.
• Human resources: employee records, salaries.
Examples of Databases
5
Database System (DBS) Environment
6
Database
Meta-Data
Data Access
Query Process
Application Programs
DBMS
DBS
Database System = Database + DBMS
User
7
Database Models
• Hirarichal:
• This model has a parent–child structure that is similar to an inverted tree,
which is what forms the hierarchy, A parent node can have many child
nodes, but a child node can have only one parent node
8
9
Database Models
• Network:
• Data is organized in record types, the logical equivalent of tables in
a relational database. Like the hierarchical model, the network
model uses an inverted tree structure, but record types are
organized into a set structure that relates pairs of record types into
owners and members. Any one record type can participate in any
set with other record types in the database
Database Models
• Relational :
• the structure of the relational database is based on the relation, or table,
along with the ability to define complex relationships between these
relations. Each relation can be accessed directly
• At the core of the relational model is the relation. A relation is a set of
columns and rows collected in a table-like structure that represents a
single entity made up of related data.
10
Normalization
• Normalization defines sets of rules, referred to as normal forms, which
provide specific guidelines on how data should be organized in order to avoid
anomalies that lead to inconsistencies in and loss of data as the data stored
in the database is maintained.
• 1NF, 2NF, 3NF
11
12
Operations of the Relational Model
• Updates: changes the database’s state.
• Insert
• Delete
• Update/modify
• Retrievals: does not change the current state of the database.
Operations of the Relational Model
• Integrity constraints should not be violated by the update operations.
• Several update operations may have to be grouped together.
• Updates may propagate to cause other updates automatically. This may be
necessary to maintain integrity constraints.
13
14
The Insert Operation
• This operation can violate all constraints of the relation. How?
• Domain constraint: attribute value does not appear in the corresponding
domain.
• Key constraint: if the key value already exist in another tuple.
• Entity integrity: if the PK of the new tuple is NULL
• Referential integrity: if any value of the FK refers to a tuple that does not
exist in the other relation.
15
The Delete Operation
• This operation can violate only the referential integrity constraint. How?
• E.g: you can not delete a course that many students study in already.
16
The Update Operation
• The new value must be of the correct data type and
domain.
Update Operations on Relations
• In case of integrity violation, several actions can be taken:
• Cancel the operation that causes the violation (REJECT option)
• Perform the operation but inform the user of the violation
• Trigger additional updates so the violation is corrected (CASCADE
option, SET NULL option)
•
Execute a user-specified error-correction routine
18
SQL .. An Overview
Overview of SQL
19
 Query: allow questions to be asked of the data and display only the
information required. It can include info from more the one table
 Why Query language?
A Database Management system enable users to access and manipulate
data using queries.
 Structured Query Language (SQL): is the language used by most relational
database systems.
Features of SQL
20
 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
Features of SQL
21
 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
Features of SQL
22
 What Makes SQL Special?
 SQL is an English-like language. It uses words such as select, insert,
delete as part of its command set
 SQL is a non-procedural language: you specify What information you
require, not how to get it . This feature makes it easier for you to
concentrate on obtaining the desired result.
 SQL Processes sets of records rather than a single record at a time.
 SQL can be used by a range of users including DBA’s, programmers,
Management Personnel, and many other types of end users
Types of SQL Statements
23
 Data Definition Language (DDL):
Commands that define a database.
E.g. CREATE, ALTER, DROP, ...etc.
 Data manipulation language (DML):
Commands that maintain and query a database.
E.g. SELECT, INSERT, UPDATE, DELETE.
 Data Control Language (DCL):
Commands that control a database, including administering
privileges and committing data.
E.g. CONNECT, GRANT, REVOKE, ...etc.
24
SQL is relatively easy to learn
:
• it is non-procedural - you specify what information you require, rather
than how to get it;
• it is essentially free-format - some sentences do not have to be typed at
particular location on screen.
Writing SQL Commands
25
• SQL commands maybe one or more lines
• Command words cannot be split across lines
• SQL Commands are not case sensitive
• Place a semi –colon(;) at the end of last clause.
26
Both give the same result
not case sensitive
)

More Related Content

Similar to data base programming chapter1 26 slides (20)

PPTX
Presentation on Database management system
Prerana Bhattarai
 
PDF
Database management systems Lecture Notes
Sreedhar Chowdam
 
PPTX
Chapter 1 Database Systems______________.pptx
bestboybulshaawi
 
PDF
DBMS 1.pdf from computer application for business
sudeshnachand
 
PPTX
CHAPTER 1 Database system architecture.pptx
kashishy2
 
PPTX
Utsav Mahendra : Introduction to Database and managemnet
Utsav Mahendra
 
PPT
DBMS ACCESS programming and learning .ppt
MANISH169648
 
PPTX
Week 1 and 2 Getting started with DBMS.pptx
Riannel Tecson
 
PPTX
01-database-management.pptx
dhanajimirajkar1
 
PPT
This discussion about the dbms introduction
rishabsharma1509
 
PPTX
DATABASE MANAGEMENT SYSTEMS PPT .pptx
YogeshGarg228050
 
PPTX
CS3270 - DATABASE SYSTEM - Lecture (1)
Dilawar Khan
 
PDF
Lecture#5
TolganayAnarbekova
 
PPTX
Chapter 1 Database Systems.pptx
MaxamedAbiib1
 
PPTX
Department of Computer Science and Applications 1.pptx
panghaldharmender459
 
PPTX
Introduction to Database Management Systems
Adri Jovin
 
PDF
01-Database Administration and Management.pdf
TOUSEEQHAIDER14
 
PPTX
Database management system (part 1)
KavithaA19
 
PDF
APznzaa8jyCqEfOzIXqwAqxTBkpfxFd1OHN5G6XprVbamkoLUf3KcvZywfO4T71wgjvmg7lDxEuM5...
prabhdeeprai46
 
PDF
SQL EXCLUSIVE NOTES .pdf
NiravPanchal50
 
Presentation on Database management system
Prerana Bhattarai
 
Database management systems Lecture Notes
Sreedhar Chowdam
 
Chapter 1 Database Systems______________.pptx
bestboybulshaawi
 
DBMS 1.pdf from computer application for business
sudeshnachand
 
CHAPTER 1 Database system architecture.pptx
kashishy2
 
Utsav Mahendra : Introduction to Database and managemnet
Utsav Mahendra
 
DBMS ACCESS programming and learning .ppt
MANISH169648
 
Week 1 and 2 Getting started with DBMS.pptx
Riannel Tecson
 
01-database-management.pptx
dhanajimirajkar1
 
This discussion about the dbms introduction
rishabsharma1509
 
DATABASE MANAGEMENT SYSTEMS PPT .pptx
YogeshGarg228050
 
CS3270 - DATABASE SYSTEM - Lecture (1)
Dilawar Khan
 
Chapter 1 Database Systems.pptx
MaxamedAbiib1
 
Department of Computer Science and Applications 1.pptx
panghaldharmender459
 
Introduction to Database Management Systems
Adri Jovin
 
01-Database Administration and Management.pdf
TOUSEEQHAIDER14
 
Database management system (part 1)
KavithaA19
 
APznzaa8jyCqEfOzIXqwAqxTBkpfxFd1OHN5G6XprVbamkoLUf3KcvZywfO4T71wgjvmg7lDxEuM5...
prabhdeeprai46
 
SQL EXCLUSIVE NOTES .pdf
NiravPanchal50
 

Recently uploaded (20)

PDF
Choosing the Right Database for Indexing.pdf
Tamanna
 
PDF
How to Connect Your On-Premises Site to AWS Using Site-to-Site VPN.pdf
Tamanna
 
PPTX
apidays Helsinki & North 2025 - API access control strategies beyond JWT bear...
apidays
 
PPTX
Module-5-Measures-of-Central-Tendency-Grouped-Data-1.pptx
lacsonjhoma0407
 
PDF
The European Business Wallet: Why It Matters and How It Powers the EUDI Ecosy...
Lal Chandran
 
PPTX
ER_Model_with_Diagrams_Presentation.pptx
dharaadhvaryu1992
 
PPTX
apidays Helsinki & North 2025 - Agentic AI: A Friend or Foe?, Merja Kajava (A...
apidays
 
PPTX
apidays Helsinki & North 2025 - Running a Successful API Program: Best Practi...
apidays
 
PPTX
apidays Singapore 2025 - Designing for Change, Julie Schiller (Google)
apidays
 
PDF
Driving Employee Engagement in a Hybrid World.pdf
Mia scott
 
PPTX
Numbers of a nation: how we estimate population statistics | Accessible slides
Office for National Statistics
 
PDF
OPPOTUS - Malaysias on Malaysia 1Q2025.pdf
Oppotus
 
PDF
apidays Helsinki & North 2025 - REST in Peace? Hunting the Dominant Design fo...
apidays
 
PDF
apidays Helsinki & North 2025 - API-Powered Journeys: Mobility in an API-Driv...
apidays
 
PDF
apidays Helsinki & North 2025 - Monetizing AI APIs: The New API Economy, Alla...
apidays
 
PDF
R Cookbook - Processing and Manipulating Geological spatial data with R.pdf
OtnielSimopiaref2
 
PPTX
apidays Munich 2025 - Building an AWS Serverless Application with Terraform, ...
apidays
 
PPTX
Listify-Intelligent-Voice-to-Catalog-Agent.pptx
nareshkottees
 
PPTX
AI Presentation Tool Pitch Deck Presentation.pptx
ShyamPanthavoor1
 
PPTX
b6057ea5-8e8c-4415-90c0-ed8e9666ffcd.pptx
Anees487379
 
Choosing the Right Database for Indexing.pdf
Tamanna
 
How to Connect Your On-Premises Site to AWS Using Site-to-Site VPN.pdf
Tamanna
 
apidays Helsinki & North 2025 - API access control strategies beyond JWT bear...
apidays
 
Module-5-Measures-of-Central-Tendency-Grouped-Data-1.pptx
lacsonjhoma0407
 
The European Business Wallet: Why It Matters and How It Powers the EUDI Ecosy...
Lal Chandran
 
ER_Model_with_Diagrams_Presentation.pptx
dharaadhvaryu1992
 
apidays Helsinki & North 2025 - Agentic AI: A Friend or Foe?, Merja Kajava (A...
apidays
 
apidays Helsinki & North 2025 - Running a Successful API Program: Best Practi...
apidays
 
apidays Singapore 2025 - Designing for Change, Julie Schiller (Google)
apidays
 
Driving Employee Engagement in a Hybrid World.pdf
Mia scott
 
Numbers of a nation: how we estimate population statistics | Accessible slides
Office for National Statistics
 
OPPOTUS - Malaysias on Malaysia 1Q2025.pdf
Oppotus
 
apidays Helsinki & North 2025 - REST in Peace? Hunting the Dominant Design fo...
apidays
 
apidays Helsinki & North 2025 - API-Powered Journeys: Mobility in an API-Driv...
apidays
 
apidays Helsinki & North 2025 - Monetizing AI APIs: The New API Economy, Alla...
apidays
 
R Cookbook - Processing and Manipulating Geological spatial data with R.pdf
OtnielSimopiaref2
 
apidays Munich 2025 - Building an AWS Serverless Application with Terraform, ...
apidays
 
Listify-Intelligent-Voice-to-Catalog-Agent.pptx
nareshkottees
 
AI Presentation Tool Pitch Deck Presentation.pptx
ShyamPanthavoor1
 
b6057ea5-8e8c-4415-90c0-ed8e9666ffcd.pptx
Anees487379
 
Ad

data base programming chapter1 26 slides

  • 2. 2 Data base concept • Data is a meaningless static value. What does 3421 means? • Information is the data you process in a manner that makes it meaningful. Information can be provided only if proper data exists. • A database (DB) is a collection of related persistent data. Can be generated & maintained manually or automatically • Data is what you store in database. • Information is what you retrieve from a database. • A database application is a collection of data and the programs that allow the manipulation of these data to meet the information needs of an enterprise
  • 3. Database Properties 3  Represents the real world  Logically coherent collection of data.  Designed, built, populated with data for a specific purpose. It has an intended group of users and their applications.  Can be of any size and any degree of complexity.  Can be generated and maintained manually or using a computer. A computerized DB can be created by:  A Group of application programs  Or by Database Management System (DBMS)
  • 4. •DBMS is a collection of programs that enables users to create, maintain and use a database. • Facilitates the process of: • Defining: specifying data types, structures, & constraints for data. • Manipulating: querying the database to retrieve or update data and generating reports from the data. • Sharing: accessing the database concurrently. • Protects the database and maintains it over a long period of time. • Examples: Oracle, MS Access, DB2, Informix, MySQL, SyBase. What is Database Management System (DBMS) ? 4
  • 5. • Banking: all transactions. • Hotels: reservation. • Airlines: reservation, schedules. • Libraries: catalog. • Universities: registration, grades. • Sales: customers, products, purchases. • Manufacturing: production, inventory, orders. • Human resources: employee records, salaries. Examples of Databases 5
  • 6. Database System (DBS) Environment 6 Database Meta-Data Data Access Query Process Application Programs DBMS DBS Database System = Database + DBMS User
  • 7. 7
  • 8. Database Models • Hirarichal: • This model has a parent–child structure that is similar to an inverted tree, which is what forms the hierarchy, A parent node can have many child nodes, but a child node can have only one parent node 8
  • 9. 9 Database Models • Network: • Data is organized in record types, the logical equivalent of tables in a relational database. Like the hierarchical model, the network model uses an inverted tree structure, but record types are organized into a set structure that relates pairs of record types into owners and members. Any one record type can participate in any set with other record types in the database
  • 10. Database Models • Relational : • the structure of the relational database is based on the relation, or table, along with the ability to define complex relationships between these relations. Each relation can be accessed directly • At the core of the relational model is the relation. A relation is a set of columns and rows collected in a table-like structure that represents a single entity made up of related data. 10
  • 11. Normalization • Normalization defines sets of rules, referred to as normal forms, which provide specific guidelines on how data should be organized in order to avoid anomalies that lead to inconsistencies in and loss of data as the data stored in the database is maintained. • 1NF, 2NF, 3NF 11
  • 12. 12 Operations of the Relational Model • Updates: changes the database’s state. • Insert • Delete • Update/modify • Retrievals: does not change the current state of the database.
  • 13. Operations of the Relational Model • Integrity constraints should not be violated by the update operations. • Several update operations may have to be grouped together. • Updates may propagate to cause other updates automatically. This may be necessary to maintain integrity constraints. 13
  • 14. 14 The Insert Operation • This operation can violate all constraints of the relation. How? • Domain constraint: attribute value does not appear in the corresponding domain. • Key constraint: if the key value already exist in another tuple. • Entity integrity: if the PK of the new tuple is NULL • Referential integrity: if any value of the FK refers to a tuple that does not exist in the other relation.
  • 15. 15 The Delete Operation • This operation can violate only the referential integrity constraint. How? • E.g: you can not delete a course that many students study in already.
  • 16. 16 The Update Operation • The new value must be of the correct data type and domain.
  • 17. Update Operations on Relations • In case of integrity violation, several actions can be taken: • Cancel the operation that causes the violation (REJECT option) • Perform the operation but inform the user of the violation • Trigger additional updates so the violation is corrected (CASCADE option, SET NULL option) • Execute a user-specified error-correction routine
  • 18. 18 SQL .. An Overview
  • 19. Overview of SQL 19  Query: allow questions to be asked of the data and display only the information required. It can include info from more the one table  Why Query language? A Database Management system enable users to access and manipulate data using queries.  Structured Query Language (SQL): is the language used by most relational database systems.
  • 20. Features of SQL 20  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
  • 21. Features of SQL 21  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
  • 22. Features of SQL 22  What Makes SQL Special?  SQL is an English-like language. It uses words such as select, insert, delete as part of its command set  SQL is a non-procedural language: you specify What information you require, not how to get it . This feature makes it easier for you to concentrate on obtaining the desired result.  SQL Processes sets of records rather than a single record at a time.  SQL can be used by a range of users including DBA’s, programmers, Management Personnel, and many other types of end users
  • 23. Types of SQL Statements 23  Data Definition Language (DDL): Commands that define a database. E.g. CREATE, ALTER, DROP, ...etc.  Data manipulation language (DML): Commands that maintain and query a database. E.g. SELECT, INSERT, UPDATE, DELETE.  Data Control Language (DCL): Commands that control a database, including administering privileges and committing data. E.g. CONNECT, GRANT, REVOKE, ...etc.
  • 24. 24 SQL is relatively easy to learn : • it is non-procedural - you specify what information you require, rather than how to get it; • it is essentially free-format - some sentences do not have to be typed at particular location on screen.
  • 25. Writing SQL Commands 25 • SQL commands maybe one or more lines • Command words cannot be split across lines • SQL Commands are not case sensitive • Place a semi –colon(;) at the end of last clause.
  • 26. 26 Both give the same result not case sensitive )