Skip to main content

What is non-equi join in Oracle sql? Plsql Interview question for fresher,intermediate and experienced.

 Non-equi join:







It is the type of inner join which combines the rows from two tables based on the condition. Comparison between the columns of the tables is not based on the equality operator (i.e. not equal to) or not equal sign operator like <,>,<= and >=. Matching data of the tables are based on an inequality operator rather than equality operator. It is allowing to filter the data of the tables on the basis of range conditions. It is based on the relative values which is satisfied by the tables. It is suitable to retrieve the data based on the range conditions.

It is applicable when one or more columns are using an inequality comparison. It will filter the data on the basis of range. It is the type of inner join. It is used to check the duplicate values. It is used to examine that one value in the one table will fall into the another table.

SYNTAX:

SELECT * FROM table1 JOIN table2 ON table1.column_name>=table2.column_name;

In the above syntax, we are joining table1 and table2 because the values in table1.column_name are greater than or equals to the values in table2.column_name. It will return all the rows where this condition is true.

select * from emp JOIN dept ON emp.deptno<dept.deptno
where emp.sal>3000;

In the above query, it will select all the columns from the emp and dept table. The value emp.deptno is less than the dept.deptno and emp.sal is greater than 3000."<" is the join operator instead of equality operator.

Usage:

 It will filter the data on the basis of range. It is used to filter the emp data based on the range of dept.
 It is used for finding the gaps in the inventory management data when there are no matching orders between the table's customer orders and inventory products. 
It is used to analyze the trends over the time. It is used to analyze the changes in the product prices over time for the product and customer orders tables.
It is used for combining the multiple conditions in the single join.
Checking for the duplicate data between the tables.
Calculating the total data.

Comments

Popular posts from this blog

Difference between union and union all in oracle sql plsql

"This is one of the most important questions that interviewer might be asking in an interview.Infyosis,Linked group,Kyndryl,Vodafone Idea,IBM and Mphasis etc" INTRODUCTION: It is said to be set operators which is used to combine, add or concatenate two or more result sets. It is used in the multiple select statements where to combine to produce the final desired results.In other words,multiple select statements of similar column name in same order and having same data type to produce the unified result.In MIS datalake,when you are adding the modules of GST reconciliation which is to be used in micros in Excel or VB script, union and union all set operator is preferred for eliminating duplicate records or keeping duplicate records as per business requirement. Column must be of the same datatype for these operations of one select statement with another select statements. Columns must be in the same order in this set operators in the multiple select statements. Same number of co...

Difference between decode and case oracle sql plsql interview question and answer

" This is the most accepted question for PLSQL developer role.It has been asked in many interviews like Mphasis and Kyndryl. "  INTRODUCTION: Case was came after oracle database version 8.1.6 whereas decode was came before oracle database version 8.1.6 .Decode and case statements in an oracle work or acts like if then elsif conditional statements. if sal='2000000' then 'General Manager' elsif sal='3000000' then 'Senior Manager' elsif sal='1200000' then 'Manager' else 'Employee' end if; create table student_details(Student_RollNo Number,Student_Name Varchar2(20),student_marks Number,student_result varchar2(1)); insert into student_details values (100,'Rahul',90,'P'); insert into student_details values (101,'Rakesh',30,'F'); insert into student_details values (102,'Ram',60,'P'); insert into student_details values (103,'Rohan',10,'F'); insert into student_detai...

Explain oracle pl sql datatypes interview question and answer for fresher and experienced.

 Oracle PLSQL Data Types : PLSQL constant,value,variable,parameter,function which return the value are having the data type. It will determine the storage space information occupied and occurred in the memory or storage format and range constraints for valid values and operations as per specified size limit. It will determine how the data will be going to stored, handled and treated by the oracle engine during the period of processing and storage. It is used in the PLSQL blocks. It allows you to define your sub-types. PLSQL codes are embedded into the java program. Subtypes are used to make the data types compatible with data types used in the PLSQL program while embedding the PLSQL code into the java program. Subtype will be compatible with ANSI/ISO & IBM. It provides the pre-defined data types. Pre-defined data types are categorized into the four types: Composite LOB Reference Scalar Scalar Datatypes: It stores the values without the internal components. It holds the single ...