SlideShare a Scribd company logo
5
Most read
10
Most read
13
Most read
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

More Related Content

PPTX
Presentation slides of Sequence Query Language (SQL)
PPTX
Sql commands
PDF
Chapter 4 Structured Query Language
PPT
Introduction to structured query language (sql)
PPT
Mysql
PPTX
SQL for interview
PPTX
Sql(structured query language)
PPT
Introduction to-sql
Presentation slides of Sequence Query Language (SQL)
Sql commands
Chapter 4 Structured Query Language
Introduction to structured query language (sql)
Mysql
SQL for interview
Sql(structured query language)
Introduction to-sql

What's hot (20)

PPTX
Basic SQL and History
PDF
SQL Overview
PPTX
SQL Joins.pptx
PPTX
SQL Queries Information
PPTX
introdution to SQL and SQL functions
PPTX
Sql - Structured Query Language
PPTX
Structured Query Language (SQL)
PPT
SQL Queries
PPTX
SQL Basics
PDF
Sql tutorial
PPT
SQL Tutorial - Basic Commands
PPT
Introduction of Oracle
PDF
SQL Functions and Operators
PPTX
SQL - DML and DDL Commands
PDF
SQL JOINS
PPTX
Basic sql Commands
DOCX
SQL report
PPT
Sql joins
PPTX
Sql server
ODP
Ms sql-server
Basic SQL and History
SQL Overview
SQL Joins.pptx
SQL Queries Information
introdution to SQL and SQL functions
Sql - Structured Query Language
Structured Query Language (SQL)
SQL Queries
SQL Basics
Sql tutorial
SQL Tutorial - Basic Commands
Introduction of Oracle
SQL Functions and Operators
SQL - DML and DDL Commands
SQL JOINS
Basic sql Commands
SQL report
Sql joins
Sql server
Ms sql-server
Ad

Similar to Structured query language(sql)ppt (20)

PDF
sql notes Provideby AGN HUB Tech & It Solutions
PPTX
SQL2.pptx
PPTX
structures query langauge basic for learners
PPTX
An intoduction to sql and its components
PDF
Lecture on DBMS & MySQL.pdf v. C. .
PPTX
SQLBasic to advance for the beggineers.pptx
PPTX
Data Ware Housing through SQL concept
PPTX
sql.pptxm og yd 6rxjfskhzihyzgmxbjfxuzkfa6
PPTX
sql.fjstsusgshsgsjjshshsjsjjshsjjsjsypptx
PDF
Database management system unit 1 Bca 2-semester notes
PPTX
Structured query language presentation.pptx
PDF
Sql smart reference_by_prasad
PDF
Sql smart reference_by_prasad
PDF
1.Types of SQL Commands for mba students
PPTX
Relational Database Language.pptx
PPTX
SQL Commands
sql notes Provideby AGN HUB Tech & It Solutions
SQL2.pptx
structures query langauge basic for learners
An intoduction to sql and its components
Lecture on DBMS & MySQL.pdf v. C. .
SQLBasic to advance for the beggineers.pptx
Data Ware Housing through SQL concept
sql.pptxm og yd 6rxjfskhzihyzgmxbjfxuzkfa6
sql.fjstsusgshsgsjjshshsjsjjshsjjsjsypptx
Database management system unit 1 Bca 2-semester notes
Structured query language presentation.pptx
Sql smart reference_by_prasad
Sql smart reference_by_prasad
1.Types of SQL Commands for mba students
Relational Database Language.pptx
SQL Commands
Ad

More from Gowarthini (6)

PPTX
PPTX
Oo ps
PPTX
Mvc ppt
PPTX
Cryptography ppt
PPTX
Git overview
PPTX
Basics of networking
Oo ps
Mvc ppt
Cryptography ppt
Git overview
Basics of networking

Recently uploaded (20)

PPTX
Strengthening open access through collaboration: building connections with OP...
PDF
Types of Literary Text: Poetry and Prose
PPTX
How to Manage Bill Control Policy in Odoo 18
PPTX
Cardiovascular Pharmacology for pharmacy students.pptx
PDF
The Final Stretch: How to Release a Game and Not Die in the Process.
PPTX
How to Manage Starshipit in Odoo 18 - Odoo Slides
PPTX
ACUTE NASOPHARYNGITIS. pptx
PPTX
How to Manage Loyalty Points in Odoo 18 Sales
PPTX
Introduction and Scope of Bichemistry.pptx
PPTX
Congenital Hypothyroidism pptx
PPTX
Presentation on Janskhiya sthirata kosh.
PPTX
UNDER FIVE CLINICS OR WELL BABY CLINICS.pptx
PDF
Piense y hagase Rico - Napoleon Hill Ccesa007.pdf
PDF
LDMMIA Reiki Yoga Workshop 15 MidTerm Review
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PDF
High Ground Student Revision Booklet Preview
PPTX
Onica Farming 24rsclub profitable farm business
PPTX
NOI Hackathon - Summer Edition - GreenThumber.pptx
PPTX
Odoo 18 Sales_ Managing Quotation Validity
Strengthening open access through collaboration: building connections with OP...
Types of Literary Text: Poetry and Prose
How to Manage Bill Control Policy in Odoo 18
Cardiovascular Pharmacology for pharmacy students.pptx
The Final Stretch: How to Release a Game and Not Die in the Process.
How to Manage Starshipit in Odoo 18 - Odoo Slides
ACUTE NASOPHARYNGITIS. pptx
How to Manage Loyalty Points in Odoo 18 Sales
Introduction and Scope of Bichemistry.pptx
Congenital Hypothyroidism pptx
Presentation on Janskhiya sthirata kosh.
UNDER FIVE CLINICS OR WELL BABY CLINICS.pptx
Piense y hagase Rico - Napoleon Hill Ccesa007.pdf
LDMMIA Reiki Yoga Workshop 15 MidTerm Review
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
High Ground Student Revision Booklet Preview
Onica Farming 24rsclub profitable farm business
NOI Hackathon - Summer Edition - GreenThumber.pptx
Odoo 18 Sales_ Managing Quotation Validity

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;