Cross join में कोई join शर्त नहीं होती। इसलिए पहली टेबल की हर पंक्ति, दूसरी टेबल की हर पंक्ति से जुड़ जाती है। यह रिलेशनल अलजेब्रा का Cartesian product ही है। पहली टेबल में m और दूसरी में n पंक्तियाँ हों तो नतीजे में m × n पंक्तियाँ आएँगी। Self join में टेबल अपने से जुड़ती है और आम तौर पर शर्त लगती है। Left और right outer join बिना मेल की शर्त के बनते ही नहीं।
A cross join has no join condition. So every row of the first table is paired with every row of the second table. It is the Cartesian product of relational algebra. If the first table has m rows and the second has n rows, the result has m × n rows. In a self join a table is joined with itself, usually with a condition. Left and right outer joins cannot be formed without a matching condition.
प्रश्न 2उत्तर + हल
डेटाबेस के दो relations R1 और R2 पर intersection (प्रतिच्छेदन) ऑपरेशन है:
The intersection operation on two relations R1 and R2 of a database is:
Aसाहचर्य (associative) है पर क्रमविनिमेय (commutative) नहींAssociative but not commutative
Bक्रमविनिमेय है पर साहचर्य नहींCommutative but not Associative
Cसाहचर्य और क्रमविनिमेय दोनोंBoth Associative and commutative
Dन साहचर्य, न क्रमविनिमेयNeither Associative nor commutative
सही उत्तर / Answer: (C)
हल / Solution
Intersection दोनों relations की साझा tuples देता है, इसलिए क्रम बदलने से नतीजा नहीं बदलता: R1 ∩ R2 = R2 ∩ R1। यह क्रमविनिमेय (commutative) गुण है। तीन relations हों तो समूह बनाने का ढंग भी नतीजा नहीं बदलता: (R1 ∩ R2) ∩ R3 = R1 ∩ (R2 ∩ R3)। यह साहचर्य (associative) गुण है। दोनों गुण एक साथ सच हैं, इसलिए बाक़ी तीन विकल्प, जो किसी एक गुण को नकारते हैं, ग़लत हैं।
Intersection returns the tuples common to both relations, so changing the order does not change the result: R1 ∩ R2 = R2 ∩ R1. This is the commutative property. With three relations, the grouping does not change the result either: (R1 ∩ R2) ∩ R3 = R1 ∩ (R2 ∩ R3). This is the associative property. Both hold together, so the other three options, which deny one property, are wrong.
प्रश्न 3उत्तर + हल
रिलेशनल अलजेब्रा में कौन-सा मौलिक (fundamental) ऑपरेशन नहीं है?
Which is not a fundamental operation in relational algebra?
रिलेशनल अलजेब्रा के छह मौलिक ऑपरेशन हैं: select, project, union, set difference, Cartesian product और rename। Natural join इनमें नहीं है। उसे इन्हीं से बनाया जा सकता है: पहले R × S, फिर साझा कॉलम के बराबर होने की शर्त पर σ, और आख़िर में π से दोहराया कॉलम हटाना। इसलिए natural join derived ऑपरेशन है। Cartesian product, set difference और rename तीनों मौलिक सूची में हैं।
Relational algebra has six fundamental operations: select, project, union, set difference, Cartesian product and rename. Natural join is not one of them. It can be built from these: first R × S, then σ on equality of the common columns, and finally π to drop the repeated column. So natural join is a derived operation. Cartesian product, set difference and rename are all in the fundamental list.
प्रश्न 4उत्तर + हल
________ साझा मानों के आधार पर दो टेबलों को मिलाकर पंक्तियाँ लौटाता है।
The ________ returns rows after combining two tables based on common values.
ADifference (अंतर)Difference
BProduct (गुणनफल)Product
CJoin (जोड़)Join
DUnion (सम्मिलन)Union
सही उत्तर / Answer: (C)
हल / Solution
Join दो टेबलों को साझा कॉलम के बराबर मानों पर मिलाता है और जुड़ी हुई पंक्तियाँ लौटाता है। जैसे Employee(Emp_ID, Name, Dept_ID) और Department(Dept_ID, Dept_Name) को Dept_ID पर join करने से हर कर्मचारी के साथ विभाग का नाम मिलता है। Product भी पंक्तियाँ मिलाता है, पर वह मान नहीं देखता और हर जोड़ी बनाता है। Difference घटाता है। Union पंक्तियाँ एक सूची में रखता है, जोड़ता नहीं।
A join combines two tables on equal values in a shared column and returns the combined rows. Joining Employee(Emp_ID, Name, Dept_ID) with Department(Dept_ID, Dept_Name) on Dept_ID gives each employee's department name. A product also combines rows, but it ignores the values and forms every pair. Difference subtracts rows. Union puts rows into one list without combining them.
प्रश्न 5उत्तर + हल
किसी टेबल को उसी टेबल से join करना कहलाता है:
A table joined with itself is called:
AJoin (जोड़)Join
BSelf Join (स्व-जोड़)Self Join
COuter Join (बाहरी जोड़)Outer Join
DEqui Join (समता जोड़)Equi Join
सही उत्तर / Answer: (B)
हल / Solution
जब कोई टेबल अपने ही साथ join होती है, उसे self join कहते हैं। इसके लिए एक ही टेबल को दो अलग नाम (alias) दिए जाते हैं, जैसे Employee E और Employee M। फिर E.ManagerID = M.EmpID लिखकर हर कर्मचारी के साथ उसके मैनेजर का नाम निकाला जा सकता है। Join आम नाम है, इस ख़ास स्थिति का नहीं। Outer join बेमेल पंक्तियाँ रखता है। Equi join सिर्फ़ = वाली शर्त बताता है।
When a table is joined with itself, it is called a self join. The same table is given two different aliases, such as Employee E and Employee M. Then E.ManagerID = M.EmpID lists each employee next to the name of his manager. Join is the general term, not the name of this case. An outer join keeps unmatched rows. An equi join only describes a condition using =.
प्रश्न 6उत्तर + हल
निम्नलिखित में से कौन-सा रिलेशनल अलजेब्रा ऑपरेशन समुच्चय सिद्धांत (set theory) से नहीं लिया गया है?
Which of the following relational algebra operations is not from set theory?
रिलेशनल अलजेब्रा के ऑपरेशन दो समूहों में बाँटे जाते हैं। पहला समूह गणित के समुच्चय सिद्धांत से आया है: union, intersection, set difference और Cartesian product। दूसरा समूह ख़ास तौर पर relations के लिए बना है: select, project, rename और join। Select (σ) किसी शर्त पर पंक्तियाँ छाँटता है, और यह ऑपरेशन साधारण समुच्चयों में नहीं होता। इसलिए select समुच्चय सिद्धांत से नहीं है, बाक़ी तीनों हैं।
Relational algebra operations fall into two groups. The first comes from mathematical set theory: union, intersection, set difference and Cartesian product. The second was designed specially for relations: select, project, rename and join. Select (σ) filters rows by a condition, which is not an operation of ordinary set theory. So select is not from set theory, while the other three are.
प्रश्न 7उत्तर + हल
टेबल में कॉलम (स्तंभ) हटाने का काम ________ ऑपरेशन से किया जाता है।
The operation of eliminating columns in a table is done by the ________ operation.
ARestrict (प्रतिबंध)Restrict
BProject (प्रक्षेपण)Project
CUnion (सम्मिलन)Union
DDivide (भाग)Divide
सही उत्तर / Answer: (B)
हल / Solution
Project (π) ऑपरेशन टेबल से सिर्फ़ चुने हुए कॉलम रखता है और बाक़ी कॉलम हटा देता है। जैसे π Name, Salary (Employee) में सिर्फ़ नाम और वेतन बचेंगे। मूल रिलेशनल अलजेब्रा में π दोहराई पंक्तियाँ भी हटा देता है। Restrict, select का ही दूसरा नाम है; यह पंक्तियाँ छाँटता है, कॉलम नहीं। Union दो टेबल की पंक्तियाँ मिलाता है। Divide 'सभी के लिए' वाली क्वेरी में काम आता है।
The Project (π) operation keeps only the chosen columns of a table and removes the rest. In π Name, Salary (Employee) only the name and salary remain. In pure relational algebra π also removes duplicate rows. Restrict is another name for select; it filters rows, not columns. Union combines the rows of two tables. Divide is used for 'for all' type queries.
प्रश्न 8उत्तर + हल
निम्नलिखित में से कौन-सा तुलना (comparison) ऑपरेटर नहीं है?
Which of the following is not a comparison operator?
A<>
B<
C=<
D>=
सही उत्तर / Answer: (C)
हल / Solution
SQL और रिलेशनल अलजेब्रा में मान्य तुलना ऑपरेटर हैं: =, <>, <, >, <= और >=। 'छोटा या बराबर' के लिए चिह्नों का क्रम तय है; पहले < और फिर =, यानी <=। उलटा लिखा =< कोई ऑपरेटर नहीं है, इसलिए क्वेरी में लिखने पर syntax error आएगा। <> 'बराबर नहीं' है, < 'छोटा है' और >= 'बड़ा या बराबर' है। तीनों मान्य हैं, इसलिए उत्तर =< है।
The valid comparison operators in SQL and relational algebra are =, <>, <, >, <= and >=. For 'less than or equal to' the order of the symbols is fixed: first < and then =, giving <=. The reversed form =< is not an operator and gives a syntax error in a query. <> means 'not equal', < means 'less than' and >= means 'greater than or equal to'. All three are valid, so the answer is =<.
प्रश्न 9उत्तर + हल
निम्नलिखित में से कौन relational डेटा के साथ काम करने (manipulation) के लिए ऑपरेशनों का मूल समूह है?
Which of the following constitutes a basic set of operations for manipulating relational data?
रिलेशनल अलजेब्रा select, project, union, set difference, Cartesian product और rename जैसे ऑपरेशनों का समूह है। इन्हीं से relational डेटा पर हर मूल क्वेरी बनती है, और DBMS अंदर से SQL क्वेरी को भी इसी रूप में बदलकर चलाता है। Relational calculus ऑपरेशन नहीं देता, वह सिर्फ़ शर्त लिखने की भाषा है। Predicate calculus तर्कशास्त्र की पद्धति है। SQL व्यावहारिक क्वेरी भाषा है, जो इन्हीं विचारों पर बनी है।
Relational algebra is a set of operations such as select, project, union, set difference, Cartesian product and rename. Every basic query on relational data is built from these, and a DBMS internally turns SQL queries into this form before running them. Relational calculus gives no operations; it is a language for stating conditions. Predicate calculus is a system of logic. SQL is a practical query language built on these ideas.
प्रश्न 10उत्तर + हल
साझा (common) कॉलम किस join में हटा दिया जाता है?
The common column is eliminated in:
ATheta join (थीटा जोड़)theta join
BEqui join (समता जोड़)equi join
CNatural join (प्राकृतिक जोड़)natural join
DComposed join (संयुक्त जोड़)composed join
सही उत्तर / Answer: (C)
हल / Solution
Natural join एक जैसे नाम वाले कॉलम पर अपने आप बराबरी की शर्त लगाता है और नतीजे में उस साझा कॉलम को एक ही बार रखता है। जैसे Student(RollNo, Name) और Marks(RollNo, Marks) का natural join (RollNo, Name, Marks) देगा। Equi join में भी शर्त = वाली होती है, पर दोनों टेबल का कॉलम नतीजे में बना रहता है। Theta join किसी भी तुलना से जुड़ता है और कॉलम नहीं हटाता। Composed join मानक नाम नहीं है।
A natural join automatically applies an equality condition on same-named columns and keeps that common column only once in the result. The natural join of Student(RollNo, Name) and Marks(RollNo, Marks) gives (RollNo, Name, Marks). An equi join also uses =, but the column from both tables stays in the result. A theta join may use any comparison and removes no column. Composed join is not a standard name.
आगे के 20 प्रश्नों के उत्तर और हल app मेंFliQi Question Bank — अभ्यास, हल और आपकी प्रगति