SQL Full Join
SQL Full Join is used to return all data or records when a match occurs in a Table 1 or Table 2 record and NULLs have to be filled in for missing matches on either side. It is also known as Full (OUTER) JOIN.
Full Join Syntax :
The syntax of the Full Join is −
SELECT column-name(s) FROM table1 FULL OUTER JOIN table2 ON table1.column-name = table2.column-name;
SQL Full Join Example :
Consider the Customer table with the following records -
ID | Name | Age | Address | Salary |
---|---|---|---|---|
1 | Aarav | 36 | Udaipur | 35000 |
2 | Vivaan | 33 | Mumbai | 30000 |
3 | Reyansh | 28 | Chennai | 40000 |
4 | Muhammad | 29 | Udaipur | 50000 |
5 | Sai | 27 | Mumbai | 27000 |
Consider the Order table with the following records -
OID | Date | CustomerID | Amount |
---|---|---|---|
102 | 2019-10-08 00:00:00 | 3 | 3000 |
100 | 2019-10-08 00:00:00 | 3 | 1500 |
101 | 2019-11-20 00:00:00 | 2 | 1800 |
103 | 2018-05-20 00:00:00 | 4 | 2500 |
TEST CASE 1 :-Let us join these two tables using the Full JOIN as follows
SELECT ID, Name, Amount, Date FROM Customer FULL JOIN Order ON Customer.ID = Order.Customer;
The result for the respective sql query is as follows −
ID | Name | Amount | Date |
---|---|---|---|
1 | Aarav | NULL | NULL |
2 | Vivaan | 1800 | 2019-11-20 00:00:00 |
3 | Reyansh | 3000 | 2019-10-08 00:00:00 |
3 | Reyansh | 1500 | 2019-10-08 00:00:00 |
4 | Muhammad | 2500 | 2018-05-20 00:00:00 |
5 | Sai | NULL | NULL |
3 | Reyansh | 3000 | 2019-10-08 00:00:00 |
3 | Reyansh | 1500 | 2019-10-08 00:00:00 |
2 | Vivaan | 1800 | 2019-11-20 00:00:00 |
4 | Muhammad | 2500 | 2018-05-20 00:00:00 |
Visit :
Discussion
pHqghUme
555
pHqghUme
555
pHqghUme
555
pHqghUme
-1 OR 2+437-437-1=0+0+0+1 --
pHqghUme
-1 OR 3+437-437-1=0+0+0+1 --
pHqghUme
-1 OR 3*2<(0+5+437-437) --
pHqghUme
-1 OR 3*2>(0+5+437-437) --
pHqghUme
-1 OR 2+323-323-1=0+0+0+1
pHqghUme
-1 OR 3+323-323-1=0+0+0+1
pHqghUme
-1 OR 3*2<(0+5+323-323)
pHqghUme
-1 OR 3*2>(0+5+323-323)
pHqghUme
-1' OR 2+168-168-1=0+0+0+1 --
pHqghUme
-1' OR 3+168-168-1=0+0+0+1 --
pHqghUme
-1' OR 3*2<(0+5+168-168) --
pHqghUme
-1' OR 3*2>(0+5+168-168) --
pHqghUme
-1' OR 2+484-484-1=0+0+0+1 or 'krBlceZC'='
pHqghUme
-1' OR 3+484-484-1=0+0+0+1 or 'krBlceZC'='
pHqghUme
-1' OR 3*2<(0+5+484-484) or 'krBlceZC'='
pHqghUme
-1' OR 3*2>(0+5+484-484) or 'krBlceZC'='
pHqghUme
-1" OR 2+580-580-1=0+0+0+1 --
pHqghUme
-1" OR 3+580-580-1=0+0+0+1 --
pHqghUme
-1" OR 3*2<(0+5+580-580) --
pHqghUme
-1" OR 3*2>(0+5+580-580) --
pHqghUme
if(now()=sysdate(),sleep(15),0)
pHqghUme
0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
pHqghUme
0"XOR(if(now()=sysdate(),sleep(15),0))XOR"Z
pHqghUme
(select(0)from(select(sleep(15)))v)/*'+(select(0)from(select(sleep(15)))v)+'"+(select(0)from(select(sleep(15)))v)+"*/
pHqghUme
-1; waitfor delay '0:0:15' --
pHqghUme
-1); waitfor delay '0:0:15' --
pHqghUme
1 waitfor delay '0:0:15' --
pHqghUme
pAewF9ss'; waitfor delay '0:0:15' --
pHqghUme
-5 OR 757=(SELECT 757 FROM PG_SLEEP(15))--
pHqghUme
-5) OR 868=(SELECT 868 FROM PG_SLEEP(15))--
pHqghUme
-1)) OR 772=(SELECT 772 FROM PG_SLEEP(15))--
pHqghUme
e0RCmrZa' OR 865=(SELECT 865 FROM PG_SLEEP(15))--
pHqghUme
AeKcRT5U') OR 530=(SELECT 530 FROM PG_SLEEP(15))--
pHqghUme
QSTbo7KA')) OR 15=(SELECT 15 FROM PG_SLEEP(15))--
pHqghUme
555*DBMS_PIPE.RECEIVE_MESSAGE(CHR(99)||CHR(99)||CHR(99),15)
pHqghUme
555'||DBMS_PIPE.RECEIVE_MESSAGE(CHR(98)||CHR(98)||CHR(98),15)||'
pHqghUme
1'"
pHqghUme
pHqghUme
@@GWePZ
pHqghUme
555
pHqghUme
555
pHqghUme
555