DBMS — MCQ Practice

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

📚 2982 Questions 🌐 Hindi + English ✅ Free
भाषा / Language:
2982 questions
2851
EN + हिं Hard
GB To update q_level for all questions in assignment_id=1 to level 3
IN असाइनमेंट_आईडी=1 के सभी प्रश्नों के लिए q_level को लेवल 3 तक अपडेट करने के लिए
A
UPDATE questions q_level=3 WHERE assignment_id=1 प्रश्न अद्यतन करें q_level=3 जहां असाइनमेंट_आईडी=1
B
UPDATE questions SET assignment_id=1 WHERE q_level=3 अद्यतन प्रश्न सेट असाइनमेंट_आईडी=1 जहां क्यू_लेवल=3
C
DELETE FROM questions WHERE assignment_id=1 उन प्रश्नों से हटाएँ जहाँ असाइनमेंट_आईडी=1
D
UPDATE questions SET q_level=3 WHERE assignment_id=1 अद्यतन प्रश्न सेट q_level=3 जहां असाइनमेंट_आईडी=1
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) UPDATE table SET col=value WHERE condition: correct syntax for updating rows.
व्याख्या (हिन्दी) अद्यतन तालिका SET col=value WHERE स्थिति: पंक्तियों को अद्यतन करने के लिए सही सिंटैक्स।
2852
EN + हिं Hard
GB Which SQL finds questions that have all 5 options filled (option_e is not NULL)
IN कौन सा एसक्यूएल उन प्रश्नों को ढूंढता है जिनमें सभी 5 विकल्प भरे हुए हैं (option_e NULL नहीं है)
A
SELECT * FROM questions WHERE option_e = '' उन प्रश्नों में से चुनें जहां option_e = ''
B
SELECT * FROM questions WHERE option_e = 0 उन प्रश्नों में से * चुनें जहां option_e = 0 है
C
SELECT * FROM questions WHERE option_e IS NOT NULL उन प्रश्नों में से * चुनें जहां विकल्प_ई शून्य नहीं है
D
SELECT * FROM questions WHERE option_e = 'exists' उन प्रश्नों में से चुनें जहां option_e = 'मौजूद है'
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) IS NOT NULL checks that option_e has a value (5th option exists for this question).
व्याख्या (हिन्दी) IS NOT NULL जाँच करता है कि option_e का कोई मान है (इस प्रश्न के लिए 5वाँ विकल्प मौजूद है)।
2853
EN + हिं Hard
GB To soft-delete all questions for assignment_id=2 in Laravel
IN लारवेल में असाइनमेंट_आईडी=2 के सभी प्रश्नों को सॉफ्ट-डिलीट करने के लिए
A
Question::where('assignment_id',2)->delete() with SoftDeletes trait प्रश्न::where('assignment_id',2)->delete() with SoftDeletes विशेषता
B
Question::where('assignment_id',2)->forceDelete() प्रश्न::कहां('असाइनमेंट_आईडी',2)->फोर्सडिलीट()
C
DB::table('questions')->where('assignment_id',2)->delete() डीबी::तालिका('प्रश्न')->कहां('असाइनमेंट_आईडी',2)->हटाएं()
D
Question::truncate() प्रश्न::काटना()
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) With SoftDeletes trait: delete() sets deleted_at timestamp instead of physically removing rows.
व्याख्या (हिन्दी) SoftDeletes विशेषता के साथ: delete() पंक्तियों को भौतिक रूप से हटाने के बजाय टाइमस्टैम्प पर delete_at सेट करता है।
2854
EN + हिं Hard
GB To permanently delete soft-deleted questions in Laravel
IN लारवेल में सॉफ्ट-डिलीट किए गए प्रश्नों को स्थायी रूप से हटाने के लिए
A
Question::delete() प्रश्न::हटाएं()
B
Question::onlyTrashed()->forceDelete() प्रश्न::onlyTrashed()->forceDelete()
C
Question::withTrashed()->delete() प्रश्न::withTrashed()->delete()
D
Question::restore() प्रश्न::पुनर्स्थापित करें()
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) onlyTrashed()->forceDelete(): gets only soft-deleted records then permanently removes them from DB.
व्याख्या (हिन्दी) ओनलीट्रैश्ड()->फोर्सडिलीट(): केवल सॉफ्ट-डिलीट किए गए रिकॉर्ड प्राप्त करता है और फिर उन्हें डीबी से स्थायी रूप से हटा देता है।
2855
EN + हिं Hard
GB To restore soft-deleted questions in Laravel
IN लारवेल में सॉफ्ट-डिलीट किए गए प्रश्नों को पुनर्स्थापित करने के लिए
A
Question::delete() प्रश्न::हटाएं()
B
Question::withTrashed()->restore() प्रश्न::withTrashed()->restore()
C
Question::onlyTrashed()->restore() प्रश्न::केवल ट्रैश्ड()->पुनर्स्थापित करें()
D
Question::create() प्रश्न::बनाएँ()
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) onlyTrashed()->restore(): gets only soft-deleted records and restores them (sets deleted_at to NULL).
व्याख्या (हिन्दी) केवल ट्रैश्ड()->रिस्टोर(): केवल सॉफ्ट-डिलीट किए गए रिकॉर्ड प्राप्त करता है और उन्हें पुनर्स्थापित करता है (deleted_at को NULL पर सेट करता है)।
2856
EN + हिं Hard
GB In Laravel, Question::where('assignment_id',1)->get() vs Question::where('assignment_id',1)->first()
IN लारवेल में, प्रश्न::कहां('असाइनमेंट_आईडी',1)->प्राप्त() बनाम प्रश्न::कहां('असाइनमेंट_आईडी',1)->प्रथम()
A
No difference कोई फर्क नहीं
B
get() returns Collection of all matches; first() returns only the first matching model or NULL get() सभी मैचों का संग्रह लौटाता है; पहला() केवल पहला मिलान मॉडल या NULL लौटाता है
C
first() returns Collection; get() returns single model पहला() संग्रह लौटाता है; get() एकल मॉडल लौटाता है
D
Both return arrays दोनों रिटर्न ऐरे
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) get(): Collection of all matching rows. first(): single model instance (first match) or NULL.
व्याख्या (हिन्दी) प्राप्त करें (): सभी मिलान पंक्तियों का संग्रह। पहला(): एकल मॉडल उदाहरण (पहला मिलान) या शून्य।
2857
EN + हिं Hard
GB DB::table('questions')->value('question') returns
IN DB::table('questions')->value('question') रिटर्न
A
All question values सभी प्रश्न मान
B
First question's text as a plain value (not Collection/model) पहले प्रश्न का पाठ सादे मान के रूप में (संग्रह/मॉडल नहीं)
C
Array of all questions सभी प्रश्नों की श्रृंखला
D
NULL always हमेशा शून्य
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) value('col'): executes query and returns single value from first row's specified column.
व्याख्या (हिन्दी) वैल्यू ('col'): क्वेरी निष्पादित करता है और पहली पंक्ति के निर्दिष्ट कॉलम से एकल मान लौटाता है।
2858
EN + हिं Hard
GB DB::table('questions')->exists() returns
IN DB::table('questions')->exists() रिटर्न
A
All rows सभी पंक्तियाँ
B
Count of rows पंक्तियों की गिनती
C
NULL व्यर्थ
D
Boolean: TRUE if at least one row matches the query, FALSE otherwise बूलियन: यदि कम से कम एक पंक्ति क्वेरी से मेल खाती है तो सत्य है, अन्यथा गलत है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) exists(): returns true/false whether any rows match the query - efficient (uses EXISTS in SQL).
व्याख्या (हिन्दी) मौजूद(): सही/गलत लौटाता है कि क्या कोई पंक्तियाँ क्वेरी से मेल खाती हैं - कुशल (एसक्यूएल में EXISTS का उपयोग करता है)।
2859
EN + हिं Hard
GB DB::table('questions')->doesntExist() returns
IN DB::table('questions')->doesntExist() रिटर्न
A
All rows सभी पंक्तियाँ
B
Count गिनती करना
C
NULL व्यर्थ
D
Boolean: TRUE if NO rows match the query बूलियन: यदि कोई पंक्तियाँ क्वेरी से मेल नहीं खातीं तो सत्य है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) doesntExist(): returns true when NO matching rows exist - opposite of exists().
व्याख्या (हिन्दी) DontExist(): जब कोई मिलान पंक्ति मौजूद नहीं होती है तो सत्य लौटाता है - अस्तित्व() के विपरीत।
2860
EN + हिं Hard
GB Question::withCount('options') in Laravel Eloquent
IN प्रश्न:: लारवेल एलोक्वेंट में गिनती('विकल्प') के साथ
A
Counts all questions सभी प्रश्नों को गिनता है
B
Returns options table रिटर्न विकल्प तालिका
C
Adds options_count attribute with count of related options संबंधित विकल्पों की गिनती के साथ option_count विशेषता जोड़ता है
D
Throws error त्रुटि फेंकता है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) withCount('relation'): adds a {relation}_count attribute to each model with the count of related records.
व्याख्या (हिन्दी) withCount('relation'): संबंधित रिकॉर्ड की गिनती के साथ प्रत्येक मॉडल में एक {relation}_count विशेषता जोड़ता है।
2861
EN + हिं Hard
GB DB::table('questions')->orderByRaw('FIELD(q_level,3,2,1)')->get() in MySQL
IN DB::table('questions')->orderByRaw('FIELD(q_level,3,2,1)')->get() MySQL में
A
Orders alphabetically वर्णानुक्रम में आदेश
B
Orders randomly बेतरतीब ढंग से आदेश
C
Orders by q_level ascending q_level आरोही क्रम से आदेश
D
Orders by custom field order: 3 first, then 2, then 1 कस्टम फ़ील्ड क्रम के अनुसार आदेश: पहले 3, फिर 2, फिर 1
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) FIELD(col,v1,v2,v3): MySQL function returning position in list, enabling custom sort order.
व्याख्या (हिन्दी) FIELD(col,v1,v2,v3): MySQL फ़ंक्शन सूची में स्थिति लौटाता है, कस्टम सॉर्ट ऑर्डर सक्षम करता है।
2862
EN + हिं Hard
GB DB::table('questions')->selectRaw('COUNT(*) as total, AVG(q_level) as avg_level')->first()
IN DB::table('questions')->selectRaw('COUNT(*) as total, AVG(q_level) as avg_level')->first()
A
Returns all questions सभी प्रश्न लौटाता है
B
Returns error त्रुटि लौटाता है
C
Returns first question only केवल पहला प्रश्न लौटाता है
D
Returns a stdClass with total count and average q_level कुल गिनती और औसत q_level के साथ एक stdClass लौटाता है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) selectRaw with aggregates returns single row with computed total and avg_level values.
व्याख्या (हिन्दी) समुच्चय के साथ चयन रॉ परिकलित कुल और avg_level मानों के साथ एकल पंक्ति लौटाता है।
2863
EN + हिं Hard
GB To get questions grouped by q_level with count in Laravel
IN लारवेल में गिनती के साथ q_level द्वारा समूहीकृत प्रश्न प्राप्त करने के लिए
A
Question::all() प्रश्न::सभी()
B
DB::table('questions')->groupBy('q_level')->selectRaw('q_level,COUNT(*) as cnt')->get() DB::table('प्रश्न')->groupBy('q_level')->selectRaw('q_level,COUNT(*) as cnt')->get()
C
Question::count('q_level') प्रश्न::गिनती('q_level')
D
DB::table('questions')->count() डीबी::टेबल('प्रश्न')->गिनती()
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) GROUP BY q_level + selectRaw with COUNT(*): returns count per each q_level value.
व्याख्या (हिन्दी) q_level द्वारा ग्रुप + COUNT(*) के साथ सेलेक्ट रॉ: प्रत्येक q_level मान के अनुसार गिनती लौटाता है।
2864
EN + हिं Hard
GB Which Laravel method chains multiple OR conditions cleanly
IN कौन सी लारवेल विधि एकाधिक OR स्थितियों को साफ़-साफ़ ढंग से जोड़ती है
A
Multiple orWhere() calls एकाधिक याwhere() कॉल
B
->where(function($q){ $q->where('a',1)->orWhere('b',2) }) for grouped OR ->कहां(फ़ंक्शन($q){ $q->कहां('ए',1)->याकहां('बी',2) }) समूहीकृत के लिए या
C
Only raw WHERE clause केवल कच्चा WHERE खंड
D
Cannot use multiple ORs एकाधिक OR का उपयोग नहीं किया जा सकता
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Grouped WHERE with closure: generates WHERE (a=1 OR b=2) with proper parentheses grouping.
व्याख्या (हिन्दी) क्लोजर के साथ WHERE को समूहीकृत किया गया: उचित कोष्ठक समूहन के साथ WHERE (a=1 या b=2) उत्पन्न करता है।
2865
EN + हिं Hard
GB Which SQL finds the n-th highest salary (n=3rd highest)
IN कौन सा SQL n-वां उच्चतम वेतन पाता है (n=तीसरा उच्चतम)
A
SELECT MAX(salary) FROM emp नियोक्ता से अधिकतम (वेतन) चुनें
B
SELECT salary FROM emp ORDER BY salary DESC LIMIT 2,1 वेतन विवरण सीमा 2,1 के अनुसार रोजगार आदेश से वेतन का चयन करें
C
SELECT AVG(salary) FROM emp कर्मचारी वर्ग से औसत (वेतन) चुनें
D
SELECT MIN(salary) FROM emp कर्मचारी से न्यूनतम (वेतन) चुनें
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) LIMIT 2,1: skip 2 rows (1st and 2nd highest), take 1 row = 3rd highest salary.
व्याख्या (हिन्दी) सीमा 2,1: 2 पंक्तियाँ छोड़ें (पहली और दूसरी उच्चतम), 1 पंक्ति लें = तीसरा उच्चतम वेतन।
2851–2865 of 2982