DBMS — MCQ Practice

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

📚 639 Questions 🌐 Hindi + English ✅ Free
भाषा / Language:
639 questions
346
EN + हिं Medium
GB Question::all() returns
IN प्रश्न::सभी() रिटर्न
A
First record only केवल पहला रिकॉर्ड
B
Collection of all Question model instances सभी प्रश्न मॉडल उदाहरणों का संग्रह
C
Count of questions प्रश्नों की संख्या
D
NULL व्यर्थ
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Model::all(): retrieves ALL rows from table as a Collection of model instances.
व्याख्या (हिन्दी) मॉडल::सभी(): मॉडल उदाहरणों के संग्रह के रूप में तालिका से सभी पंक्तियों को पुनर्प्राप्त करता है।
347
EN + हिं Medium
GB Question::find(1) returns
IN प्रश्न::(1) रिटर्न खोजें
A
All questions सभी प्रश्न
B
Question with PK=1 or NULL if not found यदि नहीं मिला तो PK=1 या NULL वाला प्रश्न
C
Questions where id>1 प्रश्न जहां आईडी>1
D
First question only केवल पहला प्रश्न
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) find($id): retrieves model with that primary key value, or NULL if not found.
व्याख्या (हिन्दी) ढूंढें($id): उस प्राथमिक कुंजी मान के साथ मॉडल पुनर्प्राप्त करता है, या नहीं मिलने पर NULL प्राप्त करता है।
348
EN + हिं Medium
GB findOrFail($id) when ID not found
IN जब आईडी नहीं मिली तो findOrFair($id)।
A
Returns NULL शून्य लौटाता है
B
Returns empty collection खाली संग्रह लौटाता है
C
Throws ModelNotFoundException मॉडलनॉटफाउंडएक्सेप्शन फेंकता है
D
Creates new record नया रिकॉर्ड बनाया
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) findOrFail: throws ModelNotFoundException (404 in web context) if record not found.
व्याख्या (हिन्दी) findOrFair: यदि रिकॉर्ड नहीं मिला तो मॉडलनॉटफाउंडएक्सेप्शन (वेब ​​​​संदर्भ में 404) फेंकता है।
349
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 नहीं)।
350
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 श्वेतसूची या $ संरक्षित ब्लैकलिस्ट को परिभाषित करना होगा।
351
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 में) के लिए अद्यतन निष्पादित करता है।
352
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 में रहती हैं लेकिन सामान्य प्रश्नों से बाहर रखी जाती हैं।
353
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(): इसमें सॉफ्ट-डिलीट और नॉन-डिलीट किए गए दोनों रिकॉर्ड शामिल हैं।
354
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 संबंध को परिभाषित करता है।
355
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.
व्याख्या (हिन्दी) खंड: एन रिकॉर्ड के बैचों में बड़े डेटासेट को संसाधित करता है, लाखों पंक्तियों के लिए ओओएम को रोकता है।
356
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 ऑब्जेक्ट लौटाता है। एलोक्वेंट का मॉडल::सभी() मॉडल उदाहरण लौटाता है।
357
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 है।
358
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.
व्याख्या (हिन्दी) माइग्रेट: ताज़ा: सभी तालिकाओं को हटा दें, फिर स्क्रैच से सभी माइग्रेशन चलाएँ। नई शुरुआत।
359
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){...}) एक नई तालिका बनाता है।
360
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 प्राथमिक कुंजी।
346–360 of 639