DBMS — MCQ Practice

Hindi aur English dono mein practice karo — click karo answer check karne ke liye

📚 146 Questions 🌐 Hindi + English ✅ Free
भाषा / Language:
146 questions
121
EN + हिं Medium
GB What is the probe side and build side terminology in hash join and how does the optimizer decide which table is which?
IN हैश जॉइन में जांच पक्ष और बिल्ड साइड शब्दावली क्या है और ऑप्टिमाइज़र कैसे तय करता है कि कौन सी तालिका कौन सी है?
A
The build side is the left table; probe is always the right बिल्ड साइड बाईं ओर की टेबल है; जांच हमेशा सही होती है
B
Build side is always the outer table बिल्ड साइड हमेशा बाहरी टेबल होती है
C
Build side: the SMALLER relation - loaded entirely into hash table in memory. Probe side: the LARGER relation - each row is used to probe the hash table. Optimizer assigns smaller relation as build side to minimize memory requirements निर्माण पक्ष: छोटा संबंध - पूरी तरह से मेमोरी में हैश तालिका में लोड किया गया। जांच पक्ष: बड़ा संबंध - प्रत्येक पंक्ति का उपयोग हैश तालिका की जांच के लिए किया जाता है। मेमोरी आवश्यकताओं को कम करने के लिए ऑप्टिमाइज़र बिल्ड साइड के रूप में छोटे संबंध निर्दिष्ट करता है
D
The optimizer always chooses randomly अनुकूलक हमेशा यादृच्छिक रूप से चयन करता है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Hash join phases: Build: iterate over smaller relation (build side), compute hash(join_key), store in hash table. Probe: iterate over larger relation (probe side), compute hash(join_key), look up in hash table for matches. Smaller table as build side fits hash table in memory, avoiding grace hash join overhead.
व्याख्या (हिन्दी) हैश जुड़ने के चरण: बिल्ड: छोटे संबंध (बिल्ड साइड) पर पुनरावृत्त करें, हैश (join_key) की गणना करें, हैश तालिका में स्टोर करें। जांच: बड़े संबंध (जांच पक्ष) पर पुनरावृत्ति करें, हैश (join_key) की गणना करें, मिलान के लिए हैश तालिका में देखें। बिल्ड साइड के रूप में छोटी टेबल मेमोरी में हैश टेबल को फिट करती है, ग्रेस हैश जॉइन ओवरहेड से बचती है।
122
EN + हिं Easy
GB What does RIGHT OUTER JOIN return and is there a preferred alternative?
IN राइट आउटर जॉइन क्या लौटाता है और क्या कोई पसंदीदा विकल्प है?
A
All rows from the right table plus non-matching left table rows दाहिनी तालिका की सभी पंक्तियाँ और बाईं तालिका की गैर-मिलान पंक्तियाँ
B
Only rows where the right table has NULL values केवल वे पंक्तियाँ जहाँ दाएँ तालिका में NULL मान हैं
C
All rows from RIGHT table (with NULLs for unmatched left side) and only matching rows from LEFT table - functionally equivalent to reversing table order and using LEFT OUTER JOIN (which is more readable and universally preferred) दाएँ तालिका से सभी पंक्तियाँ (बेजोड़ बाईं ओर के लिए NULL के साथ) और बाईं तालिका से केवल मेल खाने वाली पंक्तियाँ - कार्यात्मक रूप से तालिका क्रम को उलटने और LEFT OUTER JOIN का उपयोग करने के बराबर (जो अधिक पठनीय और सार्वभौमिक रूप से पसंदीदा है)
D
All rows from both tables दोनों तालिकाओं से सभी पंक्तियाँ
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) RIGHT JOIN (A, B) = LEFT JOIN (B, A) with reversed table order. Since LEFT JOIN is more natural (read left-to-right: I want all of the left table), most developers avoid RIGHT JOIN and simply reorder the tables to use LEFT JOIN. Results are identical; its a code readability convention.
व्याख्या (हिन्दी) दाएं जोड़ (ए, बी) = बाएं जोड़ (बी, ए) उलटे तालिका क्रम के साथ। चूंकि लेफ्ट जॉइन अधिक प्राकृतिक है (बाएं से दाएं पढ़ें: मुझे बाईं तालिका की सभी चीजें चाहिए), अधिकांश डेवलपर्स राइट जॉइन से बचते हैं और लेफ्ट जॉइन का उपयोग करने के लिए तालिकाओं को फिर से व्यवस्थित करते हैं। परिणाम समान हैं; यह एक कोड पठनीयता सम्मेलन है।
123
EN + हिं Easy
GB In query optimization what is join reordering with cross-product avoidance and why must the optimizer avoid cross-products?
IN क्वेरी ऑप्टिमाइज़ेशन में क्रॉस-प्रोडक्ट अवॉइडेंस के साथ जॉइन रीऑर्डरिंग क्या है और ऑप्टिमाइज़र को क्रॉस-प्रोडक्ट्स से क्यों बचना चाहिए?
A
Avoiding the use of Cartesian product notation कार्टेशियन उत्पाद संकेतन के उपयोग से बचना
B
The optimizer ensures that cross products (joins with no condition between two tables) are avoided or placed last in the join tree since they produce n times m rows with no filtering - immediately followed by a filter is converted to a join ऑप्टिमाइज़र यह सुनिश्चित करता है कि क्रॉस उत्पाद (दो तालिकाओं के बीच बिना किसी शर्त के जुड़ते हैं) को टाला जाता है या ज्वाइन ट्री में अंतिम स्थान पर रखा जाता है क्योंकि वे बिना किसी फ़िल्टरिंग के n गुना m पंक्तियों का उत्पादन करते हैं - इसके तुरंत बाद एक फ़िल्टर को एक जोड़ में बदल दिया जाता है
C
Reordering joins to be in alphabetical order पुनः क्रमित करना वर्णानुक्रम में जुड़ना है
D
Removing all cross products from query plans क्वेरी योजनाओं से सभी क्रॉस उत्पादों को हटाना
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Optimizer cross-product avoidance: in a WHERE clause, identify join conditions between tables. Group tables that have direct join conditions together. Tables with no direct join conditions connected via a cross product - optimizer delays this until after other joins have reduced row counts. Cross product early = catastrophic performance.
व्याख्या (हिन्दी) ऑप्टिमाइज़र क्रॉस-प्रोडक्ट परिहार: WHERE क्लॉज में, तालिकाओं के बीच जुड़ने की स्थिति की पहचान करें। समूह तालिकाएँ जिनमें एक साथ सीधे जुड़ने की स्थितियाँ होती हैं। क्रॉस उत्पाद के माध्यम से जुड़े बिना किसी प्रत्यक्ष जुड़ाव की स्थिति वाली तालिकाएँ - ऑप्टिमाइज़र इसमें तब तक देरी करता है जब तक कि अन्य जुड़ने से पंक्ति की संख्या कम नहीं हो जाती। क्रॉस उत्पाद जल्दी = विनाशकारी प्रदर्शन।
124
EN + हिं Medium
GB What is the difference between INNER JOIN and WHERE clause joins (implicit join syntax)?
IN इनर जॉइन और व्हेयर क्लॉज जॉइन (अंतर्निहित जॉइन सिंटैक्स) के बीच क्या अंतर है?
A
INNER JOIN cannot be used with aggregate functions इनर जॉइन का उपयोग समग्र कार्यों के साथ नहीं किया जा सकता है
B
They are semantically identical in standard SQL - both produce the same result; but INNER JOIN (explicit syntax) is preferred because it clearly separates join conditions from filter conditions making code more readable and maintainable वे मानक SQL में शब्दार्थ की दृष्टि से समान हैं - दोनों समान परिणाम देते हैं; लेकिन इनर जॉइन (स्पष्ट वाक्यविन्यास) को प्राथमिकता दी जाती है क्योंकि यह स्पष्ट रूप से जॉइन शर्तों को फ़िल्टर स्थितियों से अलग करता है जिससे कोड अधिक पठनीय और रखरखाव योग्य हो जाता है
C
WHERE clause joins are faster than INNER JOIN जहां क्लॉज जॉइन इनर जॉइन से तेज होते हैं
D
WHERE clause joins support outer joins; INNER JOIN does not जहां खंड जुड़ता है, बाहरी जुड़ाव का समर्थन करता है; इनर जॉइन नहीं है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Implicit join: SELECT * FROM A, B WHERE A.id = B.a_id AND B.status = active. Explicit join: SELECT * FROM A INNER JOIN B ON A.id = B.a_id WHERE B.status = active. Both produce identical results. Explicit preferred because: separates join conditions (ON) from filter conditions (WHERE), clearer intent, required for outer joins.
व्याख्या (हिन्दी) अंतर्निहित जुड़ाव: A, B से * चुनें जहां A.id = B.a_id और B.status = सक्रिय है। स्पष्ट जुड़ाव: चुनें * ए इनर जॉइन बी से ए.आईडी = बी.ए_आईडी पर जहां बी.स्टेटस = सक्रिय। दोनों समान परिणाम देते हैं। स्पष्ट को प्राथमिकता दी जाती है क्योंकि: जुड़ने की स्थिति (ON) को फ़िल्टर की स्थिति (WHERE) से अलग करता है, स्पष्ट इरादा, बाहरी जुड़ाव के लिए आवश्यक है।
125
EN + हिं Easy
GB What is the merge join (sort-merge join) algorithm and under what conditions is it most efficient?
IN मर्ज जॉइन (सॉर्ट-मर्ज जॉइन) एल्गोरिदम क्या है और यह किन परिस्थितियों में सबसे कुशल है?
A
A join that merges two tables into one एक जोड़ जो दो तालिकाओं को एक में मिला देता है
B
A join algorithm that merges indexes एक जॉइन एल्गोरिदम जो इंडेक्स को मर्ज करता है
C
A join that only works when tables have the same number of rows एक जुड़ाव जो केवल तभी काम करता है जब तालिकाओं में पंक्तियों की संख्या समान हो
D
A join algorithm that sorts both input relations on the join attribute then merges them in a single linear scan; most efficient when: both inputs are already sorted on the join attribute or when sorting is needed anyway (the sort cost is amortized) or when the join result is large एक जॉइन एल्गोरिदम जो जॉइन विशेषता पर दोनों इनपुट संबंधों को सॉर्ट करता है और फिर उन्हें एक एकल रैखिक स्कैन में विलय कर देता है; सबसे कुशल तब जब: दोनों इनपुट पहले से ही जॉइन विशेषता पर सॉर्ट किए गए हों या जब सॉर्टिंग की वैसे भी आवश्यकता हो (सॉर्ट लागत परिशोधित हो) या जब जॉइन परिणाम बड़ा हो
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Sort-merge join: (1) Sort R and S on join attribute (O(n log n + m log m)). (2) Merge: linearly scan both sorted relations simultaneously matching join keys (O(n+m)). Total: O(n log n + m log m). Most efficient: when inputs are pre-sorted (clustered index), when join is on primary key, or when result is large (hash join memory pressure).
व्याख्या (हिन्दी) सॉर्ट-मर्ज जॉइन: (1) जॉइन एट्रिब्यूट पर आर और एस को सॉर्ट करें (ओ(एन लॉग एन + एम लॉग एम))। (2) मर्ज: दोनों क्रमबद्ध संबंधों को एक साथ मिलान करने वाली जॉइन कुंजी (ओ (एन + एम)) को रैखिक रूप से स्कैन करें। कुल: ओ(एन लॉग एन + एम लॉग एम)। सबसे कुशल: जब इनपुट पूर्व-सॉर्ट किए जाते हैं (क्लस्टर इंडेक्स), जब जॉइन प्राथमिक कुंजी पर होता है, या जब परिणाम बड़ा होता है (हैश जॉइन मेमोरी प्रेशर)।
126
EN + हिं Medium
GB What is the difference between a hash join and a merge join in terms of memory requirements?
IN मेमोरी आवश्यकताओं के संदर्भ में हैश जॉइन और मर्ज जॉइन के बीच क्या अंतर है?
A
Merge join requires more memory than hash join मर्ज जॉइन के लिए हैश जॉइन की तुलना में अधिक मेमोरी की आवश्यकता होती है
B
They have identical memory requirements उनकी स्मृति आवश्यकताएँ समान हैं
C
Neither join algorithm uses memory कोई भी जॉइन एल्गोरिदम मेमोरी का उपयोग नहीं करता है
D
Hash join requires memory to store the entire smaller relation (build side) in a hash table - memory sensitive; merge join requires memory only for sort buffers - can spill to disk more gracefully; but merge join has higher CPU cost from sorting हैश जॉइन के लिए पूरे छोटे रिलेशन (बिल्ड साइड) को हैश टेबल में स्टोर करने के लिए मेमोरी की आवश्यकता होती है - मेमोरी सेंसिटिव; मर्ज जॉइन के लिए केवल सॉर्ट बफ़र्स के लिए मेमोरी की आवश्यकता होती है - डिस्क पर अधिक सुंदर ढंग से फैल सकता है; लेकिन मर्ज जॉइन में सॉर्टिंग से सीपीयू लागत अधिक होती है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Hash join: requires entire smaller table in memory (build phase). If it does not fit: grace hash join (partitioned to disk, more I/O). Memory sensitive. Merge join: requires sort buffers (can be small); external merge sort handles data larger than memory gracefully. Trade-off: hash join is faster when memory available; merge join more memory-resilient.
व्याख्या (हिन्दी) हैश जॉइन: मेमोरी में संपूर्ण छोटी तालिका की आवश्यकता होती है (बिल्ड चरण)। यदि यह फिट नहीं होता है: ग्रेस हैश जॉइन (डिस्क में विभाजित, अधिक I/O)। स्मृति संवेदनशील. मर्ज जॉइन: सॉर्ट बफ़र्स की आवश्यकता है (छोटा हो सकता है); बाहरी मर्ज सॉर्ट मेमोरी से बड़े डेटा को शानदार ढंग से संभालता है। ट्रेड-ऑफ़: मेमोरी उपलब्ध होने पर हैश जॉइन तेज़ होता है; मर्ज जॉइन अधिक मेमोरी-लचीला है।
127
EN + हिं Medium
GB What is the fanout problem in join optimization and how does it affect result set cardinality?
IN जॉइन ऑप्टिमाइज़ेशन में फैनआउट समस्या क्या है और यह परिणाम सेट कार्डिनैलिटी को कैसे प्रभावित करती है?
A
A performance issue when joining more than 10 tables 10 से अधिक तालिकाओं को जोड़ने पर एक प्रदर्शन समस्या
B
Too many tables in a single join एक ही जुड़ाव में बहुत सारी तालिकाएँ
C
A problem where join results have too few rows एक समस्या जहां जुड़ने के परिणामों में बहुत कम पंक्तियाँ हैं
D
When joining tables with M:N or 1:N relationships the result set can be much larger than the input tables due to row multiplication - e.g. joining Customers (1000 rows) to Orders (10000 rows) on 1:N relationship produces 10000 result rows not 1000 M:N या 1:N संबंधों के साथ तालिकाओं को जोड़ते समय पंक्ति गुणन के कारण परिणाम सेट इनपुट तालिकाओं से बहुत बड़ा हो सकता है - उदाहरण के लिए 1:N संबंध पर ग्राहकों (1000 पंक्तियों) को ऑर्डर (10000 पंक्तियों) से जोड़ने पर 1000 नहीं बल्कि 10000 परिणाम पंक्तियाँ उत्पन्न होती हैं
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Fanout: each customer row fans out to multiple order rows in a 1:N join. For M:N joins (via junction table): even more fanout. This is why COUNT(*) after a join often returns more rows than expected. Solutions: GROUP BY to aggregate, DISTINCT to deduplicate, or restructure the query to avoid unnecessary fanout.
व्याख्या (हिन्दी) फ़ैनआउट: प्रत्येक ग्राहक पंक्ति 1:एन जॉइन में एकाधिक ऑर्डर पंक्तियों को फ़ैन करती है। एम:एन जॉइन के लिए (जंक्शन टेबल के माध्यम से): और भी अधिक फैनआउट। यही कारण है कि जुड़ने के बाद COUNT(*) अक्सर अपेक्षा से अधिक पंक्तियाँ लौटाता है। समाधान: एकत्रित करने के लिए ग्रुप BY, डुप्लिकेट हटाने के लिए DISTINCT, या अनावश्यक फैनआउट से बचने के लिए क्वेरी का पुनर्गठन करें।
128
EN + हिं Medium
GB Theta join R⊲⊳θS equals
IN थीटा जॉइन R⊲⊳θS बराबर है
A
R∪S आर∪एस
B
σθ(R×S) σθ(आर×एस)
C
πθ(R×S) πθ(आर×एस)
D
R∩S आर∩एस
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Theta join = cross product followed by selection: R⊲⊳θS = σθ(R×S).
व्याख्या (हिन्दी) थीटा जॉइन = क्रॉस उत्पाद जिसके बाद चयन होता है: R⊲⊳θS = σθ(R×S)।
129
EN + हिं Medium
GB Equijoin uses which condition operator
IN इक्विजॉइन किस कंडीशन ऑपरेटर का उपयोग करता है
A
< only < केवल
B
> only > केवल
C
= (equality) = (समानता)
D
≠ only ≠ केवल
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Equijoin: all conditions in join predicate use equality (=) operator only.
व्याख्या (हिन्दी) इक्विजॉइन: जॉइन विधेय में सभी शर्तें केवल समानता (=) ऑपरेटर का उपयोग करती हैं।
130
EN + हिं Medium
GB Natural join joins on
IN प्राकृतिक जुड़ाव जुड़ता है
A
Primary keys only केवल प्राथमिक कुंजी
B
All attributes with same name in both relations दोनों संबंधों में सभी गुण एक ही नाम के हैं
C
First attribute only केवल पहला गुण
D
No attributes कोई गुण नहीं
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Natural join: joins on ALL attributes with same name, eliminating one copy of duplicates.
व्याख्या (हिन्दी) प्राकृतिक जुड़ाव: सभी विशेषताओं पर एक ही नाम से जुड़ना, डुप्लिकेट की एक प्रति को समाप्त करना।
131
EN + हिं Medium
GB Anti-join R▷S returns
IN एंटी-जॉइन R▷S रिटर्न
A
All tuples from both दोनों से सभी टुपल्स
B
Tuples in R that have NO matching tuple in S आर में ट्यूपल्स जिनका एस में कोई मिलान ट्यूपल नहीं है
C
Tuples common to R and S आर और एस के लिए सामान्य टुपल्स
D
All S tuples सभी एस टुपल्स
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Anti-join: returns R tuples that do NOT match any S tuple.
व्याख्या (हिन्दी) एंटी-ज्वाइन: ऐसे आर टुपल्स लौटाता है जो किसी भी एस टुपल्स से मेल नहीं खाते।
132
EN + हिं Medium
GB INNER JOIN returns
IN इनर जॉइन रिटर्न
A
All rows from left बाईं ओर से सभी पंक्तियाँ
B
All rows from right दाईं ओर से सभी पंक्तियाँ
C
Only rows where join condition satisfied in BOTH tables केवल वे पंक्तियाँ जहाँ जुड़ने की स्थिति दोनों तालिकाओं में संतुष्ट है
D
All rows from both दोनों से सभी पंक्तियाँ
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) INNER JOIN: returns only rows where the join condition is met in BOTH tables.
व्याख्या (हिन्दी) इनर जॉइन: केवल वही पंक्तियाँ लौटाता है जहाँ दोनों तालिकाओं में जुड़ने की शर्त पूरी होती है।
133
EN + हिं Medium
GB LEFT JOIN returns
IN लेफ्ट जॉइन रिटर्न
A
Only matching rows केवल मेल खाने वाली पंक्तियाँ
B
All left table rows plus matching right rows (NULLs for no match) सभी बाईं तालिका पंक्तियाँ और मिलान वाली दाईं पंक्तियाँ (बिना किसी मिलान के शून्य)
C
All right table rows सभी ठीक तालिका पंक्तियाँ
D
All rows from both दोनों से सभी पंक्तियाँ
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) LEFT JOIN: all rows from left table; right side columns are NULL where no match exists.
व्याख्या (हिन्दी) बायाँ जोड़: बाएँ तालिका से सभी पंक्तियाँ; दाईं ओर के कॉलम शून्य हैं जहां कोई मिलान मौजूद नहीं है।
134
EN + हिं Medium
GB FULL OUTER JOIN returns
IN पूर्ण बाहरी जुड़ाव रिटर्न
A
Only matching rows केवल मेल खाने वाली पंक्तियाँ
B
All left rows only सभी पंक्तियाँ केवल शेष हैं
C
All right rows only केवल सभी ठीक पंक्तियाँ
D
All rows from both; NULLs for non-matches दोनों से सभी पंक्तियाँ; गैर-मिलानों के लिए शून्य
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) FULL OUTER JOIN: all rows from both tables with NULLs where no match exists on either side.
व्याख्या (हिन्दी) पूर्ण बाहरी जुड़ाव: दोनों तालिकाओं की सभी पंक्तियाँ NULLs के साथ जहां दोनों तरफ कोई मिलान मौजूद नहीं है।
135
EN + हिं Medium
GB Lossless-join decomposition means
IN दोषरहित-जोड़ विघटन का अर्थ है
A
Data lost after decomposition विघटन के बाद डेटा नष्ट हो गया
B
Join of decomposed relations gives exactly the original relation without spurious tuples विघटित संबंधों का जुड़ाव नकली टुपल्स के बिना बिल्कुल मूल संबंध देता है
C
Dependencies lost निर्भरता खो गई
D
Keys removed चाबियाँ हटा दी गईं
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Lossless join: joining decomposed relations perfectly reconstructs original relation.
व्याख्या (हिन्दी) दोषरहित जुड़ाव: विघटित संबंधों को जोड़ने से मूल संबंध का पूरी तरह से पुनर्निर्माण होता है।
121–135 of 146