SlideShare a Scribd company logo
5
Most read
6
Most read
7
Most read
BY
Ms V.VENNILA MCA., M.Phil..,
Assistant Professor
Bon Secours College for Women, Thanjavur.
Data Definition:
 Data definition refers to the set of SQL commands that
can create and manipulate the structures of a database.
 DDL statements are used to create, change and remove
objects including indexes, triggers, tables and views.
 Common DDL statements include
 CREATE
(generates a new table)
 ALTER
(alters table)
 DROP
(removes a table from the database)
CREATE:
Syntax:
CREATE TABLE table name(column definitions,table
parameters);
Example:
CREATE TABLE Employee(employee ID integer primary
key, first name char(50),last name(75))
ALTER:
Syntax:
ALTER object type, object name parameters
Example:
ALTER TABLE Employee ADD DOB date
Drop:
Syntax:
DROP object type object name
Example:
DROP TABLE Employee
BASIC STRUCTURE OF SQL QUERIES
 SQL is based on set relational operations with
certain modification and enhancements.
 A typical SQL query has the form
 The Select clause
 The From clause
 The Where clause
The SELECT clause:
 The select clause list the attributes described in the
result of a query.
 SQL allows duplicates in relations as well as in query
results.
 The select clause can contain arithmetic expressions
involving the operation +,-,* and / operating on
constants o attributes of tuples.
The WHERE clause:
 The where clause specifies conditions that the result
must satisfy.
 Comparison results can be combined using the logical
connectives and, or, not.
 Comparison can be applied to results of arithmetic
expressions.
The FROM clause:
 The from clause is a source of a row set to be operated
upon in a data manipulation language(DML) statement.
The from is an SQL reserved word in the SQL standard.
 The from clause is used in conjunction with SQL
statements.
SET OPERATIONS IN SQL
 SQL supports few set operations which can be performed
on the table data.
 These are used to get meaningful results from data
stored in the table under different special conditions.
Types of set operations:
 Union
 Union all
 Intersect
 Minus
Union Operation:
Union is used to combine the results of two or more
select statements.
Union All:
This operation is similar to union but it also shows the
duplicate rows.
Intersect:
Intersect operation is used to combine two select
statements.
Minus:
The minus operation combines results of two select
statements and return only those in the final result which
belongs to the first set of the result.

More Related Content

What's hot (20)

PPTX
Trigger
VForce Infotech
 
PPTX
Group By, Having Clause and Order By clause
Deepam Aggarwal
 
PPT
Joins in SQL
Vigneshwaran Sankaran
 
PPTX
SQL - Structured query language introduction
Smriti Jain
 
PPTX
database language ppt.pptx
Anusha sivakumar
 
PPT
PL/SQL Introduction and Concepts
Bharat Kalia
 
PPT
Aggregate functions
sinhacp
 
PPTX
SQL commands
GirdharRatne
 
PPTX
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
Vraj Patel
 
PPTX
SQL(DDL & DML)
Sharad Dubey
 
PDF
Triggers and Stored Procedures
Tharindu Weerasinghe
 
PPSX
ADO.NET
Farzad Wadia
 
PPTX
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
LGS, GBHS&IC, University Of South-Asia, TARA-Technologies
 
PPTX
Sql subquery
Raveena Thakur
 
PPTX
Relational Data Model Introduction
Nishant Munjal
 
PPT
Sql operators & functions 3
Dr. C.V. Suresh Babu
 
PPTX
Triggers
Pooja Dixit
 
PPTX
Integrity Constraints
Megha yadav
 
ODP
Sql commands
Balakumaran Arunachalam
 
Group By, Having Clause and Order By clause
Deepam Aggarwal
 
Joins in SQL
Vigneshwaran Sankaran
 
SQL - Structured query language introduction
Smriti Jain
 
database language ppt.pptx
Anusha sivakumar
 
PL/SQL Introduction and Concepts
Bharat Kalia
 
Aggregate functions
sinhacp
 
SQL commands
GirdharRatne
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
Vraj Patel
 
SQL(DDL & DML)
Sharad Dubey
 
Triggers and Stored Procedures
Tharindu Weerasinghe
 
ADO.NET
Farzad Wadia
 
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
LGS, GBHS&IC, University Of South-Asia, TARA-Technologies
 
Sql subquery
Raveena Thakur
 
Relational Data Model Introduction
Nishant Munjal
 
Sql operators & functions 3
Dr. C.V. Suresh Babu
 
Triggers
Pooja Dixit
 
Integrity Constraints
Megha yadav
 

Similar to STRUCTURE OF SQL QUERIES (20)

PPTX
Database Management System DBMS -SQL queries
SABITHARASSISTANTPRO
 
PPTX
Data Base Management System - Basic Structure of SQL Queries
jananisairam
 
DOC
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
Newyorksys.com
 
PPTX
SQL Query
Imam340267
 
PPTX
Relational Database Language.pptx
Sheethal Aji Mani
 
PPT
Db1 lecture4
Sherif Gad
 
PPTX
Lab
neelam_rawat
 
PPTX
rdbms parul university oracle dbms bca mca
VaibhavSrivastav52
 
PPTX
Sql slid
pacatarpit
 
PPT
Lab_04.ppt opreating system of computer lab
MUHAMMADANSAR76
 
PPTX
SQL Tutorial for Beginners
Abdelhay Shafi
 
PPT
asdasdasdasdsadasdasdasdasdsadasdasdasdsadsadasd
MuhamedAhmed35
 
PPT
SQL.ppt
RickyLidar
 
PPTX
SQL(NEW).pptx
PoojaChawan2
 
PDF
SQL Overview
Stewart Rogers
 
PPTX
SQL.pptx
SAIFKHAN41507
 
DOCX
Sql
Archana Rout
 
PPT
Sql (DBMS)
Saransh Vijay
 
PPTX
DBMS UNIT 3
Dr. SURBHI SAROHA
 
Database Management System DBMS -SQL queries
SABITHARASSISTANTPRO
 
Data Base Management System - Basic Structure of SQL Queries
jananisairam
 
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
Newyorksys.com
 
SQL Query
Imam340267
 
Relational Database Language.pptx
Sheethal Aji Mani
 
Db1 lecture4
Sherif Gad
 
rdbms parul university oracle dbms bca mca
VaibhavSrivastav52
 
Sql slid
pacatarpit
 
Lab_04.ppt opreating system of computer lab
MUHAMMADANSAR76
 
SQL Tutorial for Beginners
Abdelhay Shafi
 
asdasdasdasdsadasdasdasdasdsadasdasdasdsadsadasd
MuhamedAhmed35
 
SQL.ppt
RickyLidar
 
SQL(NEW).pptx
PoojaChawan2
 
SQL Overview
Stewart Rogers
 
SQL.pptx
SAIFKHAN41507
 
Sql (DBMS)
Saransh Vijay
 
DBMS UNIT 3
Dr. SURBHI SAROHA
 
Ad

More from VENNILAV6 (20)

PPTX
WORKING WITH GRAPHICS
VENNILAV6
 
PPTX
CREATING A MASTER PAGE
VENNILAV6
 
PPTX
CREATING A NEW PUBLICATION IN PAGEMAKER
VENNILAV6
 
PPTX
Relational algebra
VENNILAV6
 
PPTX
Joins & constraints
VENNILAV6
 
PPTX
Database architecture
VENNILAV6
 
PPTX
Data definition language
VENNILAV6
 
PPTX
INTERCONNECTION STRUCTURE
VENNILAV6
 
PPTX
CACHE MEMORY
VENNILAV6
 
PPTX
Machine control flow
VENNILAV6
 
PPTX
COMPUTER FUNCTIONS
VENNILAV6
 
PPTX
EXTERNAL DEVICE
VENNILAV6
 
PPT
CORELDRAW EXAMPLES
VENNILAV6
 
PPT
BASICS OF DATA STRUCTURE
VENNILAV6
 
PPTX
object oriented system development
VENNILAV6
 
PPTX
virtual function
VENNILAV6
 
PPTX
constructor and destructor
VENNILAV6
 
PPTX
INHERITANCE
VENNILAV6
 
PPTX
BASICS OF MOBILE COMPUTING
VENNILAV6
 
PPT
BASICS OF JAVA
VENNILAV6
 
WORKING WITH GRAPHICS
VENNILAV6
 
CREATING A MASTER PAGE
VENNILAV6
 
CREATING A NEW PUBLICATION IN PAGEMAKER
VENNILAV6
 
Relational algebra
VENNILAV6
 
Joins & constraints
VENNILAV6
 
Database architecture
VENNILAV6
 
Data definition language
VENNILAV6
 
INTERCONNECTION STRUCTURE
VENNILAV6
 
CACHE MEMORY
VENNILAV6
 
Machine control flow
VENNILAV6
 
COMPUTER FUNCTIONS
VENNILAV6
 
EXTERNAL DEVICE
VENNILAV6
 
CORELDRAW EXAMPLES
VENNILAV6
 
BASICS OF DATA STRUCTURE
VENNILAV6
 
object oriented system development
VENNILAV6
 
virtual function
VENNILAV6
 
constructor and destructor
VENNILAV6
 
INHERITANCE
VENNILAV6
 
BASICS OF MOBILE COMPUTING
VENNILAV6
 
BASICS OF JAVA
VENNILAV6
 
Ad

Recently uploaded (20)

PPTX
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
PPTX
DIGITAL CITIZENSHIP TOPIC TLE 8 MATATAG CURRICULUM
ROBERTAUGUSTINEFRANC
 
PDF
Android Programming - Basics of Mobile App, App tools and Android Basics
Kavitha P.V
 
PPTX
Introduction to Indian Writing in English
Trushali Dodiya
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PDF
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
PPTX
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
PDF
Mahidol_Change_Agent_Note_2025-06-27-29_MUSEF
Tassanee Lerksuthirat
 
PDF
Introduction presentation of the patentbutler tool
MIPLM
 
PPTX
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
PDF
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
PDF
Governor Josh Stein letter to NC delegation of U.S. House
Mebane Rash
 
PPTX
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
PDF
Council of Chalcedon Re-Examined
Smiling Lungs
 
PDF
STATEMENT-BY-THE-HON.-MINISTER-FOR-HEALTH-ON-THE-COVID-19-OUTBREAK-AT-UG_revi...
nservice241
 
PDF
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
PPTX
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
PDF
AI-Powered-Visual-Storytelling-for-Nonprofits.pdf
TechSoup
 
PPTX
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
DIGITAL CITIZENSHIP TOPIC TLE 8 MATATAG CURRICULUM
ROBERTAUGUSTINEFRANC
 
Android Programming - Basics of Mobile App, App tools and Android Basics
Kavitha P.V
 
Introduction to Indian Writing in English
Trushali Dodiya
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
Mahidol_Change_Agent_Note_2025-06-27-29_MUSEF
Tassanee Lerksuthirat
 
Introduction presentation of the patentbutler tool
MIPLM
 
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
Governor Josh Stein letter to NC delegation of U.S. House
Mebane Rash
 
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
Council of Chalcedon Re-Examined
Smiling Lungs
 
STATEMENT-BY-THE-HON.-MINISTER-FOR-HEALTH-ON-THE-COVID-19-OUTBREAK-AT-UG_revi...
nservice241
 
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
AI-Powered-Visual-Storytelling-for-Nonprofits.pdf
TechSoup
 
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 

STRUCTURE OF SQL QUERIES

  • 1. BY Ms V.VENNILA MCA., M.Phil.., Assistant Professor Bon Secours College for Women, Thanjavur.
  • 2. Data Definition:  Data definition refers to the set of SQL commands that can create and manipulate the structures of a database.  DDL statements are used to create, change and remove objects including indexes, triggers, tables and views.  Common DDL statements include  CREATE (generates a new table)  ALTER (alters table)  DROP (removes a table from the database)
  • 3. CREATE: Syntax: CREATE TABLE table name(column definitions,table parameters); Example: CREATE TABLE Employee(employee ID integer primary key, first name char(50),last name(75)) ALTER: Syntax: ALTER object type, object name parameters Example: ALTER TABLE Employee ADD DOB date
  • 4. Drop: Syntax: DROP object type object name Example: DROP TABLE Employee BASIC STRUCTURE OF SQL QUERIES  SQL is based on set relational operations with certain modification and enhancements.  A typical SQL query has the form  The Select clause  The From clause  The Where clause
  • 5. The SELECT clause:  The select clause list the attributes described in the result of a query.  SQL allows duplicates in relations as well as in query results.  The select clause can contain arithmetic expressions involving the operation +,-,* and / operating on constants o attributes of tuples. The WHERE clause:  The where clause specifies conditions that the result must satisfy.  Comparison results can be combined using the logical connectives and, or, not.  Comparison can be applied to results of arithmetic expressions.
  • 6. The FROM clause:  The from clause is a source of a row set to be operated upon in a data manipulation language(DML) statement. The from is an SQL reserved word in the SQL standard.  The from clause is used in conjunction with SQL statements. SET OPERATIONS IN SQL  SQL supports few set operations which can be performed on the table data.  These are used to get meaningful results from data stored in the table under different special conditions.
  • 7. Types of set operations:  Union  Union all  Intersect  Minus Union Operation: Union is used to combine the results of two or more select statements. Union All: This operation is similar to union but it also shows the duplicate rows. Intersect: Intersect operation is used to combine two select statements.
  • 8. Minus: The minus operation combines results of two select statements and return only those in the final result which belongs to the first set of the result.