Sunday, April 10, 2022

DBMS -joins

Topics:- 

Joins
DBMS मैं Joins का प्रयोग डाटा को एक साथ दिखाने के लिए किया जाता है जो  RDBMS होता है उसमें कई tables होते हैं उन टेबल्स के टपल्स के बीच में रिलेशन बनाना तथा टपल्स को Display कराने के लिए ज्वाइन का प्रयोग किया जाता है और इसका उपयोग SQL मैं भी किया जाता है Join के लिए आपको join operation performed करना होता है जॉइन ऑपरेशन में हम Cartesian operation परफॉर्म करते हैं और उसमें Selection Process Apply करते हैं

 Join in DBMS is a binary operation which allows you to combine join product and selection in one single statement. The goal of creating a join condition is that it helps you to combine the data from two or more DBMS tables. The tables in DBMS are associated using the primary key and foreign keys

Types of Join

Inner Join

Inner Join is used to return rows from both tables which satisfy the given condition.

Theta Join

Theta Join allows you to merge two tables based on the condition represented by theta. Theta joins work for all comparison operators. It is denoted by symbol θ. Use any condition( इसमें जो Condition (>,<,=)होती है उसके हिसाब से टेबल की Tuples  को show किया जाता है)



EQUI Join

EQUI Join is done when a Theta join uses only the equivalence condition.  (इसमें जो टपल्स इक्वल होती हैं वह डिस्प्ले की जाती हैं अगर मान लीजिए Employees id और department id से एक equality show की गई है तो emp idऔर dept  Id दोनों ही show होंगी)



 


 

Natural Join ()

Natural Join does not utilize any of the comparison operators. In this type of join, the attributes should have the same name and domain. In Natural Join, there should be at least one common attribute between two relations. ( no need to give condition is automatically select same tuple) example(इसमें emp id आईडी और dept id क compare किया जाता है तो एक ही ID को लिया जाता है)








 

 

Outer Join

  • Left Outer Join
  • Right Outer Join
  • Full Outer Join

Left Outer Join (A  B)

Left Outer Join returns all the rows from the table on the left even if no matching rows have been found in the table on the right. When no matching record is found in the table on the right, NULL is returned.









 

Right Outer Join ( A  B )

Right Outer Join returns all the columns from the table on the right even if no matching rows have been found in the table on the left. Where no matches have been found in the table on the left, NULL is returned. RIGHT outer JOIN is the opposite of LEFT JOIN  










 

Full Outer Join ( A  B)

In a Full Outer Join , all tuples from both relations are included in the result, irrespective of the matching condition. Full outer join मैं Tuples को इस तरह से show किया जाता है जिससे कि दोनों Table के Content को Share किया जा सके और जो Content Condition के हिसाब से show किया जाता है.

Example 


 







 


Normormal form.

No comments:

Post a Comment