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

Question 2626

EN + हिं Medium
GB Eager loading with('posts') prevents
IN ('पोस्ट') के साथ उत्सुकतापूर्वक लोड करने से रोकता है
Slow queries धीमी क्वेरी
N+1 query problem by loading related models in 2 queries instead of N+1 N+1 के बजाय 2 क्वेरी में संबंधित मॉडल लोड करके N+1 क्वेरी समस्या
Table locking टेबल लॉक करना
Migration errors माइग्रेशन त्रुटियाँ
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) with('relation') eager loads: 1 query for all models + 1 for all related = 2 total (not N+1).
व्याख्या (हिन्दी) with('relation') उत्सुक भार: सभी मॉडलों के लिए 1 क्वेरी + सभी संबंधितों के लिए 1 = कुल 2 (एन+1 नहीं)।
🎯 Exam Perspective
DBMS के इस प्रश्न को — difficulty level "Medium" कई प्रतियोगी परीक्षाओं जैसे SSC, Railway, Banking और State PCS में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 2627

EN + हिं Medium
GB Eloquent create() requires
IN सुवक्ता सृजन() की आवश्यकता है
No setup कोई सेटअप नहीं
$fillable array set on model (mass assignment protection) मॉडल पर $भरने योग्य सरणी सेट (मास असाइनमेंट सुरक्षा)
$guarded only केवल $रक्षित
A factory एक कारखाना
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) create(): uses mass assignment - must define $fillable whitelist or $guarded blacklist.
व्याख्या (हिन्दी) create(): बड़े पैमाने पर असाइनमेंट का उपयोग करता है - $ fillable श्वेतसूची या $ संरक्षित ब्लैकलिस्ट को परिभाषित करना होगा।
🎯 Exam Perspective
यह सवाल DBMS category का है — difficulty level "Medium", और SSC CGL, IBPS, RRB और State-level परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 2628

EN + हिं Medium
GB $question->save() performs
IN $question->save() निष्पादित करता है
SELECT query क्वेरी चुनें
DELETE query क्वेरी हटाएँ
INSERT for new model or UPDATE for existing model नए मॉडल के लिए सम्मिलित करें या मौजूदा मॉडल के लिए अद्यतन करें
TRUNCATE काट-छांट
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) save(): executes INSERT for new (unsaved) instances or UPDATE for existing (already in DB).
व्याख्या (हिन्दी) save(): नए (बिना सहेजे गए) उदाहरणों के लिए INSERT या मौजूदा (पहले से ही DB में) के लिए अद्यतन निष्पादित करता है।
🎯 Exam Perspective
यह प्रश्न DBMS की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है — difficulty level "Medium"। इस तरह के प्रश्न अक्सर UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 2629

EN + हिं Medium
GB Soft delete uses
IN सॉफ्ट डिलीट उपयोग
Boolean is_deleted column only बूलियन केवल कॉलम हटा दिया गया है
deleted_at TIMESTAMP column (NULL=active, timestamp=deleted) TIMESTAMP कॉलम पर हटा दिया गया (शून्य=सक्रिय, टाइमस्टैम्प=हटाया गया)
Physically deletes and archives भौतिक रूप से हटाता है और संग्रहीत करता है
DROP TABLE ड्रॉप तालिका
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) SoftDeletes trait: uses deleted_at column. Soft-deleted rows stay in DB but excluded from normal queries.
व्याख्या (हिन्दी) SoftDeletes विशेषता: delete_at कॉलम का उपयोग करता है। सॉफ़्ट-डिलीट पंक्तियाँ DB में रहती हैं लेकिन सामान्य प्रश्नों से बाहर रखी जाती हैं।
🎯 Exam Perspective
DBMS से जुड़ा यह सवाल — difficulty level "Medium" उन students के लिए काम का है जो Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 2630

EN + हिं Medium
GB withTrashed() includes
IN withTrashed() शामिल है
Only soft-deleted records केवल सॉफ्ट-डिलीट किए गए रिकॉर्ड
All records including soft-deleted ones सॉफ़्ट-डिलीट सहित सभी रिकॉर्ड
Only active records केवल सक्रिय रिकॉर्ड
Only trashed records केवल रिकॉर्ड रद्दी कर दिए गए
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) withTrashed()->get(): includes BOTH soft-deleted and non-deleted records.
व्याख्या (हिन्दी) withTrashed()->get(): इसमें सॉफ्ट-डिलीट और नॉन-डिलीट किए गए दोनों रिकॉर्ड शामिल हैं।
🎯 Exam Perspective
SSC, Railway, Banking और State PCS जैसी परीक्षाओं में DBMS से सवाल अक्सर पूछे जाते हैं — difficulty level "Medium"। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 2631

EN + हिं Medium
GB belongsToMany() is used for
IN संबंधितToMany() का उपयोग किसके लिए किया जाता है?
One-to-one एक से एक
One-to-many कई लोगों के लिए एक
Many-to-many relationship requiring pivot table अनेक-से-अनेक संबंध के लिए पिवट तालिका की आवश्यकता होती है
Polymorphic बहुरूपी
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) belongsToMany: defines M:N relationship using a pivot (junction) table.
व्याख्या (हिन्दी) संबंधितToMany: पिवट (जंक्शन) तालिका का उपयोग करके M:N संबंध को परिभाषित करता है।
🎯 Exam Perspective
अगर आप SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं, तो DBMS का यह topic आपके लिए महत्वपूर्ण है — difficulty level "Medium"। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 2632

EN + हिं Medium
GB chunk(100, callback) in Eloquent
IN सुवक्ता में खंड(100, कॉलबैक)।
Paginates results परिणाम पृष्ठांकित करता है
Processes records 100 at a time preventing memory exhaustion मेमोरी थकावट को रोकने के लिए प्रक्रियाएं एक समय में 100 रिकॉर्ड करती हैं
Sorts records अभिलेखों को क्रमबद्ध करता है
Groups records समूह अभिलेख
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) chunk: processes large datasets in batches of N records, preventing OOM for millions of rows.
व्याख्या (हिन्दी) खंड: एन रिकॉर्ड के बैचों में बड़े डेटासेट को संसाधित करता है, लाखों पंक्तियों के लिए ओओएम को रोकता है।
🎯 Exam Perspective
DBMS के इस प्रश्न को — difficulty level "Medium" कई प्रतियोगी परीक्षाओं जैसे UPSC, SSC, Banking और Police भर्ती में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 2633

EN + हिं Medium
GB DB::table('questions')->get() returns
IN DB::table('questions')->get() रिटर्न
Eloquent models वाक्पटु मॉडल
Plain PHP stdClass objects (not Eloquent model instances) सादा PHP stdClass ऑब्जेक्ट (एलोक्वेंट मॉडल उदाहरण नहीं)
Array of arrays सरणियों की श्रृंखला
Paginator पेजिनेटर
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Query Builder: returns stdClass objects. Eloquent's Model::all() returns model instances.
व्याख्या (हिन्दी) क्वेरी बिल्डर: stdClass ऑब्जेक्ट लौटाता है। एलोक्वेंट का मॉडल::सभी() मॉडल उदाहरण लौटाता है।
🎯 Exam Perspective
यह सवाल DBMS category का है — difficulty level "Medium", और Railway, SSC, Banking और Defence परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 2634

EN + हिं Medium
GB DB::table('questions')->where('is_deleted',0)->count() returns
IN DB::table('questions')->where('is_deleted',0)->count() रिटर्न
All questions सभी प्रश्न
SQL DELETE count एसक्यूएल डिलीट गिनती
Integer count of non-deleted questions न हटाए गए प्रश्नों की पूर्णांक संख्या
NULL व्यर्थ
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) count(): returns number of rows matching query: SELECT COUNT(*) FROM questions WHERE is_deleted=0.
व्याख्या (हिन्दी) गिनती(): क्वेरी से मेल खाने वाली पंक्तियों की संख्या लौटाता है: उन प्रश्नों से COUNT(*) चुनें जहां_हटाया गया = 0 है।
🎯 Exam Perspective
यह प्रश्न DBMS की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है — difficulty level "Medium"। इस तरह के प्रश्न अक्सर SSC, Railway, Banking और State PCS जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 2635

EN + हिं Medium
GB php artisan migrate:fresh
IN php कारीगर माइग्रेट: ताज़ा
Runs pending migrations लंबित माइग्रेशन चलाता है
Rolls back last batch अंतिम बैच वापस रोल करता है
Drops ALL tables then re-runs all migrations सभी तालिकाओं को हटाता है और फिर सभी माइग्रेशन को फिर से चलाता है
Refreshes one migration एक माइग्रेशन को ताज़ा करता है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) migrate:fresh: DROP all tables, then run all migrations from scratch. Clean slate.
व्याख्या (हिन्दी) माइग्रेट: ताज़ा: सभी तालिकाओं को हटा दें, फिर स्क्रैच से सभी माइग्रेशन चलाएँ। नई शुरुआत।
🎯 Exam Perspective
DBMS से जुड़ा यह सवाल — difficulty level "Medium" उन students के लिए काम का है जो SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 2636

EN + हिं Medium
GB Schema::create() in migration
IN माइग्रेशन में Schema::create()
Drops a table एक टेबल गिरा देता है
Creates a new database table एक नई डेटाबेस टेबल बनाता है
Modifies existing table मौजूदा तालिका को संशोधित करता है
Creates index only केवल सूचकांक बनाता है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Schema::create('tablename', fn(Blueprint $table){...}) creates a new table.
व्याख्या (हिन्दी) Schema::create('tablename', fn(Blueprint $table){...}) एक नई तालिका बनाता है।
🎯 Exam Perspective
UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में DBMS से सवाल अक्सर पूछे जाते हैं — difficulty level "Medium"। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 2637

EN + हिं Medium
GB $table->id() creates
IN $table->id() बनाता है
UUID column यूयूआईडी कॉलम
AUTO_INCREMENT UNSIGNED BIGINT primary key column named id AUTO_INCREMENT अहस्ताक्षरित BIGINT प्राथमिक कुंजी कॉलम जिसका नाम आईडी है
Non-primary integer गैर-प्राथमिक पूर्णांक
VARCHAR id वचर आईडी
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) id() shorthand for bigIncrements('id'): auto-increment BIGINT UNSIGNED primary key.
व्याख्या (हिन्दी) आईडी() bigIncrements('id') के लिए शॉर्टहैंड: ऑटो-इंक्रीमेंट BIGINT UNSIGNED प्राथमिक कुंजी।
🎯 Exam Perspective
अगर आप Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं, तो DBMS का यह topic आपके लिए महत्वपूर्ण है — difficulty level "Medium"। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 2638

EN + हिं Medium
GB $table->string('question') creates
IN $table->string('question') बनाता है
INTEGER column पूर्णांक स्तंभ
TEXT column पाठ स्तंभ
VARCHAR(255) column named question VARCHAR(255) कॉलम का नाम प्रश्न है
CHAR(255) चार(255)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) string('column') creates VARCHAR(255) by default.
व्याख्या (हिन्दी) स्ट्रिंग('कॉलम') डिफ़ॉल्ट रूप से VARCHAR(255) बनाता है।
🎯 Exam Perspective
DBMS के इस प्रश्न को — difficulty level "Medium" कई प्रतियोगी परीक्षाओं जैसे SSC, Railway, Banking और State PCS में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 2639

EN + हिं Medium
GB $table->text('solution') creates
IN $table->text('solution') बनाता है
VARCHAR(255) वर्चर(255)
INTEGER पूर्णांक
TEXT column for large text content बड़ी पाठ्य सामग्री के लिए टेक्स्ट कॉलम
BLOB ब्लॉब
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) text('column'): creates TEXT column for larger text (up to 65,535 characters).
व्याख्या (हिन्दी) टेक्स्ट('कॉलम'): बड़े टेक्स्ट (65,535 अक्षरों तक) के लिए टेक्स्ट कॉलम बनाता है।
🎯 Exam Perspective
यह सवाल DBMS category का है — difficulty level "Medium", और SSC CGL, IBPS, RRB और State-level परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 2640

EN + हिं Medium
GB $table->timestamps() adds
IN $table->timestamps() जोड़ता है
One timestamp column एक टाइमस्टैम्प कॉलम
A date column एक दिनांक स्तंभ
created_at and updated_at TIMESTAMP NULL columns create_at और update_at TIMESTAMP NULL कॉलम
Only updated_at केवल अपडेटेड_एट
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) timestamps(): adds both created_at AND updated_at NULLABLE TIMESTAMP columns.
व्याख्या (हिन्दी) टाइमस्टैम्प(): create_at और अपडेटेड_at NULLABLE TIMESTAMP कॉलम दोनों जोड़ता है।
🎯 Exam Perspective
यह प्रश्न DBMS की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है — difficulty level "Medium"। इस तरह के प्रश्न अक्सर UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।