SlideShare una empresa de Scribd logo
1 de 19
By : Abhishek Gautam
 SQL stands for Structured Query Language.
 SQL is a database management language for relational databases.
 SQL lets you access and manipulate databases.
 SQL queries are not case sensitive. (SELECT = select)
 Data Manipulation Language (DML) is used to add, update or
delete data . Examples: INSERT, DELETE and UPDATE.
 Data Definition Language (DDL) is used for managing tables and
index structures. Examples: CREATE, ALTER,TRUNCATE and
DROP.
 Data Control Language (DCL) is used to assign and revoke
database rights and permissions. Its main statements are GRANT
and REVOKE.
 SELECT - extracts data from a database
 UPDATE - updates data in a database
 DELETE - deletes data from a database
 INSERT INTO - inserts new data into a database
 CREATETABLE - creates a new table
 ALTERTABLE - modifies a table
 DROPTABLE - deletes a table
 The CREATETABLE statement is used to create a table in a
database.
 CREATETABLE table_name(
column_name1 data_type(size),
column_name2 data_type(size),
column_name3 data_type(size),
....
);
 E.g. : CREATETABLE People(
ID int,
FirstName varchar(255),
LastName varchar(255),
);
 The INSERT INTO statement is used to insert new records in a
table.
 INSERT INTO table_name
(column1, column2,..)
VALUES ( Value1,Value2,…)
 E.g. : INSERT INTO Customers(ID, FirstName, LastName)
VALUES (1,’Abhi’,’Gautam’)
 The UPDATE statement is used to update existing records in a
table.
 UPDATE table_name
SET column1=value1,column2=value2,...
WHERE some_column=some_value;
 E.g. : UPDATE Customers
SET FirstName =‘Abhishek'
WHERE ID=1;
 The DELETE statement is used to delete records in a table.
 DELETE FROM table_name
WHERE some_column=some_value;
 E.g. : DELETE FROM Customers
WHERE FirstName =‘Abhishek'
 The ALTERTABLE statement is used to add, delete, or modify columns
in an existing table.
 ALTERTABLE table_name
ADD column_name datatype
 ALTERTABLE table_name
DROP COLUMN column_name
 ALTERTABLE table_name
ALTER COLUMN column_name datatype
 The DROPTABLE statement is used to delete an existing table.
 DROPTABLETable_Name;
 E.g. : DROPTABLE Customers;
 SELECT * FROM table_name;
 SELECT column_name,column_name
FROM table_name;
 E.g. : SELECT * FROM Customers;
SELECT FirstName FROM Customers;
 The SELECT DISTINCT statement is used to return only distinct
(different) values.
 SELECT DISTINCT column_name,column_name
FROM table_name;
 E.g. : SELECT DISTINCT FirstName FROM Customers;
 The WHERE clause is used to filter records.
 SELECT column_name,column_name
FROM table_name
WHERE column_name operator value;
 E.g. : SELECT DISTINCT FirstName FROM People
WHERE ID=5;
 The AND operator displays a record if both the first condition AND the
second condition are true.
 The OR operator displays a record if either the first condition OR the
second condition is true.
 E.g. : SELECT * FROM Customers
WHERE FirstName=‘Abhishek'
AND LastName=‘Gautam';
 SELECT * FROM Customers
WHERE FirstName=‘Abhishek'
OR LastName=‘Gautam';
 GROUP BY clause is used to group the result based on the Column
named in the GROUP BY clause.
 SELECT Col_list FROM Table_Name
WHERE where_condition
GROUP BY col_list ;
 ORDER BY clause is used to organize the result in ascending or
descending order based on the Column named in the ORDER BY
clause. Ascending order segregation is by default, to organize the
result in descending order we have to use DESC clause.
 SELECT Col_list FROMTable_Name WHERE where_condition
GROUP BY col_list
ORDER BY col_name DESC ;
 JOIN clause is used to get result from two or more table which have
a common column.
 SELECT a.col_name,b.col_name FROM
Table1_Name a
JOIN Table2_Name b
ON a.col_Name=b.col_Name;
 INNER JOIN: Returns all rows when there is at least one match in BOTH
tables
 LEFT JOIN: Return all rows from the left table, and the matched rows
from the right table
 RIGHT JOIN: Return all rows from the right table, and the matched rows
from the left table
 FULL JOIN: Return all rows when there is a match inONE of the tables
 User Defined functions
 Built-in functions
 COUNT()
 MAX()
 REPLACE()
 SUBSTRING()

Más contenido relacionado

La actualidad más candente

La actualidad más candente (16)

Sql commands
Sql commandsSql commands
Sql commands
 
STRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIESSTRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIES
 
Oracle: Joins
Oracle: JoinsOracle: Joins
Oracle: Joins
 
MySQL JOIN & UNION
MySQL JOIN & UNIONMySQL JOIN & UNION
MySQL JOIN & UNION
 
Sql joins
Sql joinsSql joins
Sql joins
 
SQL JOINS
SQL JOINSSQL JOINS
SQL JOINS
 
Join query
Join queryJoin query
Join query
 
Join sql
Join sqlJoin sql
Join sql
 
Sql join
Sql  joinSql  join
Sql join
 
MySQL notes - Basic Commands and Definitions
MySQL notes - Basic Commands and DefinitionsMySQL notes - Basic Commands and Definitions
MySQL notes - Basic Commands and Definitions
 
Joins And Its Types
Joins And Its TypesJoins And Its Types
Joins And Its Types
 
SQL Joins
SQL JoinsSQL Joins
SQL Joins
 
Sql – Structured Query Language
Sql – Structured Query LanguageSql – Structured Query Language
Sql – Structured Query Language
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functions
 
Sql commands
Sql commandsSql commands
Sql commands
 
Sql joins inner join self join outer joins
Sql joins inner join self join outer joinsSql joins inner join self join outer joins
Sql joins inner join self join outer joins
 

Similar a SQL : Structured Query Language

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
 
Avinash database
Avinash databaseAvinash database
Avinash databaseavibmas
 
SQL Tutorial for Beginners
SQL Tutorial for BeginnersSQL Tutorial for Beginners
SQL Tutorial for BeginnersAbdelhay Shafi
 
Mysql 120831075600-phpapp01
Mysql 120831075600-phpapp01Mysql 120831075600-phpapp01
Mysql 120831075600-phpapp01sagaroceanic11
 
SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL CommandsShrija Madhu
 
Introduction to sql new
Introduction to sql newIntroduction to sql new
Introduction to sql newSANTOSH RATH
 
SQL Class Note By Amit Maity PowerPoint Presentation
SQL Class Note By Amit Maity PowerPoint PresentationSQL Class Note By Amit Maity PowerPoint Presentation
SQL Class Note By Amit Maity PowerPoint Presentationmaitypradip938
 
Creating database using sql commands
Creating database using sql commandsCreating database using sql commands
Creating database using sql commandsBelle Wx
 
Creating a database
Creating a databaseCreating a database
Creating a databaseRahul Gupta
 
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
 
SQL Quick Reference Card
SQL Quick Reference CardSQL Quick Reference Card
SQL Quick Reference CardTechcanvass
 

Similar a SQL : Structured Query Language (20)

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
 
Sql
SqlSql
Sql
 
SQL
SQLSQL
SQL
 
Avinash database
Avinash databaseAvinash database
Avinash database
 
SQL Query
SQL QuerySQL Query
SQL Query
 
SQL Tutorial for Beginners
SQL Tutorial for BeginnersSQL Tutorial for Beginners
SQL Tutorial for Beginners
 
Oraclesql
OraclesqlOraclesql
Oraclesql
 
Mysql 120831075600-phpapp01
Mysql 120831075600-phpapp01Mysql 120831075600-phpapp01
Mysql 120831075600-phpapp01
 
SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL Commands
 
Introduction to sql new
Introduction to sql newIntroduction to sql new
Introduction to sql new
 
MySQL Essential Training
MySQL Essential TrainingMySQL Essential Training
MySQL Essential Training
 
SQL Class Note By Amit Maity PowerPoint Presentation
SQL Class Note By Amit Maity PowerPoint PresentationSQL Class Note By Amit Maity PowerPoint Presentation
SQL Class Note By Amit Maity PowerPoint Presentation
 
Creating database using sql commands
Creating database using sql commandsCreating database using sql commands
Creating database using sql commands
 
DBMS.pdf
DBMS.pdfDBMS.pdf
DBMS.pdf
 
Sql Tags
Sql TagsSql Tags
Sql Tags
 
Creating a database
Creating a databaseCreating a database
Creating a database
 
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...
 
Les10
Les10Les10
Les10
 
SQL Quick Reference Card
SQL Quick Reference CardSQL Quick Reference Card
SQL Quick Reference Card
 
MY SQL
MY SQLMY SQL
MY SQL
 

Más de Abhishek Gautam

Más de Abhishek Gautam (7)

Power Bi Basics
Power Bi BasicsPower Bi Basics
Power Bi Basics
 
Apache Pig
Apache PigApache Pig
Apache Pig
 
Apache Hive
Apache HiveApache Hive
Apache Hive
 
Big data
Big dataBig data
Big data
 
Rsa cryptosystem
Rsa cryptosystemRsa cryptosystem
Rsa cryptosystem
 
Enterprise application environment
Enterprise application environmentEnterprise application environment
Enterprise application environment
 
Software testing
Software testingSoftware testing
Software testing
 

Último

Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...Amil baba
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxMuhammadAsimMuhammad6
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsvanyagupta248
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARKOUSTAV SARKAR
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxchumtiyababu
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdfAldoGarca30
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadhamedmustafa094
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Call Girls Mumbai
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network DevicesChandrakantDivate1
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"mphochane1998
 

Último (20)

Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 

SQL : Structured Query Language

  • 1. By : Abhishek Gautam
  • 2.  SQL stands for Structured Query Language.  SQL is a database management language for relational databases.  SQL lets you access and manipulate databases.  SQL queries are not case sensitive. (SELECT = select)
  • 3.  Data Manipulation Language (DML) is used to add, update or delete data . Examples: INSERT, DELETE and UPDATE.  Data Definition Language (DDL) is used for managing tables and index structures. Examples: CREATE, ALTER,TRUNCATE and DROP.  Data Control Language (DCL) is used to assign and revoke database rights and permissions. Its main statements are GRANT and REVOKE.
  • 4.  SELECT - extracts data from a database  UPDATE - updates data in a database  DELETE - deletes data from a database  INSERT INTO - inserts new data into a database  CREATETABLE - creates a new table  ALTERTABLE - modifies a table  DROPTABLE - deletes a table
  • 5.  The CREATETABLE statement is used to create a table in a database.  CREATETABLE table_name( column_name1 data_type(size), column_name2 data_type(size), column_name3 data_type(size), .... );  E.g. : CREATETABLE People( ID int, FirstName varchar(255), LastName varchar(255), );
  • 6.  The INSERT INTO statement is used to insert new records in a table.  INSERT INTO table_name (column1, column2,..) VALUES ( Value1,Value2,…)  E.g. : INSERT INTO Customers(ID, FirstName, LastName) VALUES (1,’Abhi’,’Gautam’)
  • 7.  The UPDATE statement is used to update existing records in a table.  UPDATE table_name SET column1=value1,column2=value2,... WHERE some_column=some_value;  E.g. : UPDATE Customers SET FirstName =‘Abhishek' WHERE ID=1;
  • 8.  The DELETE statement is used to delete records in a table.  DELETE FROM table_name WHERE some_column=some_value;  E.g. : DELETE FROM Customers WHERE FirstName =‘Abhishek'
  • 9.  The ALTERTABLE statement is used to add, delete, or modify columns in an existing table.  ALTERTABLE table_name ADD column_name datatype  ALTERTABLE table_name DROP COLUMN column_name  ALTERTABLE table_name ALTER COLUMN column_name datatype
  • 10.  The DROPTABLE statement is used to delete an existing table.  DROPTABLETable_Name;  E.g. : DROPTABLE Customers;
  • 11.  SELECT * FROM table_name;  SELECT column_name,column_name FROM table_name;  E.g. : SELECT * FROM Customers; SELECT FirstName FROM Customers;
  • 12.  The SELECT DISTINCT statement is used to return only distinct (different) values.  SELECT DISTINCT column_name,column_name FROM table_name;  E.g. : SELECT DISTINCT FirstName FROM Customers;
  • 13.  The WHERE clause is used to filter records.  SELECT column_name,column_name FROM table_name WHERE column_name operator value;  E.g. : SELECT DISTINCT FirstName FROM People WHERE ID=5;
  • 14.  The AND operator displays a record if both the first condition AND the second condition are true.  The OR operator displays a record if either the first condition OR the second condition is true.  E.g. : SELECT * FROM Customers WHERE FirstName=‘Abhishek' AND LastName=‘Gautam';  SELECT * FROM Customers WHERE FirstName=‘Abhishek' OR LastName=‘Gautam';
  • 15.  GROUP BY clause is used to group the result based on the Column named in the GROUP BY clause.  SELECT Col_list FROM Table_Name WHERE where_condition GROUP BY col_list ;
  • 16.  ORDER BY clause is used to organize the result in ascending or descending order based on the Column named in the ORDER BY clause. Ascending order segregation is by default, to organize the result in descending order we have to use DESC clause.  SELECT Col_list FROMTable_Name WHERE where_condition GROUP BY col_list ORDER BY col_name DESC ;
  • 17.  JOIN clause is used to get result from two or more table which have a common column.  SELECT a.col_name,b.col_name FROM Table1_Name a JOIN Table2_Name b ON a.col_Name=b.col_Name;  INNER JOIN: Returns all rows when there is at least one match in BOTH tables  LEFT JOIN: Return all rows from the left table, and the matched rows from the right table  RIGHT JOIN: Return all rows from the right table, and the matched rows from the left table  FULL JOIN: Return all rows when there is a match inONE of the tables
  • 18.
  • 19.  User Defined functions  Built-in functions  COUNT()  MAX()  REPLACE()  SUBSTRING()