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
2626
EN + हिं Medium
GB Eager loading with('posts') prevents
IN ('पोस्ट') के साथ उत्सुकतापूर्वक लोड करने से रोकता है
A
Slow queries धीमी क्वेरी
B
N+1 query problem by loading related models in 2 queries instead of N+1 N+1 के बजाय 2 क्वेरी में संबंधित मॉडल लोड करके N+1 क्वेरी समस्या
C
Table locking टेबल लॉक करना
D
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 नहीं)।
2627
EN + हिं Medium
GB Eloquent create() requires
IN सुवक्ता सृजन() की आवश्यकता है
A
No setup कोई सेटअप नहीं
B
$fillable array set on model (mass assignment protection) मॉडल पर $भरने योग्य सरणी सेट (मास असाइनमेंट सुरक्षा)
C
$guarded only केवल $रक्षित
D
A factory एक कारखाना
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) create(): uses mass assignment - must define $fillable whitelist or $guarded blacklist.
व्याख्या (हिन्दी) create(): बड़े पैमाने पर असाइनमेंट का उपयोग करता है - $ fillable श्वेतसूची या $ संरक्षित ब्लैकलिस्ट को परिभाषित करना होगा।
2628
EN + हिं Medium
GB $question->save() performs
IN $question->save() निष्पादित करता है
A
SELECT query क्वेरी चुनें
B
DELETE query क्वेरी हटाएँ
C
INSERT for new model or UPDATE for existing model नए मॉडल के लिए सम्मिलित करें या मौजूदा मॉडल के लिए अद्यतन करें
D
TRUNCATE काट-छांट
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) save(): executes INSERT for new (unsaved) instances or UPDATE for existing (already in DB).
व्याख्या (हिन्दी) save(): नए (बिना सहेजे गए) उदाहरणों के लिए INSERT या मौजूदा (पहले से ही DB में) के लिए अद्यतन निष्पादित करता है।
2629
EN + हिं Medium
GB Soft delete uses
IN सॉफ्ट डिलीट उपयोग
A
Boolean is_deleted column only बूलियन केवल कॉलम हटा दिया गया है
B
deleted_at TIMESTAMP column (NULL=active, timestamp=deleted) TIMESTAMP कॉलम पर हटा दिया गया (शून्य=सक्रिय, टाइमस्टैम्प=हटाया गया)
C
Physically deletes and archives भौतिक रूप से हटाता है और संग्रहीत करता है
D
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 में रहती हैं लेकिन सामान्य प्रश्नों से बाहर रखी जाती हैं।
2630
EN + हिं Medium
GB withTrashed() includes
IN withTrashed() शामिल है
A
Only soft-deleted records केवल सॉफ्ट-डिलीट किए गए रिकॉर्ड
B
All records including soft-deleted ones सॉफ़्ट-डिलीट सहित सभी रिकॉर्ड
C
Only active records केवल सक्रिय रिकॉर्ड
D
Only trashed records केवल रिकॉर्ड रद्दी कर दिए गए
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) withTrashed()->get(): includes BOTH soft-deleted and non-deleted records.
व्याख्या (हिन्दी) withTrashed()->get(): इसमें सॉफ्ट-डिलीट और नॉन-डिलीट किए गए दोनों रिकॉर्ड शामिल हैं।
2631
EN + हिं Medium
GB belongsToMany() is used for
IN संबंधितToMany() का उपयोग किसके लिए किया जाता है?
A
One-to-one एक से एक
B
One-to-many कई लोगों के लिए एक
C
Many-to-many relationship requiring pivot table अनेक-से-अनेक संबंध के लिए पिवट तालिका की आवश्यकता होती है
D
Polymorphic बहुरूपी
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) belongsToMany: defines M:N relationship using a pivot (junction) table.
व्याख्या (हिन्दी) संबंधितToMany: पिवट (जंक्शन) तालिका का उपयोग करके M:N संबंध को परिभाषित करता है।
2632
EN + हिं Medium
GB chunk(100, callback) in Eloquent
IN सुवक्ता में खंड(100, कॉलबैक)।
A
Paginates results परिणाम पृष्ठांकित करता है
B
Processes records 100 at a time preventing memory exhaustion मेमोरी थकावट को रोकने के लिए प्रक्रियाएं एक समय में 100 रिकॉर्ड करती हैं
C
Sorts records अभिलेखों को क्रमबद्ध करता है
D
Groups records समूह अभिलेख
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) chunk: processes large datasets in batches of N records, preventing OOM for millions of rows.
व्याख्या (हिन्दी) खंड: एन रिकॉर्ड के बैचों में बड़े डेटासेट को संसाधित करता है, लाखों पंक्तियों के लिए ओओएम को रोकता है।
2633
EN + हिं Medium
GB DB::table('questions')->get() returns
IN DB::table('questions')->get() रिटर्न
A
Eloquent models वाक्पटु मॉडल
B
Plain PHP stdClass objects (not Eloquent model instances) सादा PHP stdClass ऑब्जेक्ट (एलोक्वेंट मॉडल उदाहरण नहीं)
C
Array of arrays सरणियों की श्रृंखला
D
Paginator पेजिनेटर
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Query Builder: returns stdClass objects. Eloquent's Model::all() returns model instances.
व्याख्या (हिन्दी) क्वेरी बिल्डर: stdClass ऑब्जेक्ट लौटाता है। एलोक्वेंट का मॉडल::सभी() मॉडल उदाहरण लौटाता है।
2634
EN + हिं Medium
GB DB::table('questions')->where('is_deleted',0)->count() returns
IN DB::table('questions')->where('is_deleted',0)->count() रिटर्न
A
All questions सभी प्रश्न
B
SQL DELETE count एसक्यूएल डिलीट गिनती
C
Integer count of non-deleted questions न हटाए गए प्रश्नों की पूर्णांक संख्या
D
NULL व्यर्थ
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) count(): returns number of rows matching query: SELECT COUNT(*) FROM questions WHERE is_deleted=0.
व्याख्या (हिन्दी) गिनती(): क्वेरी से मेल खाने वाली पंक्तियों की संख्या लौटाता है: उन प्रश्नों से COUNT(*) चुनें जहां_हटाया गया = 0 है।
2635
EN + हिं Medium
GB php artisan migrate:fresh
IN php कारीगर माइग्रेट: ताज़ा
A
Runs pending migrations लंबित माइग्रेशन चलाता है
B
Rolls back last batch अंतिम बैच वापस रोल करता है
C
Drops ALL tables then re-runs all migrations सभी तालिकाओं को हटाता है और फिर सभी माइग्रेशन को फिर से चलाता है
D
Refreshes one migration एक माइग्रेशन को ताज़ा करता है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) migrate:fresh: DROP all tables, then run all migrations from scratch. Clean slate.
व्याख्या (हिन्दी) माइग्रेट: ताज़ा: सभी तालिकाओं को हटा दें, फिर स्क्रैच से सभी माइग्रेशन चलाएँ। नई शुरुआत।
2636
EN + हिं Medium
GB Schema::create() in migration
IN माइग्रेशन में Schema::create()
A
Drops a table एक टेबल गिरा देता है
B
Creates a new database table एक नई डेटाबेस टेबल बनाता है
C
Modifies existing table मौजूदा तालिका को संशोधित करता है
D
Creates index only केवल सूचकांक बनाता है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Schema::create('tablename', fn(Blueprint $table){...}) creates a new table.
व्याख्या (हिन्दी) Schema::create('tablename', fn(Blueprint $table){...}) एक नई तालिका बनाता है।
2637
EN + हिं Medium
GB $table->id() creates
IN $table->id() बनाता है
A
UUID column यूयूआईडी कॉलम
B
AUTO_INCREMENT UNSIGNED BIGINT primary key column named id AUTO_INCREMENT अहस्ताक्षरित BIGINT प्राथमिक कुंजी कॉलम जिसका नाम आईडी है
C
Non-primary integer गैर-प्राथमिक पूर्णांक
D
VARCHAR id वचर आईडी
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) id() shorthand for bigIncrements('id'): auto-increment BIGINT UNSIGNED primary key.
व्याख्या (हिन्दी) आईडी() bigIncrements('id') के लिए शॉर्टहैंड: ऑटो-इंक्रीमेंट BIGINT UNSIGNED प्राथमिक कुंजी।
2638
EN + हिं Medium
GB $table->string('question') creates
IN $table->string('question') बनाता है
A
INTEGER column पूर्णांक स्तंभ
B
TEXT column पाठ स्तंभ
C
VARCHAR(255) column named question VARCHAR(255) कॉलम का नाम प्रश्न है
D
CHAR(255) चार(255)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) string('column') creates VARCHAR(255) by default.
व्याख्या (हिन्दी) स्ट्रिंग('कॉलम') डिफ़ॉल्ट रूप से VARCHAR(255) बनाता है।
2639
EN + हिं Medium
GB $table->text('solution') creates
IN $table->text('solution') बनाता है
A
VARCHAR(255) वर्चर(255)
B
INTEGER पूर्णांक
C
TEXT column for large text content बड़ी पाठ्य सामग्री के लिए टेक्स्ट कॉलम
D
BLOB ब्लॉब
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) text('column'): creates TEXT column for larger text (up to 65,535 characters).
व्याख्या (हिन्दी) टेक्स्ट('कॉलम'): बड़े टेक्स्ट (65,535 अक्षरों तक) के लिए टेक्स्ट कॉलम बनाता है।
2640
EN + हिं Medium
GB $table->timestamps() adds
IN $table->timestamps() जोड़ता है
A
One timestamp column एक टाइमस्टैम्प कॉलम
B
A date column एक दिनांक स्तंभ
C
created_at and updated_at TIMESTAMP NULL columns create_at और update_at TIMESTAMP NULL कॉलम
D
Only updated_at केवल अपडेटेड_एट
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) timestamps(): adds both created_at AND updated_at NULLABLE TIMESTAMP columns.
व्याख्या (हिन्दी) टाइमस्टैम्प(): create_at और अपडेटेड_at NULLABLE TIMESTAMP कॉलम दोनों जोड़ता है।
2626–2640 of 2982