SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Structured Query Language(SQL)
BY.,
B. Gowarthini
C. Divya
V. Suruthi
Agenda:
• Introduction
• Datatypes of SQL
• Operators of SQL
• Basic Database Concepts
• Processing capabilities of SQL
• Joins and its types
• Aggregate functions
• Stored procedures
• Index
• Triggers
Introduction:
• SQL is a non procedural language that is used to create,
manipulate and process the database.
Characteristics of SQL:
• Easy to learn and use.
• Large volume of DB can be handled easily.
Datatypes of SQL:
• Like programming languages, datatypes are also available in SQL
• Most commonly used types:
Int
Date
Long
Number
varchar/ nvarchar
Operators of SQL:
Operators in SQL:
 Arithmetic operators : +, -, *, / (Simple mathematical operations)
 Relational operators : =, <, >, <=, >=, <> (For comparing values)
 Logical operators : OR, AND, NOT (For condition clause)
Basic Database concepts:
• Data: -Raw facts and figures useful to an organization.
-Cannot take decisions on basis of data.
• Field : -Set of characters
• Record: -Collection of fields
• Primary key: -Uniquely identifies the records
-Never allow NULL and duplicates
• Foreign key: -Referential integrity
Processing capabilities of SQL
• Data Definition Language (DDL)
• Views
• Data Manipulation Language (DML)
• Data Control Language (DCL)
• Transaction Control Language (TCL)
Processing capabilities of SQL
Data Definition Language (DDL):
Common DDL statements are CREATE, ALTER, DROP.
CREATE – To create new DB, table, index, view etc..,
ALTER - To alter the table, DB etc..,
DROP - To delete objects from DB.
View:
- View is a kind of virtual table.
- It contains rows and columns like a real table.
- We can create a view by selecting fields.
Processing capabilities of SQL
Data Manipulation Language (DML):
- To manipulate the database objects
- Query the DB for information retrieval
- Common DML statements are
 SELECT
 INSERT
 DELETE
 UPDATE
Processing capabilities of SQL
Data Control Language(DCL):
- Controlling access to the data
- Common DCL commands are GRANT , REVOKE
Transaction Control Language (TCL):
- Control the transaction in DB system
- Common TCL commands are COMMIT, ROLLBACK
Joins and its types
• Used to combine rows from two or more tables, based on a
related column between them.
Types:
- Inner Join
- Left Join
- Right Join
- Full Join
- Self Join
Aggregate functions
Stored procedures
• It stored as an object in the database server.
• The code can be reused over and over again and then just call it
to execute it.
Syntax:
CREATE PROCEDURE procedure_name // Create stored proc.
AS
sql_statement
GO;
EXEC procedure_name; //Execute a stored procedure
Index
• Used to retrieve data from the DB very fast.
• Users cannot see the indexes, they are just used to speed up
searches/queries.
Syntax:
CREATE INDEX index_name
ON table_name (column1, column2, ...);
Types:
Clustered index - rows are stored physically on the disk in the
same order
Non Clustered index - second list that has pointers to the
physical rows.
Triggers
• Special kind of Stored procedure
• Automatically invokes whenever a DML and DDL events in DB
occurs
Syntax:
create trigger deep
on emp
for
insert,update,delete
as
print'you can not insert,update and delete this table i'
rollback;
Structured query language(sql)ppt

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Introduction to sql
Introduction to sqlIntroduction to sql
Introduction to sql
 
SQL for interview
SQL for interviewSQL for interview
SQL for interview
 
SQL Commands
SQL Commands SQL Commands
SQL Commands
 
Chapter 4 Structured Query Language
Chapter 4 Structured Query LanguageChapter 4 Structured Query Language
Chapter 4 Structured Query Language
 
SQL
SQLSQL
SQL
 
Basic sql Commands
Basic sql CommandsBasic sql Commands
Basic sql Commands
 
Sql commands
Sql commandsSql commands
Sql commands
 
SQL JOINS
SQL JOINSSQL JOINS
SQL JOINS
 
Sql - Structured Query Language
Sql - Structured Query LanguageSql - Structured Query Language
Sql - Structured Query Language
 
SQL Basics
SQL BasicsSQL Basics
SQL Basics
 
Mysql
MysqlMysql
Mysql
 
Ms sql-server
Ms sql-serverMs sql-server
Ms sql-server
 
SQL Server Learning Drive
SQL Server Learning Drive SQL Server Learning Drive
SQL Server Learning Drive
 
Sql queries presentation
Sql queries presentationSql queries presentation
Sql queries presentation
 
Working with Databases and MySQL
Working with Databases and MySQLWorking with Databases and MySQL
Working with Databases and MySQL
 
SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL Commands
 
PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts
 
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
 
5. stored procedure and functions
5. stored procedure and functions5. stored procedure and functions
5. stored procedure and functions
 
Oracle: Joins
Oracle: JoinsOracle: Joins
Oracle: Joins
 

Ähnlich wie Structured query language(sql)ppt

Implementing the Databese Server session 02
Implementing the Databese Server session 02Implementing the Databese Server session 02
Implementing the Databese Server session 02
Guillermo Julca
 

Ähnlich wie Structured query language(sql)ppt (20)

Introduction to SQL, SQL*Plus
Introduction to SQL, SQL*PlusIntroduction to SQL, SQL*Plus
Introduction to SQL, SQL*Plus
 
DataBase Management systems (IM).pptx
DataBase Management systems (IM).pptxDataBase Management systems (IM).pptx
DataBase Management systems (IM).pptx
 
Complete first chapter rdbm 17332
Complete first chapter rdbm 17332Complete first chapter rdbm 17332
Complete first chapter rdbm 17332
 
Database Systems - Introduction to SQL (Chapter 3/1)
Database Systems - Introduction to SQL (Chapter 3/1)Database Systems - Introduction to SQL (Chapter 3/1)
Database Systems - Introduction to SQL (Chapter 3/1)
 
SQL Intro
SQL IntroSQL Intro
SQL Intro
 
Pl sql content
Pl sql contentPl sql content
Pl sql content
 
Java Developers, make the database work for you (NLJUG JFall 2010)
Java Developers, make the database work for you (NLJUG JFall 2010)Java Developers, make the database work for you (NLJUG JFall 2010)
Java Developers, make the database work for you (NLJUG JFall 2010)
 
SQL_NOTES.pdf
SQL_NOTES.pdfSQL_NOTES.pdf
SQL_NOTES.pdf
 
SQL SERVER Training in Pune Slides
SQL SERVER Training in Pune SlidesSQL SERVER Training in Pune Slides
SQL SERVER Training in Pune Slides
 
Implementing the Databese Server session 02
Implementing the Databese Server session 02Implementing the Databese Server session 02
Implementing the Databese Server session 02
 
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.}
 
INTRODUCTION TO DATABASE
INTRODUCTION TO DATABASEINTRODUCTION TO DATABASE
INTRODUCTION TO DATABASE
 
Unit - II.pptx
Unit - II.pptxUnit - II.pptx
Unit - II.pptx
 
Sql and its functions
Sql and its functionsSql and its functions
Sql and its functions
 
Islamic University Previous Year Question Solution 2018 (ADBMS)
Islamic University Previous Year Question Solution 2018 (ADBMS)Islamic University Previous Year Question Solution 2018 (ADBMS)
Islamic University Previous Year Question Solution 2018 (ADBMS)
 
Python programming
Python programmingPython programming
Python programming
 
(Dbms) class 1 & 2 (Presentation)
(Dbms) class 1 & 2 (Presentation)(Dbms) class 1 & 2 (Presentation)
(Dbms) class 1 & 2 (Presentation)
 
Query editor for multi databases
Query editor for multi databasesQuery editor for multi databases
Query editor for multi databases
 
SQL Training courses.pptx
SQL Training courses.pptxSQL Training courses.pptx
SQL Training courses.pptx
 
INTRODUCTION OF DATA BASE
INTRODUCTION OF DATA BASEINTRODUCTION OF DATA BASE
INTRODUCTION OF DATA BASE
 

Mehr von Gowarthini (6)

.Net
.Net.Net
.Net
 
Oo ps
Oo psOo ps
Oo ps
 
Mvc ppt
Mvc pptMvc ppt
Mvc ppt
 
Cryptography ppt
Cryptography pptCryptography ppt
Cryptography ppt
 
Git overview
Git overviewGit overview
Git overview
 
Basics of networking
Basics of  networkingBasics of  networking
Basics of networking
 

Kürzlich hochgeladen

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
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
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Kürzlich hochgeladen (20)

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.
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
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
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
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...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.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...
 
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
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).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
 
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
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 

Structured query language(sql)ppt

  • 1. Structured Query Language(SQL) BY., B. Gowarthini C. Divya V. Suruthi
  • 2. Agenda: • Introduction • Datatypes of SQL • Operators of SQL • Basic Database Concepts • Processing capabilities of SQL • Joins and its types • Aggregate functions • Stored procedures • Index • Triggers
  • 3. Introduction: • SQL is a non procedural language that is used to create, manipulate and process the database. Characteristics of SQL: • Easy to learn and use. • Large volume of DB can be handled easily.
  • 4. Datatypes of SQL: • Like programming languages, datatypes are also available in SQL • Most commonly used types: Int Date Long Number varchar/ nvarchar
  • 5. Operators of SQL: Operators in SQL:  Arithmetic operators : +, -, *, / (Simple mathematical operations)  Relational operators : =, <, >, <=, >=, <> (For comparing values)  Logical operators : OR, AND, NOT (For condition clause)
  • 6. Basic Database concepts: • Data: -Raw facts and figures useful to an organization. -Cannot take decisions on basis of data. • Field : -Set of characters • Record: -Collection of fields • Primary key: -Uniquely identifies the records -Never allow NULL and duplicates • Foreign key: -Referential integrity
  • 7. Processing capabilities of SQL • Data Definition Language (DDL) • Views • Data Manipulation Language (DML) • Data Control Language (DCL) • Transaction Control Language (TCL)
  • 8. Processing capabilities of SQL Data Definition Language (DDL): Common DDL statements are CREATE, ALTER, DROP. CREATE – To create new DB, table, index, view etc.., ALTER - To alter the table, DB etc.., DROP - To delete objects from DB. View: - View is a kind of virtual table. - It contains rows and columns like a real table. - We can create a view by selecting fields.
  • 9. Processing capabilities of SQL Data Manipulation Language (DML): - To manipulate the database objects - Query the DB for information retrieval - Common DML statements are  SELECT  INSERT  DELETE  UPDATE
  • 10. Processing capabilities of SQL Data Control Language(DCL): - Controlling access to the data - Common DCL commands are GRANT , REVOKE Transaction Control Language (TCL): - Control the transaction in DB system - Common TCL commands are COMMIT, ROLLBACK
  • 11. Joins and its types • Used to combine rows from two or more tables, based on a related column between them. Types: - Inner Join - Left Join - Right Join - Full Join - Self Join
  • 13. Stored procedures • It stored as an object in the database server. • The code can be reused over and over again and then just call it to execute it. Syntax: CREATE PROCEDURE procedure_name // Create stored proc. AS sql_statement GO; EXEC procedure_name; //Execute a stored procedure
  • 14. Index • Used to retrieve data from the DB very fast. • Users cannot see the indexes, they are just used to speed up searches/queries. Syntax: CREATE INDEX index_name ON table_name (column1, column2, ...); Types: Clustered index - rows are stored physically on the disk in the same order Non Clustered index - second list that has pointers to the physical rows.
  • 15. Triggers • Special kind of Stored procedure • Automatically invokes whenever a DML and DDL events in DB occurs Syntax: create trigger deep on emp for insert,update,delete as print'you can not insert,update and delete this table i' rollback;