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)

SQL Overview
SQL OverviewSQL Overview
SQL Overview
Stewart Rogers
 
Sql ppt
Sql pptSql ppt
Sql ppt
Anuja Lad
 
Oracle SQL Basics
Oracle SQL BasicsOracle SQL Basics
Oracle SQL Basics
Dhananjay Goel
 
Lecture 01 introduction to database
Lecture 01 introduction to databaseLecture 01 introduction to database
Lecture 01 introduction to database
emailharmeet
 
Sql server T-sql basics ppt-3
Sql server T-sql basics  ppt-3Sql server T-sql basics  ppt-3
Sql server T-sql basics ppt-3
Vibrant Technologies & Computers
 
SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL Commands
Shrija Madhu
 
SQL Functions
SQL FunctionsSQL Functions
SQL Functions
ammarbrohi
 
Views, Triggers, Functions, Stored Procedures, Indexing and Joins
Views, Triggers, Functions, Stored Procedures,  Indexing and JoinsViews, Triggers, Functions, Stored Procedures,  Indexing and Joins
Views, Triggers, Functions, Stored Procedures, Indexing and Joins
baabtra.com - No. 1 supplier of quality freshers
 
MYSQL.ppt
MYSQL.pptMYSQL.ppt
MYSQL.ppt
webhostingguy
 
Ms sql-server
Ms sql-serverMs sql-server
Ms sql-server
Md.Mojibul Hoque
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
Megha yadav
 
Basic Concept of Database
Basic Concept of DatabaseBasic Concept of Database
Basic Concept of Database
Marlon Jamera
 
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with ExamplesDML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
LGS, GBHS&IC, University Of South-Asia, TARA-Technologies
 
Presentation slides of Sequence Query Language (SQL)
Presentation slides of Sequence Query Language (SQL)Presentation slides of Sequence Query Language (SQL)
Presentation slides of Sequence Query Language (SQL)
Punjab University
 
Database basics
Database basicsDatabase basics
Database basics
prachin514
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
Rumman Ansari
 
Data Base Management System
Data Base Management SystemData Base Management System
Data Base Management System
Dr. C.V. Suresh Babu
 
Joins in SQL
Joins in SQLJoins in SQL
Joins in SQL
Vigneshwaran Sankaran
 
Data Models
Data ModelsData Models
Data Models
RituBhargava7
 
What is SQL Server?
What is SQL Server?What is SQL Server?
What is SQL Server?
CPD INDIA
 

Similar to Introduction to database & sql (20)

SQL
SQLSQL
SQL
Harshad Umredkar
 
DBMS_Lect.1 intro.pptx sdcaacweewcssrwe w
DBMS_Lect.1 intro.pptx sdcaacweewcssrwe wDBMS_Lect.1 intro.pptx sdcaacweewcssrwe w
DBMS_Lect.1 intro.pptx sdcaacweewcssrwe w
rohan1329be21
 
Database administration
Database administrationDatabase administration
Database administration
Anish Gupta
 
Ch 2-introduction to dbms
Ch 2-introduction to dbmsCh 2-introduction to dbms
Ch 2-introduction to dbms
Rupali Rana
 
Lecture27
Lecture27Lecture27
Lecture27
Sumama Shakir
 
Database part1-
Database part1-Database part1-
Database part1-
Taymoor Nazmy
 
DBMS introduction
DBMS introductionDBMS introduction
DBMS introduction
BHARATH KUMAR
 
1_DBMS_Introduction.pdf
1_DBMS_Introduction.pdf1_DBMS_Introduction.pdf
1_DBMS_Introduction.pdf
JubairAhmedNabin
 
DBMS_Unit_1.pptx
DBMS_Unit_1.pptxDBMS_Unit_1.pptx
DBMS_Unit_1.pptx
Amit Vyas
 
Database System
Database SystemDatabase System
Database System
Hasaka Sasaranga
 
W 8 introduction to database
W 8  introduction to databaseW 8  introduction to database
W 8 introduction to database
Institute of Management Studies UOP
 
1_Prelim-Module-IM101 ADVANCE DATABASE SYSTEM
1_Prelim-Module-IM101 ADVANCE DATABASE SYSTEM1_Prelim-Module-IM101 ADVANCE DATABASE SYSTEM
1_Prelim-Module-IM101 ADVANCE DATABASE SYSTEM
jessabelalancado
 
Sql a practical introduction
Sql   a practical introductionSql   a practical introduction
Sql a practical introduction
Hasan Kata
 
Sql a practical introduction
Sql   a practical introductionSql   a practical introduction
Sql a practical introduction
sanjaychauhan689
 
Bba ii cam u ii-introduction to dbms
Bba ii cam  u ii-introduction to dbmsBba ii cam  u ii-introduction to dbms
Bba ii cam u ii-introduction to dbms
Rai University
 
DBMS Full.ppt
DBMS Full.pptDBMS Full.ppt
DBMS Full.ppt
pritikanamaity600
 
data base manage ment
data base manage mentdata base manage ment
data base manage ment
kaleemullah125
 
DataBaseManagementSystem-DBMS
DataBaseManagementSystem-DBMSDataBaseManagementSystem-DBMS
DataBaseManagementSystem-DBMS
kangrehmat
 
Data Manipulation ppt. for BSIT students
Data Manipulation ppt. for BSIT studentsData Manipulation ppt. for BSIT students
Data Manipulation ppt. for BSIT students
julie4baxtii
 
03-database-management-system-revision-notes.pdf
03-database-management-system-revision-notes.pdf03-database-management-system-revision-notes.pdf
03-database-management-system-revision-notes.pdf
Amit Mishra
 
DBMS_Lect.1 intro.pptx sdcaacweewcssrwe w
DBMS_Lect.1 intro.pptx sdcaacweewcssrwe wDBMS_Lect.1 intro.pptx sdcaacweewcssrwe w
DBMS_Lect.1 intro.pptx sdcaacweewcssrwe w
rohan1329be21
 
Database administration
Database administrationDatabase administration
Database administration
Anish Gupta
 
Ch 2-introduction to dbms
Ch 2-introduction to dbmsCh 2-introduction to dbms
Ch 2-introduction to dbms
Rupali Rana
 
DBMS_Unit_1.pptx
DBMS_Unit_1.pptxDBMS_Unit_1.pptx
DBMS_Unit_1.pptx
Amit Vyas
 
1_Prelim-Module-IM101 ADVANCE DATABASE SYSTEM
1_Prelim-Module-IM101 ADVANCE DATABASE SYSTEM1_Prelim-Module-IM101 ADVANCE DATABASE SYSTEM
1_Prelim-Module-IM101 ADVANCE DATABASE SYSTEM
jessabelalancado
 
Sql a practical introduction
Sql   a practical introductionSql   a practical introduction
Sql a practical introduction
Hasan Kata
 
Sql a practical introduction
Sql   a practical introductionSql   a practical introduction
Sql a practical introduction
sanjaychauhan689
 
Bba ii cam u ii-introduction to dbms
Bba ii cam  u ii-introduction to dbmsBba ii cam  u ii-introduction to dbms
Bba ii cam u ii-introduction to dbms
Rai University
 
DataBaseManagementSystem-DBMS
DataBaseManagementSystem-DBMSDataBaseManagementSystem-DBMS
DataBaseManagementSystem-DBMS
kangrehmat
 
Data Manipulation ppt. for BSIT students
Data Manipulation ppt. for BSIT studentsData Manipulation ppt. for BSIT students
Data Manipulation ppt. for BSIT students
julie4baxtii
 
03-database-management-system-revision-notes.pdf
03-database-management-system-revision-notes.pdf03-database-management-system-revision-notes.pdf
03-database-management-system-revision-notes.pdf
Amit Mishra
 
Ad

More from zahid6 (7)

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

Recently uploaded (20)

apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...
apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...
apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...
apidays
 
apidays New York 2025 - Spring Modulith Design for Microservices by Renjith R...
apidays New York 2025 - Spring Modulith Design for Microservices by Renjith R...apidays New York 2025 - Spring Modulith Design for Microservices by Renjith R...
apidays New York 2025 - Spring Modulith Design for Microservices by Renjith R...
apidays
 
[Eddie Lee] Capstone Project - AI PM Bootcamp - DataFox.pdf
[Eddie Lee] Capstone Project - AI PM Bootcamp - DataFox.pdf[Eddie Lee] Capstone Project - AI PM Bootcamp - DataFox.pdf
[Eddie Lee] Capstone Project - AI PM Bootcamp - DataFox.pdf
Eddie Lee
 
apidays New York 2025 - Open Source and disrupting the travel distribution ec...
apidays New York 2025 - Open Source and disrupting the travel distribution ec...apidays New York 2025 - Open Source and disrupting the travel distribution ec...
apidays New York 2025 - Open Source and disrupting the travel distribution ec...
apidays
 
1-2. Lab Introduction to Linux environment.ppt
1-2. Lab Introduction to Linux environment.ppt1-2. Lab Introduction to Linux environment.ppt
1-2. Lab Introduction to Linux environment.ppt
Wahajch
 
BE PROGRAMjwjwjwjsjsjsjsME TEMPLATE.pptx
BE PROGRAMjwjwjwjsjsjsjsME TEMPLATE.pptxBE PROGRAMjwjwjwjsjsjsjsME TEMPLATE.pptx
BE PROGRAMjwjwjwjsjsjsjsME TEMPLATE.pptx
AaronBaluyut
 
apidays New York 2025 - Beyond Webhooks: The Future of Scalable API Event Del...
apidays New York 2025 - Beyond Webhooks: The Future of Scalable API Event Del...apidays New York 2025 - Beyond Webhooks: The Future of Scalable API Event Del...
apidays New York 2025 - Beyond Webhooks: The Future of Scalable API Event Del...
apidays
 
Report_Government Authorities_Index_ENG_FIN.pdf
Report_Government Authorities_Index_ENG_FIN.pdfReport_Government Authorities_Index_ENG_FIN.pdf
Report_Government Authorities_Index_ENG_FIN.pdf
OlhaTatokhina1
 
apidays New York 2025 - Why I Built Another Carbon Measurement Tool for LLMs ...
apidays New York 2025 - Why I Built Another Carbon Measurement Tool for LLMs ...apidays New York 2025 - Why I Built Another Carbon Measurement Tool for LLMs ...
apidays New York 2025 - Why I Built Another Carbon Measurement Tool for LLMs ...
apidays
 
Managed Cloud services - Opsio Cloud Man
Managed Cloud services - Opsio Cloud ManManaged Cloud services - Opsio Cloud Man
Managed Cloud services - Opsio Cloud Man
Opsio Cloud
 
Media_Literacy_Index_of_Media_Sector_Employees.pdf
Media_Literacy_Index_of_Media_Sector_Employees.pdfMedia_Literacy_Index_of_Media_Sector_Employees.pdf
Media_Literacy_Index_of_Media_Sector_Employees.pdf
OlhaTatokhina1
 
LONGSEM2024-25_CSE3015_ETH_AP2024256000125_Reference-Material-I.pptx
LONGSEM2024-25_CSE3015_ETH_AP2024256000125_Reference-Material-I.pptxLONGSEM2024-25_CSE3015_ETH_AP2024256000125_Reference-Material-I.pptx
LONGSEM2024-25_CSE3015_ETH_AP2024256000125_Reference-Material-I.pptx
vemuripraveena2622
 
Advanced_English_Pronunciation_in_Use.pdf
Advanced_English_Pronunciation_in_Use.pdfAdvanced_English_Pronunciation_in_Use.pdf
Advanced_English_Pronunciation_in_Use.pdf
leogoemmanguyenthao
 
METHODS OF DATA COLLECTION (Research methodology)
METHODS OF DATA COLLECTION (Research methodology)METHODS OF DATA COLLECTION (Research methodology)
METHODS OF DATA COLLECTION (Research methodology)
anwesha248
 
apidays New York 2025 - The Future of Small Business Lending with Open Bankin...
apidays New York 2025 - The Future of Small Business Lending with Open Bankin...apidays New York 2025 - The Future of Small Business Lending with Open Bankin...
apidays New York 2025 - The Future of Small Business Lending with Open Bankin...
apidays
 
apidays New York 2025 - Computers are still dumb by Ben Morss (DeepL)
apidays New York 2025 - Computers are still dumb by Ben Morss (DeepL)apidays New York 2025 - Computers are still dumb by Ben Morss (DeepL)
apidays New York 2025 - Computers are still dumb by Ben Morss (DeepL)
apidays
 
MEDIA_LITERACY_INDEX_OF_EDUCATORS_ENG.pdf
MEDIA_LITERACY_INDEX_OF_EDUCATORS_ENG.pdfMEDIA_LITERACY_INDEX_OF_EDUCATORS_ENG.pdf
MEDIA_LITERACY_INDEX_OF_EDUCATORS_ENG.pdf
OlhaTatokhina1
 
Mining Presentation Online Courses for Student
Mining Presentation Online Courses for StudentMining Presentation Online Courses for Student
Mining Presentation Online Courses for Student
Rizki229625
 
Ch01_Introduction_to_Information_Securit
Ch01_Introduction_to_Information_SecuritCh01_Introduction_to_Information_Securit
Ch01_Introduction_to_Information_Securit
KawukiDerrick
 
apidays New York 2025 - The FINOS Common Domain Model for Capital Markets by ...
apidays New York 2025 - The FINOS Common Domain Model for Capital Markets by ...apidays New York 2025 - The FINOS Common Domain Model for Capital Markets by ...
apidays New York 2025 - The FINOS Common Domain Model for Capital Markets by ...
apidays
 
apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...
apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...
apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...
apidays
 
apidays New York 2025 - Spring Modulith Design for Microservices by Renjith R...
apidays New York 2025 - Spring Modulith Design for Microservices by Renjith R...apidays New York 2025 - Spring Modulith Design for Microservices by Renjith R...
apidays New York 2025 - Spring Modulith Design for Microservices by Renjith R...
apidays
 
[Eddie Lee] Capstone Project - AI PM Bootcamp - DataFox.pdf
[Eddie Lee] Capstone Project - AI PM Bootcamp - DataFox.pdf[Eddie Lee] Capstone Project - AI PM Bootcamp - DataFox.pdf
[Eddie Lee] Capstone Project - AI PM Bootcamp - DataFox.pdf
Eddie Lee
 
apidays New York 2025 - Open Source and disrupting the travel distribution ec...
apidays New York 2025 - Open Source and disrupting the travel distribution ec...apidays New York 2025 - Open Source and disrupting the travel distribution ec...
apidays New York 2025 - Open Source and disrupting the travel distribution ec...
apidays
 
1-2. Lab Introduction to Linux environment.ppt
1-2. Lab Introduction to Linux environment.ppt1-2. Lab Introduction to Linux environment.ppt
1-2. Lab Introduction to Linux environment.ppt
Wahajch
 
BE PROGRAMjwjwjwjsjsjsjsME TEMPLATE.pptx
BE PROGRAMjwjwjwjsjsjsjsME TEMPLATE.pptxBE PROGRAMjwjwjwjsjsjsjsME TEMPLATE.pptx
BE PROGRAMjwjwjwjsjsjsjsME TEMPLATE.pptx
AaronBaluyut
 
apidays New York 2025 - Beyond Webhooks: The Future of Scalable API Event Del...
apidays New York 2025 - Beyond Webhooks: The Future of Scalable API Event Del...apidays New York 2025 - Beyond Webhooks: The Future of Scalable API Event Del...
apidays New York 2025 - Beyond Webhooks: The Future of Scalable API Event Del...
apidays
 
Report_Government Authorities_Index_ENG_FIN.pdf
Report_Government Authorities_Index_ENG_FIN.pdfReport_Government Authorities_Index_ENG_FIN.pdf
Report_Government Authorities_Index_ENG_FIN.pdf
OlhaTatokhina1
 
apidays New York 2025 - Why I Built Another Carbon Measurement Tool for LLMs ...
apidays New York 2025 - Why I Built Another Carbon Measurement Tool for LLMs ...apidays New York 2025 - Why I Built Another Carbon Measurement Tool for LLMs ...
apidays New York 2025 - Why I Built Another Carbon Measurement Tool for LLMs ...
apidays
 
Managed Cloud services - Opsio Cloud Man
Managed Cloud services - Opsio Cloud ManManaged Cloud services - Opsio Cloud Man
Managed Cloud services - Opsio Cloud Man
Opsio Cloud
 
Media_Literacy_Index_of_Media_Sector_Employees.pdf
Media_Literacy_Index_of_Media_Sector_Employees.pdfMedia_Literacy_Index_of_Media_Sector_Employees.pdf
Media_Literacy_Index_of_Media_Sector_Employees.pdf
OlhaTatokhina1
 
LONGSEM2024-25_CSE3015_ETH_AP2024256000125_Reference-Material-I.pptx
LONGSEM2024-25_CSE3015_ETH_AP2024256000125_Reference-Material-I.pptxLONGSEM2024-25_CSE3015_ETH_AP2024256000125_Reference-Material-I.pptx
LONGSEM2024-25_CSE3015_ETH_AP2024256000125_Reference-Material-I.pptx
vemuripraveena2622
 
Advanced_English_Pronunciation_in_Use.pdf
Advanced_English_Pronunciation_in_Use.pdfAdvanced_English_Pronunciation_in_Use.pdf
Advanced_English_Pronunciation_in_Use.pdf
leogoemmanguyenthao
 
METHODS OF DATA COLLECTION (Research methodology)
METHODS OF DATA COLLECTION (Research methodology)METHODS OF DATA COLLECTION (Research methodology)
METHODS OF DATA COLLECTION (Research methodology)
anwesha248
 
apidays New York 2025 - The Future of Small Business Lending with Open Bankin...
apidays New York 2025 - The Future of Small Business Lending with Open Bankin...apidays New York 2025 - The Future of Small Business Lending with Open Bankin...
apidays New York 2025 - The Future of Small Business Lending with Open Bankin...
apidays
 
apidays New York 2025 - Computers are still dumb by Ben Morss (DeepL)
apidays New York 2025 - Computers are still dumb by Ben Morss (DeepL)apidays New York 2025 - Computers are still dumb by Ben Morss (DeepL)
apidays New York 2025 - Computers are still dumb by Ben Morss (DeepL)
apidays
 
MEDIA_LITERACY_INDEX_OF_EDUCATORS_ENG.pdf
MEDIA_LITERACY_INDEX_OF_EDUCATORS_ENG.pdfMEDIA_LITERACY_INDEX_OF_EDUCATORS_ENG.pdf
MEDIA_LITERACY_INDEX_OF_EDUCATORS_ENG.pdf
OlhaTatokhina1
 
Mining Presentation Online Courses for Student
Mining Presentation Online Courses for StudentMining Presentation Online Courses for Student
Mining Presentation Online Courses for Student
Rizki229625
 
Ch01_Introduction_to_Information_Securit
Ch01_Introduction_to_Information_SecuritCh01_Introduction_to_Information_Securit
Ch01_Introduction_to_Information_Securit
KawukiDerrick
 
apidays New York 2025 - The FINOS Common Domain Model for Capital Markets by ...
apidays New York 2025 - The FINOS Common Domain Model for Capital Markets by ...apidays New York 2025 - The FINOS Common Domain Model for Capital Markets by ...
apidays New York 2025 - The FINOS Common Domain Model for Capital Markets by ...
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