SlideShare uma empresa 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

Mais conteúdo relacionado

Mais procurados

Sql – Structured Query Language
Sql – Structured Query LanguageSql – Structured Query Language
Sql – Structured Query Language
pandey3045_bit
 
Oracle Database Overview
Oracle Database OverviewOracle Database Overview
Oracle Database Overview
honglee71
 

Mais procurados (20)

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
 
Sql – Structured Query Language
Sql – Structured Query LanguageSql – Structured Query Language
Sql – Structured Query Language
 
Stored procedure
Stored procedureStored procedure
Stored procedure
 
MySQL Tutorial For Beginners | Relational Database Management System | MySQL ...
MySQL Tutorial For Beginners | Relational Database Management System | MySQL ...MySQL Tutorial For Beginners | Relational Database Management System | MySQL ...
MySQL Tutorial For Beginners | Relational Database Management System | MySQL ...
 
Triggers in SQL | Edureka
Triggers in SQL | EdurekaTriggers in SQL | Edureka
Triggers in SQL | Edureka
 
Oracle Database Overview
Oracle Database OverviewOracle Database Overview
Oracle Database Overview
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
Normalization in databases
Normalization in databasesNormalization in databases
Normalization in databases
 
Sql commands
Sql commandsSql commands
Sql commands
 
Database Normalization by Dr. Kamal Gulati
Database Normalization by Dr. Kamal GulatiDatabase Normalization by Dr. Kamal Gulati
Database Normalization by Dr. Kamal Gulati
 
DATABASE CONSTRAINTS
DATABASE CONSTRAINTSDATABASE CONSTRAINTS
DATABASE CONSTRAINTS
 
Database performance tuning and query optimization
Database performance tuning and query optimizationDatabase performance tuning and query optimization
Database performance tuning and query optimization
 
DBMS Notes: DDL DML DCL
DBMS Notes: DDL DML DCLDBMS Notes: DDL DML DCL
DBMS Notes: DDL DML DCL
 
Sql fundamentals
Sql fundamentalsSql fundamentals
Sql fundamentals
 
Normalization of Data Base
Normalization of Data BaseNormalization of Data Base
Normalization of Data Base
 
Data flow diagram
Data flow diagramData flow diagram
Data flow diagram
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Normalization in SQL | Edureka
Normalization in SQL | EdurekaNormalization in SQL | Edureka
Normalization in SQL | Edureka
 
SQL JOINS
SQL JOINSSQL JOINS
SQL JOINS
 
SQL2.pptx
SQL2.pptxSQL2.pptx
SQL2.pptx
 

Semelhante a SQL .pptx

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

Semelhante 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
 
Structured query language(sql)ppt
Structured query language(sql)pptStructured query language(sql)ppt
Structured query language(sql)ppt
 
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
 
Sql database development part 1
Sql database development part 1Sql database development part 1
Sql database development part 1
 

Mais 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

Último (20)

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
 
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
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
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Ữ Â...
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
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
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
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
 
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
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 

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