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
2956
EN + हिं Medium
GB Question::oldest()->get() orders by
IN प्रश्न::सबसे पुराना()->द्वारा ऑर्डर प्राप्त करें
A
id descending आईडी उतर रही है
B
question alphabetically वर्णानुक्रम में प्रश्न करें
C
q_level ascending q_स्तर आरोही
D
created_at ascending (oldest first) create_at आरोही (सबसे पुराना पहले)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) oldest(): shorthand for orderBy('created_at', 'asc') - returns oldest records first.
व्याख्या (हिन्दी) सबसे पुराना(): orderBy('created_at', 'asc') के लिए आशुलिपि - सबसे पुराने रिकॉर्ड पहले लौटाता है।
2957
EN + हिं Medium
GB DB::table('questions')->when($level, function($q) use ($level){ $q->where('q_level',$level); })->get() performs
IN DB::table('questions')->when($level, function($q) उपयोग ($level){ $q->where('q_level',$level); })->get() निष्पादित करता है
A
Always filters by q_level हमेशा q_level द्वारा फ़िल्टर करें
B
Never filters by q_level कभी भी q_level द्वारा फ़िल्टर न करें
C
Throws error if $level is null यदि $स्तर शून्य है तो त्रुटि उत्पन्न होती है
D
Conditionally applies where clause only if $level is truthy सशर्त रूप से वहां लागू होता है जहां खंड केवल तभी लागू होता है जब $स्तर सत्य हो
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) when($condition, callback): applies the callback (adds where clause) only if condition is truthy.
व्याख्या (हिन्दी) कब($कंडीशन, कॉलबैक): कॉलबैक लागू करता है (जहां क्लॉज जोड़ता है) केवल तभी जब शर्त सत्य हो।
2958
EN + हिं Medium
GB In Laravel, which method returns paginated results for API (without HTML links)
IN लारवेल में, कौन सी विधि एपीआई के लिए पृष्ठांकित परिणाम लौटाती है (एचटीएमएल लिंक के बिना)
A
paginate(15) पेजिनेट(15)
B
simplePaginate(15) सरल पेजिनेट(15)
C
get() पाना()
D
simplePaginate(15) or paginate(15) with ->through() for JSON API responses JSON एपीआई प्रतिक्रियाओं के लिए -> के माध्यम से() के साथ सरल पेजिनेट (15) या पेजिनेट (15)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) simplePaginate(15): more efficient than paginate (no total count query), returns prev/next links only.
व्याख्या (हिन्दी) SimplePaginate(15): पेजिनेट से अधिक कुशल (कोई कुल गणना क्वेरी नहीं), केवल पिछला/अगला लिंक लौटाता है।
2959
EN + हिं Medium
GB Which Laravel relationship method uses a pivot table
IN कौन सी लारवेल संबंध विधि पिवट तालिका का उपयोग करती है
A
hasMany() कई हैं()
B
belongsTo() से संबंधित()
C
hasOne() एक है()
D
belongsToMany() बहुत से संबंधित है()
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) belongsToMany(): defines M:N relationship using a pivot (junction) table.
व्याख्या (हिन्दी) संबंधितToMany(): पिवट (जंक्शन) तालिका का उपयोग करके M:N संबंध को परिभाषित करता है।
2960
EN + हिं Medium
GB Pivot table for Question-Tag M:N relationship should be named
IN प्रश्न-टैग एम:एन संबंध के लिए पिवोट टेबल का नाम दिया जाना चाहिए
A
tags_questions टैग_प्रश्न
B
question_tag (singular model names in alphabetical order) प्रश्न_टैग (वर्णमाला क्रम में एकवचन मॉडल नाम)
C
questions_tags प्रश्न पुछल्ले
D
Tag_Question सवाल जोड़ें
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Laravel convention: pivot table = singular model names in alphabetical order: question_tag.
व्याख्या (हिन्दी) लारवेल कन्वेंशन: पिवट टेबल = वर्णमाला क्रम में एकवचन मॉडल नाम: प्रश्न_टैग।
2961
EN + हिं Medium
GB To attach tags to a question in Eloquent M:N
IN एलोक्वेंट एम:एन में किसी प्रश्न के साथ टैग संलग्न करने के लिए
A
$question->tags = $tagIds $प्रश्न->टैग = $टैगआईडी
B
$question->tags()->create(['name'=>'SQL']) $प्रश्न->टैग()->बनाएं(['नाम'=>'एसक्यूएल'])
C
$question->tags()->update($tagIds) $प्रश्न->टैग्स()->अपडेट($tagIds)
D
$question->tags()->attach($tagIds) $प्रश्न->टैग()->संलग्न करें($tagIds)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) attach($ids): adds records to the pivot table for the M:N relationship.
व्याख्या (हिन्दी) संलग्न करें($ids): M:N संबंध के लिए पिवट तालिका में रिकॉर्ड जोड़ता है।
2962
EN + हिं Medium
GB To remove all tag associations from a question in Eloquent M:N
IN एलोक्वेंट एम:एन में एक प्रश्न से सभी टैग एसोसिएशन को हटाने के लिए
A
$question->tags()->delete() $प्रश्न->टैग()->हटाएं()
B
$question->delete() $प्रश्न->हटाएं()
C
$question->tags()->remove() $प्रश्न->टैग्स()->निकालें()
D
$question->tags()->detach() $प्रश्न->टैग()->अलग करें()
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) detach(): removes all (or specified) pivot table records for the M:N relationship.
व्याख्या (हिन्दी) डिटैच(): एम:एन संबंध के लिए सभी (या निर्दिष्ट) पिवट टेबल रिकॉर्ड को हटा देता है।
2963
EN + हिं Medium
GB $question->tags()->sync($newTagIds) in Eloquent
IN $question->tags()->sync($newTagIds) एलोक्वेंट में
A
Only adds new tags केवल नए टैग जोड़ता है
B
Only removes old tags केवल पुराने टैग हटाता है
C
Does nothing करते कुछ नहीं हैं
D
Adds new tags and removes old ones so the relationship matches exactly $newTagIds नए टैग जोड़ता है और पुराने हटा देता है ताकि संबंध बिल्कुल $newTagIds से मेल खाए
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) sync(): adds new, removes old pivot records so the relationship matches exactly the provided IDs.
व्याख्या (हिन्दी) सिंक(): नया जोड़ता है, पुराने पिवट रिकॉर्ड हटाता है ताकि संबंध प्रदान की गई आईडी से बिल्कुल मेल खाए।
2964
EN + हिं Medium
GB Which Eloquent method creates a model AND saves it to database in one step
IN कौन सी एलोक्वेंट विधि एक मॉडल बनाती है और उसे एक चरण में डेटाबेस में सहेजती है
A
new Question(['question'=>'...']) नया प्रश्न(['प्रश्न'=>'...'])
B
Question::make(['question'=>'...']) प्रश्न::बनाना(['प्रश्न'=>'...'])
C
Question::build(['question'=>'...']) प्रश्न::निर्माण(['प्रश्न'=>'...'])
D
Question::create(['question'=>'...']) प्रश्न::बनाएं(['प्रश्न'=>'...'])
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) create(): instantiates AND saves to database in one call. make()/new: instantiates without saving.
व्याख्या (हिन्दी) create(): इंस्टेंटियेट करता है और एक कॉल में डेटाबेस में सहेजता है। मेक()/नया: सहेजे बिना इंस्टेंटियेट होता है।
2965
EN + हिं Medium
GB Question::firstOrCreate(['question'=>'Test?'],['option_a'=>'A']) does
IN प्रश्न::firstOrCreate(['question'=>'Test?'],['option_a'=>'A']) करता है
A
Always creates new row हमेशा नई पंक्ति बनाता है
B
Throws error if exists यदि मौजूद है तो त्रुटि फेंकता है
C
Updates if exists यदि मौजूद है तो अद्यतन करें
D
Finds first matching row or creates it if not found पहली मिलान पंक्ति ढूँढता है या नहीं मिलने पर इसे बनाता है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) firstOrCreate: finds by first arg; if not found, creates with merged first+second arg data.
व्याख्या (हिन्दी) फर्स्टऑरक्रिएट: पहले तर्क द्वारा ढूँढता है; यदि नहीं मिला, तो मर्ज किए गए पहले + दूसरे आर्ग डेटा के साथ बनाता है।
2966
EN + हिं Medium
GB Question::updateOrCreate(['id'=>1],['q_level'=>3]) does
IN प्रश्न::updateOrCreate(['id'=>1],['q_level'=>3]) करता है
A
Always creates new row हमेशा नई पंक्ति बनाता है
B
Throws error if exists यदि मौजूद है तो त्रुटि फेंकता है
C
Deletes old and creates new पुराना हटाता है और नया बनाता है
D
Updates if found by first arg, creates if not found पहले आर्ग द्वारा पाए जाने पर अपडेट, नहीं मिलने पर बनाया जाता है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) updateOrCreate: finds by first arg, updates with second arg if found; creates merged record if not found.
व्याख्या (हिन्दी) updateOrCreate: पहले arg से ढूंढता है, यदि पाया जाता है तो दूसरे arg से अपडेट करता है; नहीं मिलने पर मर्ज किया गया रिकॉर्ड बनाता है।
2967
EN + हिं Medium
GB Which prevents concurrent duplicate inserts in Laravel
IN जो लारवेल में समवर्ती डुप्लिकेट प्रविष्टियों को रोकता है
A
Using transaction only केवल लेनदेन का उपयोग करना
B
Using try-catch only केवल ट्राई-कैच का उपयोग करना
C
Trust auto-increment स्वत: वृद्धि पर भरोसा करें
D
Unique database constraint + try-catch for IntegrityConstraintViolationException अद्वितीय डेटाबेस बाधा + IntegrityConstraintViolationException के लिए प्रयास-पकड़
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Database UNIQUE constraint is the authoritative check; application catches constraint violation exception.
व्याख्या (हिन्दी) डेटाबेस अद्वितीय बाधा आधिकारिक जाँच है; एप्लिकेशन बाधा उल्लंघन अपवाद को पकड़ता है।
2968
EN + हिं Medium
GB Database connection pooling improves
IN डेटाबेस कनेक्शन पूलिंग में सुधार होता है
A
Data quality आधार सामग्री की गुणवत्ता
B
Storage efficiency भंडारण दक्षता
C
Security सुरक्षा
D
Performance by reusing existing connections instead of creating new ones for each request प्रत्येक अनुरोध के लिए नए कनेक्शन बनाने के बजाय मौजूदा कनेक्शन का पुन: उपयोग करके प्रदर्शन
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Connection pooling: reuses open DB connections across requests, reducing connection overhead significantly.
व्याख्या (हिन्दी) कनेक्शन पूलिंग: सभी अनुरोधों में खुले डीबी कनेक्शन का पुन: उपयोग करता है, जिससे कनेक्शन ओवरहेड काफी कम हो जाता है।
2969
EN + हिं Medium
GB Which Laravel config file sets database connection settings
IN कौन सी लारवेल कॉन्फ़िग फ़ाइल डेटाबेस कनेक्शन सेटिंग्स सेट करती है
A
.env only केवल .env
B
config/app.php config/app.php
C
config/cache.php config/cache.php
D
config/database.php (reads from .env variables) config/database.php (.env वेरिएबल से पढ़ता है)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) config/database.php: defines database connections (driver, host, port, database, username, password from .env).
व्याख्या (हिन्दी) config/database.php: डेटाबेस कनेक्शन (ड्राइवर, होस्ट, पोर्ट, डेटाबेस, उपयोगकर्ता नाम, .env से पासवर्ड) को परिभाषित करता है।
2970
EN + हिं Medium
GB DB_CONNECTION=mysql in .env sets
IN DB_CONNECTION=mysql .env सेट में
A
The database name डेटाबेस का नाम
B
The username उपयोक्तानाम
C
The table prefix तालिका उपसर्ग
D
The database driver (mysql, pgsql, sqlite, sqlsrv) डेटाबेस ड्राइवर (mysql, pgsql, sqlite, sqlsrv)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) DB_CONNECTION: specifies which database driver/type to use (mysql, pgsql, sqlite, sqlsrv).
व्याख्या (हिन्दी) DB_CONNECTION: निर्दिष्ट करता है कि किस डेटाबेस ड्राइवर/प्रकार का उपयोग करना है (mysql, pgsql, sqlite, sqlsrv)।
2956–2970 of 2982