SlideShare a Scribd company logo
WELCOME TO OUR PRESENTATION
INTRODUCTION TO DATABASE &
SQL
1
What is a Database?
2
 Database is a collection of related data, that
contains information relevant to an
enterprise.
 For example:
1. University database
2. Employee database
3. Student database
4. Airlines database
etc…..
PROPERTIES OF A
DATABASE3
 A database represents some aspect of the real
world, sometimes called the miniworld or the
universe of discourse (UoD).
 A database is a logically coherent collection of
data with some inherent meaning.
 A database is designed, built and populated
with data for a specific purpose.
What is Database Management
System (DBMS)?4
 A database management system (DBMS) is a
collection of programs that enables users to create &
maintain a database. It facilitates the definition,
creation and manipulation of the database.
 Definition – it holds only structure of database, not
the data. It involves specifying the data types,
structures & constraints for the data to be stored in the
database.
 Creation –it is the inputting of actual data in the
database. It involves storing the data itself on some
storage medium that is controlled by the DBMS.
 Manipulation-it includes functions such as updation,
insertion, deletion, retrieval of specific data and
generating reports from the data.
A SIMPLIFIED DATABASE
SYSTEM ENVIRONMENT55
Typical DBMS Functionality
6
 Define a database : in terms of data types,
structures and constraints
 Construct or Load the Database on a
secondary storage medium
 Manipulating the database : querying,
generating reports, insertions, deletions and
modifications to its content
 Concurrent Processing and Sharing by a set of
users and programs – yet, keeping all data
valid and consistent
Typical DBMS Functionality
7
Other features:
 Protection or Security measures to prevent
unauthorized access
 “Active” processing to take internal actions on
data
 Presentation and Visualization of data
Database System
8
 The database and the DBMS together is
called the database system.
 Database systems are designed to manage
large bodies of information.
 It involves both defining structures for storage
of information & providing mechanisms for the
manipulation of information.
 Database system must ensure the safety of the
information stored.
Database System Applications
9
 Banking- for customer information, accounts & loans, and
banking transactions.
 Airlines-for reservations & schedule information.
 Universities-for student information, course registration and
grades.
 Credit card transactions-for purchases on credit cards &
generation of monthly statements.
 Telecommunication-for keeping records of calls made,
generating monthly bills, maintaining balances, information
about communication networks.
 Finance-for storing information about holdings, sales &
purchases of financial instruments such as stocks & bonds.
 Sales-for customer, product and purchase information.
 Manufacturing-for management of supply chain & for
tracking production of items in factories.
 Human resources-for information about employees, salaries,
payroll taxes and benefits
Functions of Database administrators
(DBA)10
 Coordinating & monitoring the database
 Authorizing access to the database
 For acquiring hardware & software resources
as needed by the user
 Concurrency control checking
 Security of the database
 Making backups & recovery
 Modification of the database structure & its
relation to the physical database
Advantages of DBMS
11
 Controlling Redundancy
 Restricting Unauthorized Access
 Providing Storage Structures for Efficient
Query Processing
 Providing Backup and Recovery
 Providing Multiple User Interfaces
 Representing Complex Relationship among
Data
 Enforcing Integrity Constraints
 Permitting Inferencing and Actions using Rules
Disadvantages of DBMS
12
 Cost of Hardware & Software
 Cost of Data Conversion
 Cost of Staff Training
 Appointing Technical Staff
 Database Damage
Different parts of a database
 Fields
 Records
 Queries
 Reports
Fields
 Database storage units
 Generic elements of content
Records
A simple table showing fields (columns) and records(rows):
And as part of an MS Access database table:
Queries
 Queries are the information retrieval
requests you make to the database
 Your queries are all about the
information you are trying to gather
Reports
 If the query is a question...
...then the report is its answer
 Reports can be tailored to the needs of
the data-user, making the information they
extract much more useful
18
SQL is used for:
 Data Manipulation
 Data Definition
 Data Administration
 All are expressed as an SQL statement or
command.
19
Using SQL20
To begin, you must first CREATE a database using
the following SQL statement:
CREATE DATABASE database_name
Depending on the version of SQL being used
the following statement is needed to begin
using the database:
USE database_name
Using SQL
 To create a table in the current database,
use the CREATE TABLE keyword
21
CREATE TABLE authors
(auth_id int(9) not null,
auth_name char(40) not null)
auth_id auth_name
(9 digit int) (40 char string)
Table Design22
Rows
describe the
Occurrence of
an EntityName Address
Jane Doe 123 Main Street
John Smith 456 Second Street
Mary Poe 789 Third Ave
Columns describe one
characteristic of the entity
Using SQL
 To insert data in the current table, use the
keyword INSERT INTO
23
auth_id auth_name
Then issue the statement
SELECT * FROM authors
INSERT INTO authors
values(‘000000001’, ‘John Smith’)
000000001 John Smith
Data Retrieval (Queries)
 Queries search the database, fetch info,
and display it. This is done using the
keyword
24
SELECT * FROM publishers
pub_id pub_name address state
0736 New Age Books 1 1st Street MA
0987 Binnet & Hardley 2 2nd Street DC
1120 Algodata Infosys 3 3rd Street CA
The
*Operator asks for every column in
the table.
Data Input
 Putting data into a table is accomplished
using the keyword
25
pub_id pub_name address state
0736 New Age Books 1 1st Street MA
0987 Binnet & Hardley 2 2nd Street DC
1120 Algodata Infosys 3 3rd Street CA
Table is updated with new information
INSERT INTO publishers
VALUES (‘0010’, ‘pragmatics’, ‘4 4th Ln’, ‘chicago’, ‘il’)
pub_id pub_name address state
0010 Pragmatics 4 4th Ln IL
0736 New Age Books 1 1st Street MA
0987 Binnet & Hardley 2 2nd Street DC
1120 Algodata Infosys 3 3rd Street CA
Data Retrieval (Queries)
 Queries can be more specific with a few
more lines
26
pub_id pub_name address state
0736 New Age Books 1 1st Street MA
0987 Binnet & Hardley 2 2nd Street DC
1120 Algodata Infosys 3 3rd Street CA
Only publishers in CA are displayed
SELECT *
from publishers
where state = ‘CA’
Using SQL27
SELECT auth_name, auth_city
FROM publishers
auth_id auth_name auth_city auth_state
123456789 Jane Doe Dearborn MI
000000001 John Smith Taylor MI
auth_name auth_city
Jane Doe Dearborn
John Smith Taylor
If you only want to display the author’s name and city from the following
table:
Using SQL28
DELETE from authors
WHERE auth_name=‘John Smith’
auth_id auth_name auth_city auth_state
123456789 Jane Doe Dearborn MI
000000001 John Smith Taylor MI
To delete data from a table, use the DELETE statement:
Using SQL29
UPDATE authors
SET auth_name=‘hello’
auth_id auth_name auth_city auth_state
123456789 Jane Doe Dearborn MI
000000001 John Smith Taylor MI
To Update information in a database use the UPDATE keyword
Hello
Hello
Sets all auth_name fields to hello
Using SQL30
ALTER TABLE authors
ADD birth_date datetime null
auth_id auth_name auth_city auth_state
123456789 Jane Doe Dearborn MI
000000001 John Smith Taylor MI
To change a table in a database use ALTER TABLE. ADD adds a
characteristic.
ADD puts a new column in the table called birth_date
birth_date
.
.
Type Initializer
Using SQL31
ALTER TABLE authors
DROP birth_date
auth_id auth_name auth_city auth_state
123456789 Jane Doe Dearborn MI
000000001 John Smith Taylor MI
To delete a column or row, use the keyword DROP
DROP removed the birth_date characteristic from the table
auth_state
.
.
Using SQL32
DROP DATABASE authors
auth_id auth_name auth_city auth_state
123456789 Jane Doe Dearborn MI
000000001 John Smith Taylor MI
The DROP statement is also used to delete an entire database.
DROP removed the database and returned the memory to system
33

More Related Content

What's hot (20)

PPTX
Introduction to database
Arpee Callejo
 
PPT
Mysql
TSUBHASHRI
 
PPTX
SQL - DML and DDL Commands
Shrija Madhu
 
PPT
Lecture 01 introduction to database
emailharmeet
 
PPTX
Database
Bhandari Nawaraj
 
PPT
Database Chapter 2
shahadat hossain
 
PPT
Introduction to structured query language (sql)
Sabana Maharjan
 
PPT
Elmasri Navathe DBMS Unit-1 ppt
AbhinavPandey274499
 
PPTX
Basic SQL and History
SomeshwarMoholkar
 
PDF
Advance database systems (part 1)
Abdullah Khosa
 
PPT
SQL Views
Aaron Buma
 
PPT
data modeling and models
sabah N
 
PPTX
SQL Basics
Hammad Rasheed
 
PPT
Dbms relational model
Chirag vasava
 
PPTX
Database design process
Tayyab Hameed
 
PPT
Fundamentals of Database system
philipsinter
 
PPTX
SQL Joins.pptx
Ankit Rai
 
PPTX
SQL Queries Information
Nishant Munjal
 
PDF
MySQL Workbench Tutorial | Introduction To MySQL Workbench | MySQL DBA Traini...
Edureka!
 
Introduction to database
Arpee Callejo
 
Mysql
TSUBHASHRI
 
SQL - DML and DDL Commands
Shrija Madhu
 
Lecture 01 introduction to database
emailharmeet
 
Database Chapter 2
shahadat hossain
 
Introduction to structured query language (sql)
Sabana Maharjan
 
Elmasri Navathe DBMS Unit-1 ppt
AbhinavPandey274499
 
Basic SQL and History
SomeshwarMoholkar
 
Advance database systems (part 1)
Abdullah Khosa
 
SQL Views
Aaron Buma
 
data modeling and models
sabah N
 
SQL Basics
Hammad Rasheed
 
Dbms relational model
Chirag vasava
 
Database design process
Tayyab Hameed
 
Fundamentals of Database system
philipsinter
 
SQL Joins.pptx
Ankit Rai
 
SQL Queries Information
Nishant Munjal
 
MySQL Workbench Tutorial | Introduction To MySQL Workbench | MySQL DBA Traini...
Edureka!
 

Similar to Introduction to database & sql (20)

PPTX
Bank mangement system
FaisalGhffar
 
PPTX
SQL-Demystified-A-Beginners-Guide-to-Database-Mastery.pptx
bhavaniteacher99
 
PDF
Database concepts
ACCESS Health Digital
 
PDF
Databases By ZAK
Tabsheer Hasan
 
PPTX
Chapter Five Physical Database Design.pptx
haymanot taddesse
 
PPT
Sql Server 2000
Om Vikram Thapa
 
PPTX
unit 1.pptx
GayathriPG3
 
PPTX
It 302 computerized accounting (week 2) - sharifah
alish sha
 
DOC
Unit3rd
Anshumali Singh
 
PDF
MIS5101 WK10 Outcome Measures
Steven Johnson
 
PPTX
8.) ms-access_ppt-CA-course-itt-programme.pptx
tiktok116
 
PPTX
unit 1.pptx
NIVETHA37590
 
PPT
W 8 introduction to database
Institute of Management Studies UOP
 
PDF
Air Line Management System | DBMS project
AniketHandore
 
PPT
MYSQL.ppt
webhostingguy
 
PPT
D B M S Animate
Indu George
 
PPT
Data dictionaries
Kiran Ajudiya
 
PDF
INT 1010 07-3.pdf
Luis R Castellanos
 
PPTX
Introduction to database with ms access.hetvii
07HetviBhagat
 
Bank mangement system
FaisalGhffar
 
SQL-Demystified-A-Beginners-Guide-to-Database-Mastery.pptx
bhavaniteacher99
 
Database concepts
ACCESS Health Digital
 
Databases By ZAK
Tabsheer Hasan
 
Chapter Five Physical Database Design.pptx
haymanot taddesse
 
Sql Server 2000
Om Vikram Thapa
 
unit 1.pptx
GayathriPG3
 
It 302 computerized accounting (week 2) - sharifah
alish sha
 
MIS5101 WK10 Outcome Measures
Steven Johnson
 
8.) ms-access_ppt-CA-course-itt-programme.pptx
tiktok116
 
unit 1.pptx
NIVETHA37590
 
W 8 introduction to database
Institute of Management Studies UOP
 
Air Line Management System | DBMS project
AniketHandore
 
MYSQL.ppt
webhostingguy
 
D B M S Animate
Indu George
 
Data dictionaries
Kiran Ajudiya
 
INT 1010 07-3.pdf
Luis R Castellanos
 
Introduction to database with ms access.hetvii
07HetviBhagat
 
Ad

More from zahid6 (7)

PPTX
Basics of digital image processing
zahid6
 
PPTX
Web app presentation
zahid6
 
PPTX
Journal,Ledger and Trial Balance
zahid6
 
PPTX
Traffic control system
zahid6
 
PPT
Network topology and cable's
zahid6
 
PPTX
Simpson’s one third and weddle's rule
zahid6
 
PPTX
Presentation for blast algorithm bio-informatice
zahid6
 
Basics of digital image processing
zahid6
 
Web app presentation
zahid6
 
Journal,Ledger and Trial Balance
zahid6
 
Traffic control system
zahid6
 
Network topology and cable's
zahid6
 
Simpson’s one third and weddle's rule
zahid6
 
Presentation for blast algorithm bio-informatice
zahid6
 
Ad

Recently uploaded (20)

PPTX
BinarySearchTree in datastructures in detail
kichokuttu
 
PDF
Optimizing Large Language Models with vLLM and Related Tools.pdf
Tamanna36
 
PDF
1750162332_Snapshot-of-Indias-oil-Gas-data-May-2025.pdf
sandeep718278
 
PDF
Product Management in HealthTech (Case Studies from SnappDoctor)
Hamed Shams
 
PDF
apidays Singapore 2025 - The API Playbook for AI by Shin Wee Chuang (PAND AI)
apidays
 
PDF
apidays Helsinki & North 2025 - How (not) to run a Graphql Stewardship Group,...
apidays
 
PPTX
apidays Singapore 2025 - Generative AI Landscape Building a Modern Data Strat...
apidays
 
PDF
JavaScript - Good or Bad? Tips for Google Tag Manager
📊 Markus Baersch
 
PDF
What does good look like - CRAP Brighton 8 July 2025
Jan Kierzyk
 
PDF
apidays Singapore 2025 - From API Intelligence to API Governance by Harsha Ch...
apidays
 
PDF
Research Methodology Overview Introduction
ayeshagul29594
 
PPTX
apidays Singapore 2025 - The Quest for the Greenest LLM , Jean Philippe Ehre...
apidays
 
PPTX
Numbers of a nation: how we estimate population statistics | Accessible slides
Office for National Statistics
 
PPTX
apidays Helsinki & North 2025 - From Chaos to Clarity: Designing (AI-Ready) A...
apidays
 
PDF
apidays Singapore 2025 - Surviving an interconnected world with API governanc...
apidays
 
PPTX
SlideEgg_501298-Agentic AI.pptx agentic ai
530BYManoj
 
PDF
Development and validation of the Japanese version of the Organizational Matt...
Yoga Tokuyoshi
 
PPT
tuberculosiship-2106031cyyfuftufufufivifviviv
AkshaiRam
 
PPTX
b6057ea5-8e8c-4415-90c0-ed8e9666ffcd.pptx
Anees487379
 
PDF
Avatar for apidays apidays PRO June 07, 2025 0 5 apidays Helsinki & North 2...
apidays
 
BinarySearchTree in datastructures in detail
kichokuttu
 
Optimizing Large Language Models with vLLM and Related Tools.pdf
Tamanna36
 
1750162332_Snapshot-of-Indias-oil-Gas-data-May-2025.pdf
sandeep718278
 
Product Management in HealthTech (Case Studies from SnappDoctor)
Hamed Shams
 
apidays Singapore 2025 - The API Playbook for AI by Shin Wee Chuang (PAND AI)
apidays
 
apidays Helsinki & North 2025 - How (not) to run a Graphql Stewardship Group,...
apidays
 
apidays Singapore 2025 - Generative AI Landscape Building a Modern Data Strat...
apidays
 
JavaScript - Good or Bad? Tips for Google Tag Manager
📊 Markus Baersch
 
What does good look like - CRAP Brighton 8 July 2025
Jan Kierzyk
 
apidays Singapore 2025 - From API Intelligence to API Governance by Harsha Ch...
apidays
 
Research Methodology Overview Introduction
ayeshagul29594
 
apidays Singapore 2025 - The Quest for the Greenest LLM , Jean Philippe Ehre...
apidays
 
Numbers of a nation: how we estimate population statistics | Accessible slides
Office for National Statistics
 
apidays Helsinki & North 2025 - From Chaos to Clarity: Designing (AI-Ready) A...
apidays
 
apidays Singapore 2025 - Surviving an interconnected world with API governanc...
apidays
 
SlideEgg_501298-Agentic AI.pptx agentic ai
530BYManoj
 
Development and validation of the Japanese version of the Organizational Matt...
Yoga Tokuyoshi
 
tuberculosiship-2106031cyyfuftufufufivifviviv
AkshaiRam
 
b6057ea5-8e8c-4415-90c0-ed8e9666ffcd.pptx
Anees487379
 
Avatar for apidays apidays PRO June 07, 2025 0 5 apidays Helsinki & North 2...
apidays
 

Introduction to database & sql

  • 1. WELCOME TO OUR PRESENTATION INTRODUCTION TO DATABASE & SQL 1
  • 2. What is a Database? 2  Database is a collection of related data, that contains information relevant to an enterprise.  For example: 1. University database 2. Employee database 3. Student database 4. Airlines database etc…..
  • 3. PROPERTIES OF A DATABASE3  A database represents some aspect of the real world, sometimes called the miniworld or the universe of discourse (UoD).  A database is a logically coherent collection of data with some inherent meaning.  A database is designed, built and populated with data for a specific purpose.
  • 4. What is Database Management System (DBMS)?4  A database management system (DBMS) is a collection of programs that enables users to create & maintain a database. It facilitates the definition, creation and manipulation of the database.  Definition – it holds only structure of database, not the data. It involves specifying the data types, structures & constraints for the data to be stored in the database.  Creation –it is the inputting of actual data in the database. It involves storing the data itself on some storage medium that is controlled by the DBMS.  Manipulation-it includes functions such as updation, insertion, deletion, retrieval of specific data and generating reports from the data.
  • 6. Typical DBMS Functionality 6  Define a database : in terms of data types, structures and constraints  Construct or Load the Database on a secondary storage medium  Manipulating the database : querying, generating reports, insertions, deletions and modifications to its content  Concurrent Processing and Sharing by a set of users and programs – yet, keeping all data valid and consistent
  • 7. Typical DBMS Functionality 7 Other features:  Protection or Security measures to prevent unauthorized access  “Active” processing to take internal actions on data  Presentation and Visualization of data
  • 8. Database System 8  The database and the DBMS together is called the database system.  Database systems are designed to manage large bodies of information.  It involves both defining structures for storage of information & providing mechanisms for the manipulation of information.  Database system must ensure the safety of the information stored.
  • 9. Database System Applications 9  Banking- for customer information, accounts & loans, and banking transactions.  Airlines-for reservations & schedule information.  Universities-for student information, course registration and grades.  Credit card transactions-for purchases on credit cards & generation of monthly statements.  Telecommunication-for keeping records of calls made, generating monthly bills, maintaining balances, information about communication networks.  Finance-for storing information about holdings, sales & purchases of financial instruments such as stocks & bonds.  Sales-for customer, product and purchase information.  Manufacturing-for management of supply chain & for tracking production of items in factories.  Human resources-for information about employees, salaries, payroll taxes and benefits
  • 10. Functions of Database administrators (DBA)10  Coordinating & monitoring the database  Authorizing access to the database  For acquiring hardware & software resources as needed by the user  Concurrency control checking  Security of the database  Making backups & recovery  Modification of the database structure & its relation to the physical database
  • 11. Advantages of DBMS 11  Controlling Redundancy  Restricting Unauthorized Access  Providing Storage Structures for Efficient Query Processing  Providing Backup and Recovery  Providing Multiple User Interfaces  Representing Complex Relationship among Data  Enforcing Integrity Constraints  Permitting Inferencing and Actions using Rules
  • 12. Disadvantages of DBMS 12  Cost of Hardware & Software  Cost of Data Conversion  Cost of Staff Training  Appointing Technical Staff  Database Damage
  • 13. Different parts of a database  Fields  Records  Queries  Reports
  • 14. Fields  Database storage units  Generic elements of content
  • 15. Records A simple table showing fields (columns) and records(rows): And as part of an MS Access database table:
  • 16. Queries  Queries are the information retrieval requests you make to the database  Your queries are all about the information you are trying to gather
  • 17. Reports  If the query is a question... ...then the report is its answer  Reports can be tailored to the needs of the data-user, making the information they extract much more useful
  • 18. 18
  • 19. SQL is used for:  Data Manipulation  Data Definition  Data Administration  All are expressed as an SQL statement or command. 19
  • 20. Using SQL20 To begin, you must first CREATE a database using the following SQL statement: CREATE DATABASE database_name Depending on the version of SQL being used the following statement is needed to begin using the database: USE database_name
  • 21. Using SQL  To create a table in the current database, use the CREATE TABLE keyword 21 CREATE TABLE authors (auth_id int(9) not null, auth_name char(40) not null) auth_id auth_name (9 digit int) (40 char string)
  • 22. Table Design22 Rows describe the Occurrence of an EntityName Address Jane Doe 123 Main Street John Smith 456 Second Street Mary Poe 789 Third Ave Columns describe one characteristic of the entity
  • 23. Using SQL  To insert data in the current table, use the keyword INSERT INTO 23 auth_id auth_name Then issue the statement SELECT * FROM authors INSERT INTO authors values(‘000000001’, ‘John Smith’) 000000001 John Smith
  • 24. Data Retrieval (Queries)  Queries search the database, fetch info, and display it. This is done using the keyword 24 SELECT * FROM publishers pub_id pub_name address state 0736 New Age Books 1 1st Street MA 0987 Binnet & Hardley 2 2nd Street DC 1120 Algodata Infosys 3 3rd Street CA The *Operator asks for every column in the table.
  • 25. Data Input  Putting data into a table is accomplished using the keyword 25 pub_id pub_name address state 0736 New Age Books 1 1st Street MA 0987 Binnet & Hardley 2 2nd Street DC 1120 Algodata Infosys 3 3rd Street CA Table is updated with new information INSERT INTO publishers VALUES (‘0010’, ‘pragmatics’, ‘4 4th Ln’, ‘chicago’, ‘il’) pub_id pub_name address state 0010 Pragmatics 4 4th Ln IL 0736 New Age Books 1 1st Street MA 0987 Binnet & Hardley 2 2nd Street DC 1120 Algodata Infosys 3 3rd Street CA
  • 26. Data Retrieval (Queries)  Queries can be more specific with a few more lines 26 pub_id pub_name address state 0736 New Age Books 1 1st Street MA 0987 Binnet & Hardley 2 2nd Street DC 1120 Algodata Infosys 3 3rd Street CA Only publishers in CA are displayed SELECT * from publishers where state = ‘CA’
  • 27. Using SQL27 SELECT auth_name, auth_city FROM publishers auth_id auth_name auth_city auth_state 123456789 Jane Doe Dearborn MI 000000001 John Smith Taylor MI auth_name auth_city Jane Doe Dearborn John Smith Taylor If you only want to display the author’s name and city from the following table:
  • 28. Using SQL28 DELETE from authors WHERE auth_name=‘John Smith’ auth_id auth_name auth_city auth_state 123456789 Jane Doe Dearborn MI 000000001 John Smith Taylor MI To delete data from a table, use the DELETE statement:
  • 29. Using SQL29 UPDATE authors SET auth_name=‘hello’ auth_id auth_name auth_city auth_state 123456789 Jane Doe Dearborn MI 000000001 John Smith Taylor MI To Update information in a database use the UPDATE keyword Hello Hello Sets all auth_name fields to hello
  • 30. Using SQL30 ALTER TABLE authors ADD birth_date datetime null auth_id auth_name auth_city auth_state 123456789 Jane Doe Dearborn MI 000000001 John Smith Taylor MI To change a table in a database use ALTER TABLE. ADD adds a characteristic. ADD puts a new column in the table called birth_date birth_date . . Type Initializer
  • 31. Using SQL31 ALTER TABLE authors DROP birth_date auth_id auth_name auth_city auth_state 123456789 Jane Doe Dearborn MI 000000001 John Smith Taylor MI To delete a column or row, use the keyword DROP DROP removed the birth_date characteristic from the table auth_state . .
  • 32. Using SQL32 DROP DATABASE authors auth_id auth_name auth_city auth_state 123456789 Jane Doe Dearborn MI 000000001 John Smith Taylor MI The DROP statement is also used to delete an entire database. DROP removed the database and returned the memory to system
  • 33. 33