SlideShare a Scribd company logo
1 of 8
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

database language ppt.pptx
database language ppt.pptxdatabase language ppt.pptx
database language ppt.pptxAnusha sivakumar
 
Types Of Keys in DBMS
Types Of Keys in DBMSTypes Of Keys in DBMS
Types Of Keys in DBMSPadamNepal1
 
Structured Query Language (SQL)
Structured Query Language (SQL)Structured Query Language (SQL)
Structured Query Language (SQL)Syed Hassan Ali
 
Components and Advantages of DBMS
Components and Advantages of DBMSComponents and Advantages of DBMS
Components and Advantages of DBMSShubham Joon
 
SQL - Structured query language introduction
SQL - Structured query language introductionSQL - Structured query language introduction
SQL - Structured query language introductionSmriti Jain
 
Data types in python
Data types in pythonData types in python
Data types in pythonRaginiJain21
 
Conditional and control statement
Conditional and control statementConditional and control statement
Conditional and control statementnarmadhakin
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship DiagramShakila Mahjabin
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management SystemJanki Shah
 
Sql queries presentation
Sql queries presentationSql queries presentation
Sql queries presentationNITISH KUMAR
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational modelChirag vasava
 
2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMSkoolkampus
 
Functional dependencies and normalization
Functional dependencies and normalizationFunctional dependencies and normalization
Functional dependencies and normalizationdaxesh chauhan
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functionsfarwa waqar
 

What's hot (20)

database language ppt.pptx
database language ppt.pptxdatabase language ppt.pptx
database language ppt.pptx
 
RDBMS
RDBMSRDBMS
RDBMS
 
Types Of Keys in DBMS
Types Of Keys in DBMSTypes Of Keys in DBMS
Types Of Keys in DBMS
 
Structured Query Language (SQL)
Structured Query Language (SQL)Structured Query Language (SQL)
Structured Query Language (SQL)
 
View of data DBMS
View of data DBMSView of data DBMS
View of data DBMS
 
joins in database
 joins in database joins in database
joins in database
 
Components and Advantages of DBMS
Components and Advantages of DBMSComponents and Advantages of DBMS
Components and Advantages of DBMS
 
SQL - Structured query language introduction
SQL - Structured query language introductionSQL - Structured query language introduction
SQL - Structured query language introduction
 
Data types in python
Data types in pythonData types in python
Data types in python
 
DBMS: Types of keys
DBMS:  Types of keysDBMS:  Types of keys
DBMS: Types of keys
 
Conditional and control statement
Conditional and control statementConditional and control statement
Conditional and control statement
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management System
 
Sql queries presentation
Sql queries presentationSql queries presentation
Sql queries presentation
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational model
 
Data independence
Data independenceData independence
Data independence
 
2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS
 
SQL Views
SQL ViewsSQL Views
SQL Views
 
Functional dependencies and normalization
Functional dependencies and normalizationFunctional dependencies and normalization
Functional dependencies and normalization
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functions
 

Similar to STRUCTURE OF SQL QUERIES

PPT of Common Table Expression (CTE), Window Functions, JOINS, SubQuery
PPT  of Common Table Expression (CTE), Window Functions, JOINS, SubQueryPPT  of Common Table Expression (CTE), Window Functions, JOINS, SubQuery
PPT of Common Table Expression (CTE), Window Functions, JOINS, SubQueryAbhishek590097
 
DATABASE MANAGMENT SYSTEM (DBMS) AND SQL
DATABASE MANAGMENT SYSTEM (DBMS) AND SQLDATABASE MANAGMENT SYSTEM (DBMS) AND SQL
DATABASE MANAGMENT SYSTEM (DBMS) AND SQLDev Chauhan
 
DBMS and SQL(structured query language) .pptx
DBMS and SQL(structured query language) .pptxDBMS and SQL(structured query language) .pptx
DBMS and SQL(structured query language) .pptxjainendraKUMAR55
 
chapter9-SQL.pptx
chapter9-SQL.pptxchapter9-SQL.pptx
chapter9-SQL.pptxYaser52
 
Assg2 b 19121033-converted
Assg2 b 19121033-convertedAssg2 b 19121033-converted
Assg2 b 19121033-convertedSUSHANTPHALKE2
 
Data Base Management System - Basic Structure of SQL Queries
Data Base Management System - Basic Structure of SQL QueriesData Base Management System - Basic Structure of SQL Queries
Data Base Management System - Basic Structure of SQL Queriesjananisairam
 
Database Management System DBMS -SQL queries
Database Management System DBMS -SQL queriesDatabase Management System DBMS -SQL queries
Database Management System DBMS -SQL queriesSABITHARASSISTANTPRO
 
Advanced Sql Training
Advanced Sql TrainingAdvanced Sql Training
Advanced Sql Trainingbixxman
 
Data Manipulation Language.pptx
Data Manipulation Language.pptxData Manipulation Language.pptx
Data Manipulation Language.pptxEllenGracePorras
 
SQL select statement and functions
SQL select statement and functionsSQL select statement and functions
SQL select statement and functionsVikas Gupta
 
Sql basic things
Sql basic thingsSql basic things
Sql basic thingsNishil Jain
 
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...SakkaravarthiS1
 
Cursors, triggers, procedures
Cursors, triggers, proceduresCursors, triggers, procedures
Cursors, triggers, proceduresVaibhav Kathuria
 
mysql.ppt
mysql.pptmysql.ppt
mysql.pptnawaz65
 
Database COMPLETE
Database COMPLETEDatabase COMPLETE
Database COMPLETEAbrar ali
 
Structure query language (sql)
Structure query language (sql)Structure query language (sql)
Structure query language (sql)Nalina Kumari
 

Similar to STRUCTURE OF SQL QUERIES (20)

SQL Query
SQL QuerySQL Query
SQL Query
 
PPT of Common Table Expression (CTE), Window Functions, JOINS, SubQuery
PPT  of Common Table Expression (CTE), Window Functions, JOINS, SubQueryPPT  of Common Table Expression (CTE), Window Functions, JOINS, SubQuery
PPT of Common Table Expression (CTE), Window Functions, JOINS, SubQuery
 
DATABASE MANAGMENT SYSTEM (DBMS) AND SQL
DATABASE MANAGMENT SYSTEM (DBMS) AND SQLDATABASE MANAGMENT SYSTEM (DBMS) AND SQL
DATABASE MANAGMENT SYSTEM (DBMS) AND SQL
 
DBMS and SQL(structured query language) .pptx
DBMS and SQL(structured query language) .pptxDBMS and SQL(structured query language) .pptx
DBMS and SQL(structured query language) .pptx
 
Interview Questions.pdf
Interview Questions.pdfInterview Questions.pdf
Interview Questions.pdf
 
chapter9-SQL.pptx
chapter9-SQL.pptxchapter9-SQL.pptx
chapter9-SQL.pptx
 
Assg2 b 19121033-converted
Assg2 b 19121033-convertedAssg2 b 19121033-converted
Assg2 b 19121033-converted
 
Data Base Management System - Basic Structure of SQL Queries
Data Base Management System - Basic Structure of SQL QueriesData Base Management System - Basic Structure of SQL Queries
Data Base Management System - Basic Structure of SQL Queries
 
Database Management System DBMS -SQL queries
Database Management System DBMS -SQL queriesDatabase Management System DBMS -SQL queries
Database Management System DBMS -SQL queries
 
SQL.ppt
SQL.pptSQL.ppt
SQL.ppt
 
Advanced Sql Training
Advanced Sql TrainingAdvanced Sql Training
Advanced Sql Training
 
Data Manipulation Language.pptx
Data Manipulation Language.pptxData Manipulation Language.pptx
Data Manipulation Language.pptx
 
SQL select statement and functions
SQL select statement and functionsSQL select statement and functions
SQL select statement and functions
 
Sql basic things
Sql basic thingsSql basic things
Sql basic things
 
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
 
Cursors, triggers, procedures
Cursors, triggers, proceduresCursors, triggers, procedures
Cursors, triggers, procedures
 
Mysql
MysqlMysql
Mysql
 
mysql.ppt
mysql.pptmysql.ppt
mysql.ppt
 
Database COMPLETE
Database COMPLETEDatabase COMPLETE
Database COMPLETE
 
Structure query language (sql)
Structure query language (sql)Structure query language (sql)
Structure query language (sql)
 

More from VENNILAV6

WORKING WITH GRAPHICS
WORKING WITH GRAPHICSWORKING WITH GRAPHICS
WORKING WITH GRAPHICSVENNILAV6
 
CREATING A MASTER PAGE
CREATING A MASTER PAGECREATING A MASTER PAGE
CREATING A MASTER PAGEVENNILAV6
 
CREATING A NEW PUBLICATION IN PAGEMAKER
CREATING A NEW PUBLICATION IN PAGEMAKERCREATING A NEW PUBLICATION IN PAGEMAKER
CREATING A NEW PUBLICATION IN PAGEMAKERVENNILAV6
 
Relational algebra
Relational algebraRelational algebra
Relational algebraVENNILAV6
 
Joins & constraints
Joins & constraintsJoins & constraints
Joins & constraintsVENNILAV6
 
Database architecture
Database architectureDatabase architecture
Database architectureVENNILAV6
 
Data definition language
Data definition languageData definition language
Data definition languageVENNILAV6
 
INTERCONNECTION STRUCTURE
INTERCONNECTION STRUCTUREINTERCONNECTION STRUCTURE
INTERCONNECTION STRUCTUREVENNILAV6
 
CACHE MEMORY
CACHE MEMORYCACHE MEMORY
CACHE MEMORYVENNILAV6
 
Machine control flow
Machine control flowMachine control flow
Machine control flowVENNILAV6
 
COMPUTER FUNCTIONS
COMPUTER FUNCTIONSCOMPUTER FUNCTIONS
COMPUTER FUNCTIONSVENNILAV6
 
EXTERNAL DEVICE
EXTERNAL DEVICEEXTERNAL DEVICE
EXTERNAL DEVICEVENNILAV6
 
CORELDRAW EXAMPLES
CORELDRAW EXAMPLESCORELDRAW EXAMPLES
CORELDRAW EXAMPLESVENNILAV6
 
BASICS OF DATA STRUCTURE
BASICS OF DATA STRUCTUREBASICS OF DATA STRUCTURE
BASICS OF DATA STRUCTUREVENNILAV6
 
object oriented system development
object oriented system development object oriented system development
object oriented system development VENNILAV6
 
virtual function
virtual functionvirtual function
virtual functionVENNILAV6
 
constructor and destructor
constructor and destructorconstructor and destructor
constructor and destructorVENNILAV6
 
BASICS OF MOBILE COMPUTING
BASICS OF MOBILE COMPUTINGBASICS OF MOBILE COMPUTING
BASICS OF MOBILE COMPUTINGVENNILAV6
 
BASICS OF JAVA
BASICS OF JAVABASICS OF JAVA
BASICS OF JAVAVENNILAV6
 

More from VENNILAV6 (20)

WORKING WITH GRAPHICS
WORKING WITH GRAPHICSWORKING WITH GRAPHICS
WORKING WITH GRAPHICS
 
CREATING A MASTER PAGE
CREATING A MASTER PAGECREATING A MASTER PAGE
CREATING A MASTER PAGE
 
CREATING A NEW PUBLICATION IN PAGEMAKER
CREATING A NEW PUBLICATION IN PAGEMAKERCREATING A NEW PUBLICATION IN PAGEMAKER
CREATING A NEW PUBLICATION IN PAGEMAKER
 
Relational algebra
Relational algebraRelational algebra
Relational algebra
 
Joins & constraints
Joins & constraintsJoins & constraints
Joins & constraints
 
Database architecture
Database architectureDatabase architecture
Database architecture
 
Data definition language
Data definition languageData definition language
Data definition language
 
INTERCONNECTION STRUCTURE
INTERCONNECTION STRUCTUREINTERCONNECTION STRUCTURE
INTERCONNECTION STRUCTURE
 
CACHE MEMORY
CACHE MEMORYCACHE MEMORY
CACHE MEMORY
 
Machine control flow
Machine control flowMachine control flow
Machine control flow
 
COMPUTER FUNCTIONS
COMPUTER FUNCTIONSCOMPUTER FUNCTIONS
COMPUTER FUNCTIONS
 
EXTERNAL DEVICE
EXTERNAL DEVICEEXTERNAL DEVICE
EXTERNAL DEVICE
 
CORELDRAW EXAMPLES
CORELDRAW EXAMPLESCORELDRAW EXAMPLES
CORELDRAW EXAMPLES
 
BASICS OF DATA STRUCTURE
BASICS OF DATA STRUCTUREBASICS OF DATA STRUCTURE
BASICS OF DATA STRUCTURE
 
object oriented system development
object oriented system development object oriented system development
object oriented system development
 
virtual function
virtual functionvirtual function
virtual function
 
constructor and destructor
constructor and destructorconstructor and destructor
constructor and destructor
 
INHERITANCE
INHERITANCEINHERITANCE
INHERITANCE
 
BASICS OF MOBILE COMPUTING
BASICS OF MOBILE COMPUTINGBASICS OF MOBILE COMPUTING
BASICS OF MOBILE COMPUTING
 
BASICS OF JAVA
BASICS OF JAVABASICS OF JAVA
BASICS OF JAVA
 

Recently uploaded

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 ClassroomPooky Knightsmith
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
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Ữ Â...Nguyen Thanh Tu Collection
 
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 functionsKarakKing
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 
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...Pooja Bhuva
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
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...pradhanghanshyam7136
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
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.pdfAdmir Softic
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
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 17Celine George
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 

Recently uploaded (20)

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
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
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Ữ Â...
 
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
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
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...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
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...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
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
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
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
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 

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.