SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt? (20)

Sql and Sql commands
Sql and Sql commandsSql and Sql commands
Sql and Sql commands
 
Sql - Structured Query Language
Sql - Structured Query LanguageSql - Structured Query Language
Sql - Structured Query Language
 
Sql Basics | Edureka
Sql Basics | EdurekaSql Basics | Edureka
Sql Basics | Edureka
 
SQL2.pptx
SQL2.pptxSQL2.pptx
SQL2.pptx
 
SQL Tutorial - Basic Commands
SQL Tutorial - Basic CommandsSQL Tutorial - Basic Commands
SQL Tutorial - Basic Commands
 
SQL Basics
SQL BasicsSQL Basics
SQL Basics
 
Dml and ddl
Dml and ddlDml and ddl
Dml and ddl
 
Integrity constraints in dbms
Integrity constraints in dbmsIntegrity constraints in dbms
Integrity constraints in dbms
 
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)
 
Mysql
MysqlMysql
Mysql
 
Sql Server Basics
Sql Server BasicsSql Server Basics
Sql Server Basics
 
Sql – Structured Query Language
Sql – Structured Query LanguageSql – Structured Query Language
Sql – Structured Query Language
 
SQL Commands
SQL Commands SQL Commands
SQL Commands
 
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick Learning
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick LearningOracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick Learning
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick Learning
 
DB2 DOCUMENT
DB2 DOCUMENTDB2 DOCUMENT
DB2 DOCUMENT
 
RDBMS
RDBMS RDBMS
RDBMS
 
Sql ppt
Sql pptSql ppt
Sql ppt
 
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
 
MYSQL
MYSQLMYSQL
MYSQL
 
SQL : introduction
SQL : introductionSQL : introduction
SQL : introduction
 

Ähnlich wie Introduction to SQL in 40 Characters

Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQLEhsan Hamzei
 
introductiontosql-161216154706.pdf
introductiontosql-161216154706.pdfintroductiontosql-161216154706.pdf
introductiontosql-161216154706.pdfssusere4c6aa
 
Structured query language(sql)ppt
Structured query language(sql)pptStructured query language(sql)ppt
Structured query language(sql)pptGowarthini
 
Database Fundamental
Database FundamentalDatabase Fundamental
Database FundamentalGong Haibing
 
Structured Query Language introduction..
Structured Query Language introduction..Structured Query Language introduction..
Structured Query Language introduction..FerryKemperman
 
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.}Shubham Shukla
 
SQL Introduction.pptx
SQL Introduction.pptxSQL Introduction.pptx
SQL Introduction.pptxRUBAB79
 
SQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics CoveredSQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics CoveredDanish Mehraj
 
What is SQL Server?
What is SQL Server?What is SQL Server?
What is SQL Server?CPD INDIA
 
DDL And DML
DDL And DMLDDL And DML
DDL And DMLpnp @in
 
Sql database development part 1
Sql database development part 1Sql database development part 1
Sql database development part 1Sqlperfomance
 

Ähnlich wie Introduction to SQL in 40 Characters (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
 

Mehr von 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
 

Kürzlich hochgeladen

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 

Kürzlich hochgeladen (20)

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 

Introduction to SQL in 40 Characters

  • 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