SlideShare a Scribd company logo
1 of 29
• Paper Name -- Database System
• Staff -- Ms. S. Jamuna M.Sc., M.phil.,
• Class -- II Year
• Semester -- IV
• Unit -- III
• Topic -- Structured Query Language(SQL)
Query
BASIC SQL OPERATIONS:
Create, Insert, Update, Select, Delete, Alter,
Truncate, Drop, Rename
Create Query
• Command Name: CREATE
• Command Description: Create Command is used to create the
object in database.
• Query: create table table_name(attributes);
• Example:
create table Student(STDNO int(4),STDNAME varchar(10),DEPT
varchar(10));
Insert Query
• Command Name: INSERT
• Command Description: Insert command is used to insert the values
in the database.
• Query: insert into table_name values(attributes);
• Example:
insert into Student (&STDNO,&STDNAME,&DEPT) values
(101,’Aathira’,’Info Tech’),(102,’Aathvik’,’Maths’);
Update Query
• Command Name: UPDATE
• Command Description: Update command is used to update the
records from the table.
• Query: update table_name set attribute where attribute(value);
• Example:
update Student set DEPT= ‘English’ where
STUDNO=101;
Alter Query
• Command Name: ALTER
• Command Description: Alter command is used to alter the
Structure of database.
• Query: alter table_name add (values);
• Example:
alter Student add YEAR
Select Query
• Command Name: SELECT
• Command Description: Select command is used to select the
object from the database.
• Query: select * from table_name;
• Example:
select *from Student;
Delete Query
• Command Name: DELETE
• Command Description: Delete Command is used to delete the
records from the table.
• Query: Delete table_name where attributes or values;
• Example:
delete STUDENT where STDNO=102;
Drop Query
• Command Name: DROP
• Command Description: Drop command is used to delete the
objects from the database.
• Query: drop table table_name;
• Example:
drop table STUDENT;
Truncate Query
• Command Name: TRUNCATE
• Command Description: Truncate is used to remove all the
records from the table.
• Query: truncate table table_name;
• Example:
truncate table Student;
Rename Query
• Command Name: RENAME
• Command Description: Rename command is used to change
the table name.
• Query: alter table table_name rename new table_name;
• Example:
alter table Student rename STUD;
SET OPERATIONS:
Union And Union All, Intersect
Union Query
• Command Name: Union
• Command Description: This command is used to combine the
records of multiple tables having the same structure. Avoid
duplicates.
• Query: select attribute from table1 union select attribute from
table2;
• Example:
select name, dept from stud1 union select name, dept
from stud2;
Union All Query
• Command Name: Union all
• Command Description: This command is used to combine the
records of multiple tables having the same structure but including
duplicates.
• Query: select attribute from table1 union all select attribute from
table2;
• Example:
select name, dept from stud1 union all select name, dept from
stud2;
Intersect Query
• Command Name: INTERSECT
• Command Description: This command is used to give the
common records of multiple table having the same structure.
• Query: select attribute from table1 intersect select attribute
from table2;
• Example:
select name from stud1 intersect select name from stud2;
AGGREGATE FUNCTIONS:
Average, Minimum, Maximum, Count, Count(*),
Sum
Average Query
• Command Name: AVERAGE
• Command Description: This command is used to return the
average value of N ignoring null values.
• Query: select avg(attribute) result from table_name;
• Example:
select avg(salary) result from Employee;
Minimum Query
• Command Name: MINIMUM
• Command Description: This command is used to return the
minimum value of the expression.
• Query: select min(attribute) result from table_name;
• Example:
select min(salary) result from Employee;
Maximum Query
• Command Name: MAXIMUM
• Command Description: This command is used to returns
maximum values of the expressions.
• Query: select max(attribute) from table_name;
• Example:
Select max(salary) from Employee;
Count Query
• Command Name: COUNT
• Command Description: This command is used to return the
number of rows whose expressions is not null.
• Query: select count(attributes) result from table_name where
values;
• Example:
select count (Salary) result from Employee where
empno=345;
Count(*) Query
• Command Name: COUNT(*)
• Command Description: This command is used to return the
number of rows in the table including the duplicate and null
values.
• Query: select count(*)result from table_name;
• Example:
select count(*) result from employee;
Sum Query
• Command Name: SUM
• Command Description: This command is used to return the
sum of values of N.
• Query: select sum(attribute) result from table_name;
• Example:
select sum(salary) result from Employee;
JOIN OPERATIONS:
Natural Join, Left Outer Join, Right Outer Join, Full
Outer Join
Natural Join Query
• Command Name: NATRUAL JOIN
• Command Description: This command is used to combine
certain selections and a cartesian product into a one
operations.
• Query: select table1.attribute from table1 join table2
on(table1.attribute=table2.attribute)
• Example:
select emp1.name,dept from EMP join emp2
on(emp1.name=emp2.name)
Left Outer Join Query
• Command Name: LEFT OUTER JOIN
• Command Description: This Command is used to return all rows
from the left.
• Query: select table1.attribute from table1 left outer join table2
on(table1.attribute=table2.attribute)
• Example:
select emp1.name,dept from EMP left outer join emp2
on(emp1.name=emp2.name)
Right Outer Join Query
• Command Name: RIGHT OUTER JOIN
• Command Description: This command is used to return the all rows
from the right.
• Query: select table1.attribute from table1 right outer join table2
on(table1.attribute=table2.attribute)
• Example:
select emp1.name,dept from EMP right outer join emp2
on(emp1.name=emp2.name)
Full Outer Join Query
• Command Name: FULL OUTER JOIN
• Command Description: This command is used to returns all rows
from the left and right.
• Query: select table1.attribute from table1 full outer join table2
on(table1.attribute=table2.attribute)
• Example:
select emp1.name,dept from EMP full outer join emp2
on(emp1.name=emp2.name)
Structured Query Language(SQL)

More Related Content

What's hot (16)

Les11 Including Constraints
Les11 Including ConstraintsLes11 Including Constraints
Les11 Including Constraints
 
SQL-Alter Table, SELECT DISTINCT & WHERE
SQL-Alter Table, SELECT DISTINCT & WHERESQL-Alter Table, SELECT DISTINCT & WHERE
SQL-Alter Table, SELECT DISTINCT & WHERE
 
Oracle
OracleOracle
Oracle
 
8. sql
8. sql8. sql
8. sql
 
DML Commands
DML CommandsDML Commands
DML Commands
 
Sql delete, truncate, drop statements
Sql delete, truncate, drop statementsSql delete, truncate, drop statements
Sql delete, truncate, drop statements
 
Oracle: DDL
Oracle: DDLOracle: DDL
Oracle: DDL
 
Sql basics and DDL statements
Sql basics and DDL statementsSql basics and DDL statements
Sql basics and DDL statements
 
STRUCTURED QUERY LANGUAGE
STRUCTURED QUERY LANGUAGESTRUCTURED QUERY LANGUAGE
STRUCTURED QUERY LANGUAGE
 
MySQL partitions tutorial
MySQL partitions tutorialMySQL partitions tutorial
MySQL partitions tutorial
 
Java class 8
Java class 8Java class 8
Java class 8
 
Commands of DML in SQL
Commands of DML in SQLCommands of DML in SQL
Commands of DML in SQL
 
Les10
Les10Les10
Les10
 
Ddl commands
Ddl commandsDdl commands
Ddl commands
 
Les10 Creating And Managing Tables
Les10 Creating And Managing TablesLes10 Creating And Managing Tables
Les10 Creating And Managing Tables
 
Sql dml & tcl 2
Sql   dml & tcl 2Sql   dml & tcl 2
Sql dml & tcl 2
 

Similar to Structured Query Language(SQL)

Similar to Structured Query Language(SQL) (20)

Oracle naveen Sql
Oracle naveen   SqlOracle naveen   Sql
Oracle naveen Sql
 
Oracle naveen Sql
Oracle naveen   SqlOracle naveen   Sql
Oracle naveen Sql
 
SQL Views
SQL ViewsSQL Views
SQL Views
 
Its about a sql topic for basic structured query language
Its about a sql topic for basic structured query languageIts about a sql topic for basic structured query language
Its about a sql topic for basic structured query language
 
Commands
CommandsCommands
Commands
 
COMPUTERS SQL
COMPUTERS SQL COMPUTERS SQL
COMPUTERS SQL
 
Sql Queries
Sql QueriesSql Queries
Sql Queries
 
Oracle sql material
Oracle sql materialOracle sql material
Oracle sql material
 
My sql Syntax
My sql SyntaxMy sql Syntax
My sql Syntax
 
Unit - II.pptx
Unit - II.pptxUnit - II.pptx
Unit - II.pptx
 
Sql 
statements , functions & joins
Sql 
statements , functions  &  joinsSql 
statements , functions  &  joins
Sql 
statements , functions & joins
 
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasad
 
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasad
 
Views, Triggers, Functions, Stored Procedures, Indexing and Joins
Views, Triggers, Functions, Stored Procedures,  Indexing and JoinsViews, Triggers, Functions, Stored Procedures,  Indexing and Joins
Views, Triggers, Functions, Stored Procedures, Indexing and Joins
 
unit-5 sql notes.docx
unit-5 sql notes.docxunit-5 sql notes.docx
unit-5 sql notes.docx
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functions
 
DBMS.pdf
DBMS.pdfDBMS.pdf
DBMS.pdf
 
Sql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.pptSql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.ppt
 
Creating a database
Creating a databaseCreating a database
Creating a database
 
Interacting with Oracle Database
Interacting with Oracle DatabaseInteracting with Oracle Database
Interacting with Oracle Database
 

Recently uploaded

Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 

Recently uploaded (20)

Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 

Structured Query Language(SQL)

  • 1. • Paper Name -- Database System • Staff -- Ms. S. Jamuna M.Sc., M.phil., • Class -- II Year • Semester -- IV • Unit -- III • Topic -- Structured Query Language(SQL)
  • 3. BASIC SQL OPERATIONS: Create, Insert, Update, Select, Delete, Alter, Truncate, Drop, Rename
  • 4. Create Query • Command Name: CREATE • Command Description: Create Command is used to create the object in database. • Query: create table table_name(attributes); • Example: create table Student(STDNO int(4),STDNAME varchar(10),DEPT varchar(10));
  • 5. Insert Query • Command Name: INSERT • Command Description: Insert command is used to insert the values in the database. • Query: insert into table_name values(attributes); • Example: insert into Student (&STDNO,&STDNAME,&DEPT) values (101,’Aathira’,’Info Tech’),(102,’Aathvik’,’Maths’);
  • 6. Update Query • Command Name: UPDATE • Command Description: Update command is used to update the records from the table. • Query: update table_name set attribute where attribute(value); • Example: update Student set DEPT= ‘English’ where STUDNO=101;
  • 7. Alter Query • Command Name: ALTER • Command Description: Alter command is used to alter the Structure of database. • Query: alter table_name add (values); • Example: alter Student add YEAR
  • 8. Select Query • Command Name: SELECT • Command Description: Select command is used to select the object from the database. • Query: select * from table_name; • Example: select *from Student;
  • 9. Delete Query • Command Name: DELETE • Command Description: Delete Command is used to delete the records from the table. • Query: Delete table_name where attributes or values; • Example: delete STUDENT where STDNO=102;
  • 10. Drop Query • Command Name: DROP • Command Description: Drop command is used to delete the objects from the database. • Query: drop table table_name; • Example: drop table STUDENT;
  • 11. Truncate Query • Command Name: TRUNCATE • Command Description: Truncate is used to remove all the records from the table. • Query: truncate table table_name; • Example: truncate table Student;
  • 12. Rename Query • Command Name: RENAME • Command Description: Rename command is used to change the table name. • Query: alter table table_name rename new table_name; • Example: alter table Student rename STUD;
  • 13. SET OPERATIONS: Union And Union All, Intersect
  • 14. Union Query • Command Name: Union • Command Description: This command is used to combine the records of multiple tables having the same structure. Avoid duplicates. • Query: select attribute from table1 union select attribute from table2; • Example: select name, dept from stud1 union select name, dept from stud2;
  • 15. Union All Query • Command Name: Union all • Command Description: This command is used to combine the records of multiple tables having the same structure but including duplicates. • Query: select attribute from table1 union all select attribute from table2; • Example: select name, dept from stud1 union all select name, dept from stud2;
  • 16. Intersect Query • Command Name: INTERSECT • Command Description: This command is used to give the common records of multiple table having the same structure. • Query: select attribute from table1 intersect select attribute from table2; • Example: select name from stud1 intersect select name from stud2;
  • 17. AGGREGATE FUNCTIONS: Average, Minimum, Maximum, Count, Count(*), Sum
  • 18. Average Query • Command Name: AVERAGE • Command Description: This command is used to return the average value of N ignoring null values. • Query: select avg(attribute) result from table_name; • Example: select avg(salary) result from Employee;
  • 19. Minimum Query • Command Name: MINIMUM • Command Description: This command is used to return the minimum value of the expression. • Query: select min(attribute) result from table_name; • Example: select min(salary) result from Employee;
  • 20. Maximum Query • Command Name: MAXIMUM • Command Description: This command is used to returns maximum values of the expressions. • Query: select max(attribute) from table_name; • Example: Select max(salary) from Employee;
  • 21. Count Query • Command Name: COUNT • Command Description: This command is used to return the number of rows whose expressions is not null. • Query: select count(attributes) result from table_name where values; • Example: select count (Salary) result from Employee where empno=345;
  • 22. Count(*) Query • Command Name: COUNT(*) • Command Description: This command is used to return the number of rows in the table including the duplicate and null values. • Query: select count(*)result from table_name; • Example: select count(*) result from employee;
  • 23. Sum Query • Command Name: SUM • Command Description: This command is used to return the sum of values of N. • Query: select sum(attribute) result from table_name; • Example: select sum(salary) result from Employee;
  • 24. JOIN OPERATIONS: Natural Join, Left Outer Join, Right Outer Join, Full Outer Join
  • 25. Natural Join Query • Command Name: NATRUAL JOIN • Command Description: This command is used to combine certain selections and a cartesian product into a one operations. • Query: select table1.attribute from table1 join table2 on(table1.attribute=table2.attribute) • Example: select emp1.name,dept from EMP join emp2 on(emp1.name=emp2.name)
  • 26. Left Outer Join Query • Command Name: LEFT OUTER JOIN • Command Description: This Command is used to return all rows from the left. • Query: select table1.attribute from table1 left outer join table2 on(table1.attribute=table2.attribute) • Example: select emp1.name,dept from EMP left outer join emp2 on(emp1.name=emp2.name)
  • 27. Right Outer Join Query • Command Name: RIGHT OUTER JOIN • Command Description: This command is used to return the all rows from the right. • Query: select table1.attribute from table1 right outer join table2 on(table1.attribute=table2.attribute) • Example: select emp1.name,dept from EMP right outer join emp2 on(emp1.name=emp2.name)
  • 28. Full Outer Join Query • Command Name: FULL OUTER JOIN • Command Description: This command is used to returns all rows from the left and right. • Query: select table1.attribute from table1 full outer join table2 on(table1.attribute=table2.attribute) • Example: select emp1.name,dept from EMP full outer join emp2 on(emp1.name=emp2.name)