SlideShare una empresa de Scribd logo
1 de 24
Introduction to
SQL
What is SQL?
▶ Structured Query Language
▶ SQL is Structured Query Language, which is a
computer language for storing, manipulating and
retrieving data stored in relational database.
▶ SQL is the standard language for Relation Database
System. All relational database management systems
like “MySQL, MS Access, Oracle, Sybase, Informix,
postgres and SQL Server” use SQL as standard
database language.
SQL Commands
▶ DDL - Data Definition Language
▶ DML - Data Manipulation Language
▶ DCL - Data Control Language
▶ DQL - Data Query Language
SQL Commands
SQL Commands
SQL RDBMS Concepts
▶ TABLE
▶ RECORD
▶ COLUMN
▶ CELL
▶ NULL?
SQL RDBMS Concepts
▶ SQL Constraints: (applied on columns)
▶ NOT NULL Constraint
▶ UNIQUE Constraint
▶ PRIMARY Key
▶ FOREIGN Key
▶ CHECK Constraint
▶ Data Integrity:
▶ Entity Integrity: There are no duplicate rows in a table
▶ Domain Integrity: Enforces valid entries for a given column by
restricting the type
▶ Referential Integrity: Rows cannot be deleted which are used by
other records
▶ User-Defined Integrity: Enforces some specific business rules
SQL RDBMS Concepts
▶ Data Types:
▶ Character datatypes:
▶ CHAR
▶ NCHAR
▶ NVARCHAR2
▶ VARCHAR2
▶ Numeric datatypes:
▶ NUMBER
▶ BINARY_FLOAT
▶ BINARY_DOUBLE
▶ Date time datatype:
▶ DATE
DCL: CREATE USER
▶ 1) Define User with Username/Password
▶ 2) Grants Sufficient Privileges.
▶ Using SQL Developer (UI, Command)
▶ Using SQL *PLUS (Command)
SQL : DDL
▶ Create Table:
▶ COLUMNS
▶ CONSTRAINTS
SQL: DDL
▶ DROP TABLE:
▶ ALTER TABLE
▶ OTHER DDL COMMANDS!!!!
SQL: DML: INSERT
▶ INSERT INTO:
▶ NUMBER, CHAR/VARCHAR2, DATE?
SQL: DML: INSERT
▶ INSERT INTO:
▶ SPECIFIC COLUMNS
SQL: DML: INSERT
▶ INSERT INTO:
▶ FOREIGN KEY
▶ ALL DML COMMANDS NEED COMMIT
SQL: DML: UPDATE
▶ UPDATE
▶ WHERE CLAUSE
SQL: DML: DELETE
▶ DELETE (DELETE VS DROP????)
HR-Schema
SQL: DQL: SELECT
▶ SELECT
▶ *
▶ SPECIFIC COLUMNS
SQL: DQL: SELECT
▶ DISTINCT CLUASE
SQL: DQL: SELECT
▶ WHERE CLUASE
SQL: DQL: SELECT
▶ IN CLUASE
▶ NOT IN
▶ NULL IN WHERE?
▶ IS NULL
▶ IS NOT NULL
SQL: DQL: SELECT
▶ ORDER BY
SQL: DQL: SELECT
▶ GROUP BY
▶ AGGREGATE FUCTION
▶ MAX,MIN
▶ AVG
▶ COUNT
▶ SUM
▶ …
▶ HAVING CLAUSE
SQL: DQL: SELECT
▶ SELECT FROM MULTIPLE TABLES
▶ CARTESIAN MULTIPICATION
▶ JOIN

Más contenido relacionado

La actualidad más candente

MIS: Business Intelligence
MIS: Business IntelligenceMIS: Business Intelligence
MIS: Business Intelligence
Jonathan Coleman
 

La actualidad más candente (20)

1. SQL Basics - Introduction
1. SQL Basics - Introduction1. SQL Basics - Introduction
1. SQL Basics - Introduction
 
SQL Overview
SQL OverviewSQL Overview
SQL Overview
 
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
 
MIS: Business Intelligence
MIS: Business IntelligenceMIS: Business Intelligence
MIS: Business Intelligence
 
SQL
SQLSQL
SQL
 
5. stored procedure and functions
5. stored procedure and functions5. stored procedure and functions
5. stored procedure and functions
 
Structured query language(sql)ppt
Structured query language(sql)pptStructured query language(sql)ppt
Structured query language(sql)ppt
 
Sql select
Sql select Sql select
Sql select
 
Advanced SQL
Advanced SQLAdvanced SQL
Advanced SQL
 
Sql operator
Sql operatorSql operator
Sql operator
 
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)
 
SQL
SQLSQL
SQL
 
Introduction to Database Management Systems (DBMS)
Introduction to Database Management Systems (DBMS)Introduction to Database Management Systems (DBMS)
Introduction to Database Management Systems (DBMS)
 
Introducción al SQL
Introducción al SQLIntroducción al SQL
Introducción al SQL
 
Structured Query Language
Structured Query LanguageStructured Query Language
Structured Query Language
 
Sql commands
Sql commandsSql commands
Sql commands
 
Mysql Ppt
Mysql PptMysql Ppt
Mysql Ppt
 
DBMS - Database Management System
DBMS - Database Management System DBMS - Database Management System
DBMS - Database Management System
 
Data Wrangling
Data WranglingData Wrangling
Data Wrangling
 
Introduction to Databases
Introduction to DatabasesIntroduction to Databases
Introduction to Databases
 

Similar a SQL .pptx

introductiontosql-161216154706.pdf
introductiontosql-161216154706.pdfintroductiontosql-161216154706.pdf
introductiontosql-161216154706.pdf
ssusere4c6aa
 

Similar a SQL .pptx (20)

Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
 
introductiontosql-161216154706.pdf
introductiontosql-161216154706.pdfintroductiontosql-161216154706.pdf
introductiontosql-161216154706.pdf
 
Database Fundamental
Database FundamentalDatabase Fundamental
Database Fundamental
 
SQL
SQLSQL
SQL
 
SQL 3.pptx
SQL 3.pptxSQL 3.pptx
SQL 3.pptx
 
Structured Query Language introduction..
Structured Query Language introduction..Structured Query Language introduction..
Structured Query Language introduction..
 
SQL overview and software
SQL overview and softwareSQL overview and software
SQL overview and software
 
Lecture 2 sql {basics date type, constrains , integrity types etc.}
Lecture 2 sql {basics  date type, constrains , integrity types etc.}Lecture 2 sql {basics  date type, constrains , integrity types etc.}
Lecture 2 sql {basics date type, constrains , integrity types etc.}
 
SQL Introduction.pptx
SQL Introduction.pptxSQL Introduction.pptx
SQL Introduction.pptx
 
Dbms chapter ii
Dbms chapter iiDbms chapter ii
Dbms chapter ii
 
SQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics CoveredSQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics Covered
 
Sq lite module5
Sq lite module5Sq lite module5
Sq lite module5
 
Kace & SQL
Kace & SQLKace & SQL
Kace & SQL
 
Lab
LabLab
Lab
 
What is SQL Server?
What is SQL Server?What is SQL Server?
What is SQL Server?
 
Introduction to Database SQL & PL/SQL
Introduction to Database SQL & PL/SQLIntroduction to Database SQL & PL/SQL
Introduction to Database SQL & PL/SQL
 
Rdbms day3
Rdbms day3Rdbms day3
Rdbms day3
 
DDL And DML
DDL And DMLDDL And DML
DDL And DML
 
SQL2.pptx
SQL2.pptxSQL2.pptx
SQL2.pptx
 
Sql database development part 1
Sql database development part 1Sql database development part 1
Sql database development part 1
 

Más de SityogInstituteOfTec1 (7)

dbms-1.pptx
dbms-1.pptxdbms-1.pptx
dbms-1.pptx
 
C++ basic.ppt
C++ basic.pptC++ basic.ppt
C++ basic.ppt
 
MCQ fundamental-4 .pptx
MCQ fundamental-4 .pptxMCQ fundamental-4 .pptx
MCQ fundamental-4 .pptx
 
diagram.pptx
diagram.pptxdiagram.pptx
diagram.pptx
 
DBMS.pptx
DBMS.pptxDBMS.pptx
DBMS.pptx
 
computer-generations.ppt
computer-generations.pptcomputer-generations.ppt
computer-generations.ppt
 
block_diagram_of_computer.pptx
block_diagram_of_computer.pptxblock_diagram_of_computer.pptx
block_diagram_of_computer.pptx
 

Último

Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 

Último (20)

Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 

SQL .pptx

  • 2. What is SQL? ▶ Structured Query Language ▶ SQL is Structured Query Language, which is a computer language for storing, manipulating and retrieving data stored in relational database. ▶ SQL is the standard language for Relation Database System. All relational database management systems like “MySQL, MS Access, Oracle, Sybase, Informix, postgres and SQL Server” use SQL as standard database language.
  • 3. SQL Commands ▶ DDL - Data Definition Language ▶ DML - Data Manipulation Language ▶ DCL - Data Control Language ▶ DQL - Data Query Language
  • 6. SQL RDBMS Concepts ▶ TABLE ▶ RECORD ▶ COLUMN ▶ CELL ▶ NULL?
  • 7. SQL RDBMS Concepts ▶ SQL Constraints: (applied on columns) ▶ NOT NULL Constraint ▶ UNIQUE Constraint ▶ PRIMARY Key ▶ FOREIGN Key ▶ CHECK Constraint ▶ Data Integrity: ▶ Entity Integrity: There are no duplicate rows in a table ▶ Domain Integrity: Enforces valid entries for a given column by restricting the type ▶ Referential Integrity: Rows cannot be deleted which are used by other records ▶ User-Defined Integrity: Enforces some specific business rules
  • 8. SQL RDBMS Concepts ▶ Data Types: ▶ Character datatypes: ▶ CHAR ▶ NCHAR ▶ NVARCHAR2 ▶ VARCHAR2 ▶ Numeric datatypes: ▶ NUMBER ▶ BINARY_FLOAT ▶ BINARY_DOUBLE ▶ Date time datatype: ▶ DATE
  • 9. DCL: CREATE USER ▶ 1) Define User with Username/Password ▶ 2) Grants Sufficient Privileges. ▶ Using SQL Developer (UI, Command) ▶ Using SQL *PLUS (Command)
  • 10. SQL : DDL ▶ Create Table: ▶ COLUMNS ▶ CONSTRAINTS
  • 11. SQL: DDL ▶ DROP TABLE: ▶ ALTER TABLE ▶ OTHER DDL COMMANDS!!!!
  • 12. SQL: DML: INSERT ▶ INSERT INTO: ▶ NUMBER, CHAR/VARCHAR2, DATE?
  • 13. SQL: DML: INSERT ▶ INSERT INTO: ▶ SPECIFIC COLUMNS
  • 14. SQL: DML: INSERT ▶ INSERT INTO: ▶ FOREIGN KEY ▶ ALL DML COMMANDS NEED COMMIT
  • 15. SQL: DML: UPDATE ▶ UPDATE ▶ WHERE CLAUSE
  • 16. SQL: DML: DELETE ▶ DELETE (DELETE VS DROP????)
  • 18. SQL: DQL: SELECT ▶ SELECT ▶ * ▶ SPECIFIC COLUMNS
  • 19. SQL: DQL: SELECT ▶ DISTINCT CLUASE
  • 20. SQL: DQL: SELECT ▶ WHERE CLUASE
  • 21. SQL: DQL: SELECT ▶ IN CLUASE ▶ NOT IN ▶ NULL IN WHERE? ▶ IS NULL ▶ IS NOT NULL
  • 23. SQL: DQL: SELECT ▶ GROUP BY ▶ AGGREGATE FUCTION ▶ MAX,MIN ▶ AVG ▶ COUNT ▶ SUM ▶ … ▶ HAVING CLAUSE
  • 24. SQL: DQL: SELECT ▶ SELECT FROM MULTIPLE TABLES ▶ CARTESIAN MULTIPICATION ▶ JOIN