SQL Tutorial

SQL Tutorial SQL Introduction SQL Syntax SQL Data Types SQL OPERATORS SQL COMMANDS SQL Queries

SQL Database

SQL Create Database SQL DROP Database SQL SELECT Database

SQL Table

SQL TABLE SQL CREATE TABLE SQL COPY TABLE SQL ALTER TABLE SQL DELETE SQL TRUNCATE TABLE SQL DROP TABLE SQL UPDATE TABLE SQL INSERT TABLE

SQL SELECT

SQL SELECT Statement SQL SELECT WHERE Clause SQL SELECT IN Operator SQL BETWEEN Operator SQL SELECT BETWEEN Operator SQL SELECT AND Operator SQL SELECT OR Operator SQL SELECT LIKE Operator SQL SELECT DISTINCT SQL SELECT SUM SQL SELECT MAX SQL SELECT MIN SQL SELECT AVG

SQL Clause

SQL WHERE Clause SQL GROUP BY CLAUSE SQL ORDER BY Clause SQL HAVING Clause

SQL INSERT

SQL INSERT INTO Statement SQL INSERT INTO SELECT

SQL JOIN

SQL JOIN SQL Inner Join SQL Left Join SQL Right Join SQL Full Join SQL CROSS Join

SQL OPERATOR

SQL Comparison SQL LOGICAL Operator SQL Cast Operator SQL Arithmetic

Difference

SQL vs NOSQL WHERE vs HAVING DELETE vs DROP GROUP BY vs ORDER BY DROP vs TRUNCATE SQL IN vs SQL EXISTS

MISC

SQL SubQuery SQL CASE Commit and Rollback in SQL Pattern Matching in SQL DDL Commands in SQL DML Commands in SQL Types of SQL Commands SQL COUNT SQL Primary Key SQL FOREIGN KEY SET Operators in SQL Check Constraint in SQL SQL EXCEPT SQL VIEW SQL WHERE Statement SQL CRUD Operation Where Condition in SQL TCL Commands in SQL Types of SQL JOINS SQL Nth Highest Salary SQL NOT OPERATOR SQL UNION ALL SQL INTERSECT SQL Data Definition Language SQL Data Manipulation Language SQL Data Control Language SQL CONSTRAINTS SQL Aggregate Operators SQL KEYS Codd’s Rules in SQL What is SQL Injection? Trigger In SQL SQL WHERE Multiple Conditions Truncate function in SQL SQL Formatter WEB SQL SQL Auto Increment Save Point in SQL space() function in SQL

How To

How to use the BETWEEN operator in SQL How To Use INNER JOIN In SQL How to use LIKE in SQL How to use HAVING Clause in SQL How to use GROUP BY Clause in SQL How To Remove Duplicates In SQL How To Delete A Row In SQL How to add column in table in SQL ? How to drop a column in SQL? How to create a database in SQL? How to use COUNT in SQL? How to Create Temporary Table in SQL? How to Add Foreign Key in SQL? How to Add Comments in SQL? How To Use Group By Clause In SQL How To Use Having Clause In SQL How To Delete Column In Table How To Compare Date In SQL

SQL FULL JOIN

In this section, we will help you understand the concept of the SQL FULL Join clause with a few examples.

The SQL FULL Join query is executed to display the integrated results of the left join and right join.

The SQL FULL Join query display all the data, and the NULL value is returned at the missing place of the record.

The syntax of the SQL FULL Join is as follows:

SELECT table1.column_name1, table1.columnname2, table1.column_name3, table1.columnname4, table2.column_name1, table2.column_name2, table2.column_name3, table2.column_name4 FROM table1 FULL JOIN table2;

Let’s understand the SQL FULL Join with the help of examples.

Assume the following table, which has certain data.

Table Name 1- D_Students

Student_IdStudent_NameFirst_ SemesterSecond_ SemesterThird_ SemesterFourth_ SemesterFifth_ SemesterSixth_ SemesterTotalDepartment_ Id
202111Vineeta Sharma938885859592905
202112Vaibhav Lokhande859092808582862
202113Yash Dhull908894878590893
202114Sonali Patole959092889290914
202115Amit Sonar858382869284851
202116Meena Mishra787580748577783
202117Mahesh Kumbhar758375788076825
202118Sakshi Patil807874788077832
202119Sopan Bhore706875758080802
202220Prajwal Lokhande808585757880864
202221Anuja Wanare858886828485854
202222Venkatesh Iyer908987909291903
202223Anushka Sen707571748078801
202224Aakash Jain807572748580832
202225Akshay Agarwal858378889082893
202226Shwetali Bhagwat908385889080861
202227Priya Wagh808385808285874
202228Saurabh Sangale858380908484895
202229Manthan Koli857584788280862
202230Mayur Jain808887909290881

Table Name 2- Department

Department_IdDepartment_Name
1Computer Engineering
2Information Technology
3Mechanical Engineering
4Automobile Engineering
5Civil Engineering
6Electrical Engineering

Example 1: Write a query on the D_students and Department table where the second_semester percentage is 78.

SELECT Student_Id, Student_Name, First_Semester, Second_Semester, Third_Semester, Fourth_Semester, Fifth_Semester, Sixth_Semester, Total, Department_Name FROM D_Students FULL JOIN Department WHERE Second_Semester = 78;  

The above SQL FULL Join query joins the D_Students table and department, and displaying the records where the second_semester percentage is 78.

The output of the above example is as follows:

Student_IdStudent_NameFirst_ SemesterSecond_ SemesterThird_ SemesterFourth_ SemesterFifth_ SemesterSixth_ SemesterTotalDepartment_Name
202218Sakshi Patil80787478807783Computer Engineering
202218Sakshi Patil80787478807783Information Technology
202218Sakshi Patil80787478807783Mechanical Engineering
202218Sakshi Patil80787478807783Automobile Engineering
202218Sakshi Patil80787478807783Civil Engineering
202218Sakshi Patil80787478807783Electrical Engineering
SQL FULL JOIN

Example 2: Write a query on the D_students and Department table where Student_Name start with the letter ‘A’.

SELECT Student_Id, Student_Name, First_Semester, Second_Semester, Third_Semester, Fourth_Semester, Fifth_Semester, Sixth_Semester, Total, Department_Name FROM Department FULL JOIN D_Students WHERE Student_Name LIKE 'A%';

The above SQL FULL Join query joins the D_Students table and department, and displaying the records where the Student_Name is start with the letter 'A'.

The output of the above example is as follows:

Student_IdStudent_NameFirst_ SemesterSecond_ SemesterThird_ SemesterFourth_ SemesterFifth_ SemesterSixth_ SemesterTotalDepartment_Name
202115Amit Sonar85838286928485Computer Engineering
202115Amit Sonar85838286928485Information Technology
202115Amit Sonar85838286928485Mechanical Engineering
202115Amit Sonar85838286928485Automobile Engineering
202115Amit Sonar85838286928485Civil Engineering
202115Amit Sonar85838286928485Electrical Engineering
202221Anuja Wanare85888682848585Computer Engineering
202221Anuja Wanare85888682848585Information Technology
202221Anuja Wanare85888682848585Mechanical Engineering
202221Anuja Wanare85888682848585Automobile Engineering
202221Anuja Wanare85888682848585Civil Engineering
202221Anuja Wanare85888682848585Electrical Engineering
202223Anushka Sen70757174807880Computer Engineering
202223Anushka Sen70757174807880Information Technology
202223Anushka Sen70757174807880Mechanical Engineering
202223Anushka Sen70757174807880Automobile Engineering
202223Anushka Sen70757174807880Civil Engineering
202223Anushka Sen70757174807880Electrical Engineering
202224Aakash Jain80757274858083Computer Engineering
202224Aakash Jain80757274858083Information Technology
202224Aakash Jain80757274858083Mechanical Engineering
202224Aakash Jain80757274858083Automobile Engineering
202224Aakash Jain80757274858083Civil Engineering
202224Aakash Jain80757274858083Electrical Engineering
202225Akshay Agarwal85837888908289Computer Engineering
202225Akshay Agarwal85837888908289Information Technology
202225Akshay Agarwal85837888908289Mechanical Engineering
202225Akshay Agarwal85837888908289Automobile Engineering
202225Akshay Agarwal85837888908289Civil Engineering
202225Akshay Agarwal85837888908289Electrical Engineering
SQL FULL JOIN



ADVERTISEMENT
ADVERTISEMENT