shadow paging में transaction चलते समय shadow page table का क्या होता है?
What happens to the shadow page table during transaction execution in shadow paging?
Aहर transaction operation के बाद वह बदल दी जाती हैIt is updated after each transaction operation
Btransaction के commit होने तक वह जैसी है वैसी रहती हैIt remains unchanged until the transaction commits
Cहर transaction के लिए वह नए सिरे से बनाई जाती हैIt is recreated for each transaction
Dवह transaction की निर्भरताएँ जानने के लिए इस्तेमाल होती हैIt is used to track transaction dependencies
सही उत्तर / Answer: (B)
हल / Solution
shadow paging में दो page table चलते हैं। transaction जिस पर काम करता है वह current है, उसमें नए पन्नों के पते जुड़ते जाते हैं। shadow table को कोई नहीं छूता, वह commit तक पुरानी जमी हुई हालत की ओर इशारा करती रहती है — abort होते ही उसी पर लौट आते हैं। हर transaction की शुरुआत में shadow एक बार बनती ज़रूर है, पर प्रश्न चलने के दौरान की बात पूछ रहा है, तब वह अछूती रहती है।
Shadow paging works with two page tables. The transaction operates on the current table, and addresses of freshly written pages keep getting added there. Nobody touches the shadow table; until the commit it keeps pointing at the old frozen state, and an abort simply returns to it. A shadow copy is indeed made once at the start of each transaction, but the question asks about the execution period, and during that period the shadow table stays untouched.
Snapshot Isolation में पढ़ने के काम कैसे सँभाले जाते हैं?
In Snapshot Isolation, how are read operations handled?
Aपढ़ने वालों को डेटा का सबसे नया संस्करण मिलता हैReads are allowed to access the most recent version of data
Bटकराने वाले सारे transaction पूरे होने तक पढ़ना रोक दिया जाता हैReads are blocked until all conflicting transactions complete
Cपढ़ने वाले transaction शुरू होने के समय के संगत snapshot से पढ़ते हैंReads access a consistent snapshot of the database at the start of the transaction
Dपढ़ने वाले transaction की हालत देखे बिना किसी भी संस्करण से पढ़ सकते हैंReads are allowed to access any version of data, regardless of transactional state
सही उत्तर / Answer: (C)
हल / Solution
Snapshot Isolation में transaction को शुरुआत में ही एक snapshot मिल जाता है और उसके सारे पढ़ाई-कार्य उसी रूप से होते हैं। बीच में कोई और commit कर दे तो वह बदलाव इस transaction को दिखता नहीं, इसलिए वही query दोबारा चलाने पर भी वही नतीजा आता है। सबसे नया संस्करण देना ग़लत है क्योंकि वह snapshot से बाहर का हो सकता है। पढ़ाई रोकी नहीं जाती, और बिना commit वाले संस्करण कभी नहीं दिखते।
Under Snapshot Isolation a transaction receives its snapshot at the start, and all of its reads are served from that same view. If someone else commits meanwhile, the change stays invisible to this transaction, so rerunning the same query gives the same answer. Handing over the newest version would be wrong, since it may lie outside the snapshot. Reads are never blocked, and uncommitted versions are never shown.
एक social media platform पर transaction T1 किसी उपयोगकर्ता की profile पर status update डालता है और transaction T2 उसी उपयोगकर्ता की profile picture पढ़ता है। दोनों के बीच view serializability के बारे में कौन-सा कथन सही है?
In a social media platform, transaction T1 posts a status update on a user's profile, while transaction T2 retrieves the user's profile picture. Which of the following options accurately describes the view serializability between T1 and T2?
Aview serializability तय नहीं की जा सकती।View serializability cannot be determined.
BT1 और T2 view serializable नहीं हैं।T1 and T2 are not view serializable.
CT1 और T2 view serializable हैं।T1 and T2 are view serializable.
Dइस स्थिति में view serializability लागू ही नहीं होती।View serializability is not applicable in this scenario.
सही उत्तर / Answer: (C)
हल / Solution
status update और profile picture दो अलग data item हैं। T1 पहले वाले पर लिखता है, T2 दूसरे को पढ़ता है, इसलिए दोनों के बीच कोई conflicting जोड़ी बनती ही नहीं। ऐसे में इनका कोई भी schedule किसी serial क्रम के बराबर होता है, यानी view serializable है। 'तय नहीं की जा सकती' और 'लागू नहीं होती' दोनों ग़लत हैं, क्योंकि view serializability हर schedule पर लागू होती है और यहाँ आसानी से तय भी हो जाती है।
The status update and the profile picture are two separate data items. T1 writes the first one and T2 reads the second, so no conflicting pair of operations exists between them. Any schedule of these two transactions is therefore equivalent to a serial order, which makes it view serializable. Saying it cannot be determined or does not apply is wrong, because view serializability applies to every schedule and is easy to settle here.
क्वेरी optimization में predicate pushdown का उद्देश्य क्या है?
In query optimization, what is the purpose of predicate pushdown?
Aशर्तों को जितना जल्दी हो सके जाँच लेनाTo evaluate predicates as early as possible in the query execution process
Bशर्तों की जाँच बाक़ी सारी क्रियाओं के बाद तक टाल देनाTo postpone predicate evaluation until all other operations have been performed
Cplan से बेकार पड़ी शर्तें हटा देनाTo eliminate redundant predicates from the query execution plan
Dबीच के परिणामों पर शर्तें लगानाTo apply predicates to intermediate query results
सही उत्तर / Answer: (A)
हल / Solution
pushdown का मक़सद है शर्त को plan में जितना जल्दी हो सके लगा देना, यानी join और sort से भी पहले। ऐसा करने पर आगे के चरणों को बहुत कम पंक्तियाँ मिलती हैं और बीच के परिणाम छोटे रह जाते हैं। इसलिए पहला विकल्प सही है। शर्त को अंत तक टालना तो उलटा काम है। बेकार शर्तें हटाना predicate elimination कहलाता है, और बीच के परिणाम पर शर्त लगाना वही देर वाली स्थिति है जिससे बचना है।
The point of pushdown is to apply a condition as early in the plan as possible, even before the joins and sorts. The later steps then receive far fewer rows and the intermediate results stay small, which cuts the cost. Hence option 1. Postponing the condition until the end is the opposite idea. Dropping useless conditions is called predicate elimination, and filtering only the intermediate results is exactly the late evaluation we want to avoid.
B+ tree में traversal के दौरान internal node से leaf node तक pointer के पीछे चलने का उद्देश्य क्या है?
During a traversal operation in a B+ tree, what is the purpose of following the pointers from internal nodes to leaf nodes?
Aजिस key की तलाश है उस तक पहुँचनाTo locate the target key
Bपेड़ को दोबारा संतुलित करनाTo rebalance the tree
Cपेड़ में keys की कुल गिनती करनाTo count the total number of keys in the tree
Dkeys को क्रम में दोबारा जमानाTo rearrange the keys in sorted order
सही उत्तर / Answer: (A)
हल / Solution
internal node data नहीं रखते, वे सिर्फ़ रास्ता बताते हैं। हर node पर खोजी जा रही key की तुलना वहाँ रखी keys से होती है और उसी से आगे का pointer चुना जाता है। इसी तरह वह leaf मिल जाता है जहाँ record या उसका pointer पड़ा है। संतुलन insert और delete के समय बनता है, खोज के समय नहीं। गिनती और क्रम जमाना traversal का मक़सद नहीं, क्योंकि leaf पहले से क्रम में हैं।
Internal nodes of a B+ tree hold no data at all, they only point the way. At each node the searched key is compared with the separator keys, and that decides which child pointer to follow. Step by step the walk reaches the leaf holding the record or its pointer. Rebalancing belongs to insert and delete, not to a read. Counting keys or sorting them is not the aim either, since the leaves are already kept in order.
सशर्त अखंडता प्रतिबंध किस स्थिति में सबसे उपयोगी होते हैं?
In what scenario would conditional integrity constraints be most useful?
Aजब कई तालिकाओं में अनोखापन लागू करना होWhen enforcing uniqueness across multiple tables
Bजब कुछ डेटा प्रविष्टियों को दर्ज होने से पहले स्वीकृति चाहिए होWhen certain data entries require approval before being committed
Cजब प्रतिबंध का लागू होना कुछ ख़ास शर्तों के पूरा होने पर निर्भर करता होWhen the integrity constraint depends on specific conditions being met
Dजब जनक-संतान तालिकाओं के बीच रेफरेंशियल इंटीग्रिटी बनानी होWhen ensuring referential integrity between parent-child tables
सही उत्तर / Answer: (C)
हल / Solution
सशर्त प्रतिबंध हर पंक्ति पर एक जैसा नहीं चलता, वह तभी लागू होता है जब कोई शर्त पूरी हो। जैसे कर्मचारी की श्रेणी स्थायी हो तभी पेंशन वाला स्तंभ भरा जाना ज़रूरी हो। इसलिए तीसरा विकल्प सही है। कई तालिकाओं में अनोखापन एसर्शन या ट्रिगर से सँभाला जाता है। स्वीकृति वाली बात कामकाज की प्रक्रिया है, प्रतिबंध नहीं। जनक-संतान का रिश्ता साधारण विदेशी कुंजी से ही बन जाता है।
A conditional constraint does not apply uniformly to every row; it takes effect only when a stated condition holds, for instance requiring the pension column to be filled only when an employee is marked permanent. That is why option 3 is correct. Uniqueness spanning several tables is handled by assertions or triggers. Requiring approval before data is committed is a workflow matter rather than a constraint, and a plain foreign key already establishes a parent-child link.
SQL में index fragmentation को कैसे दूर किया जाता है?
How can you address index fragmentation in SQL?
Aindex को नियमित रूप से दोबारा बनाकर (rebuild)By regularly rebuilding indexes
Bindex में और columns जोड़करBy adding more columns to the index
Cindex का schema बदलकरBy modifying the index schema
Dindex statistics को अद्यतन करकेBy updating index statistics
सही उत्तर / Answer: (A)
हल / Solution
Fragmentation का मतलब है कि index के पेज क्रम से नहीं रहे और उनमें ख़ाली जगह बढ़ गई। इसका सीधा इलाज rebuild है, जो पूरे index को नए सिरे से सजा देता है; हल्का बिखराव हो तो reorganize से भी काम चल जाता है। Columns जोड़ने से index और भारी ही होगा, और schema बदलना अलग बात है। Statistics अद्यतन करना ज़रूरी काम है, पर वह optimizer के अंदाज़े सुधारता है, पेजों का बिखराव नहीं मिटाता।
Fragmentation means the index pages are no longer in order and carry a lot of empty space. The direct cure is a rebuild, which lays the whole index out again, while light fragmentation can be cleared by a reorganize. Adding columns would only make the index heavier, and changing the schema is a separate matter. Updating statistics is useful work, but it sharpens the optimizer estimates and does nothing about scattered pages.
database में किसी user को अधिकार देने के लिए कौन-सा SQL command चलाया जाता है?
Which SQL command is used to grant privileges to a user in a database?
AGRANT
BALLOW
CPERMISSION
DACCESS
सही उत्तर / Answer: (A)
हल / Solution
अधिकार देने का command GRANT है, इसलिए विकल्प 1 सही है — GRANT SELECT ON student TO ravi; दिया हुआ अधिकार वापस लेना हो तो REVOKE चलाते हैं। बाक़ी तीनों शब्द SQL के command नहीं हैं। GRANT और REVOKE दोनों DCL यानी data control language में आते हैं, जिसका काम यह तय करना है कि कौन किस तालिका पर क्या कर सकता है — पढ़ना, जोड़ना, बदलना या मिटाना।
Privileges are handed out with GRANT, so option 1 is right, as in GRANT SELECT ON student TO ravi; To take a privilege back you run REVOKE instead. The other three words are not SQL commands at all. GRANT and REVOKE belong to DCL, the data control language, whose job is to decide who may do what on which table: read it, insert into it, change it or delete from it.
रिलेशनल अलजेब्रा में प्रोजेक्शन संक्रिया को कौन-सा संकेतन दर्शाता है?
Which notation represents the projection operation in relational algebra?
Aσ_{condition}(Relation)
Bπ_{attributes}(Relation)
Cρ_{relation}(Attribute)
Dω_{condition}(Relation)
सही उत्तर / Answer: (B)
हल / Solution
प्रोजेक्शन का संकेतन π_{attributes}(Relation) है — पाई के नीचे उन attribute की सूची जो रखनी है, और कोष्ठक में रिलेशन। σ वाला रूप सिलेक्शन का है, जहाँ subscript में शर्त आती है, नामों की सूची नहीं। ρ रीनेम का चिह्न है और वह सिर्फ़ नया नाम देने के काम आता है। ω मानक संक्रियाओं में है ही नहीं। इसलिए attribute चुनने वाले प्रोजेक्शन के लिए दूसरा संकेतन ही सही है।
Projection is written as pi with the list of attributes to keep placed in the subscript and the relation inside the brackets. The sigma form belongs to selection, whose subscript holds a condition rather than a list of column names. The rho form belongs to rename and only supplies new names. The letter omega has no standard meaning in relational algebra, so the second notation is the one that stands for projection.
जब ऐसे डेटा की माँग आती है जो उस समय डेटाबेस buffer में नहीं है, तब क्या होता है?
What happens when a request is made to access data that is not currently in the database buffer?
Aडेटा बैकअप वाली जगह से लाया जाता हैThe data is retrieved from a backup storage location
Bडेटा disk से पढ़कर buffer में लाया जाता हैThe data is retrieved from the disk and loaded into the buffer
Cडेटा दूर के किसी डेटाबेस server से लाया जाता हैThe data is retrieved from a remote database server
Dमाँग ठुकरा दी जाती है और ग़लती का संदेश लौटता हैThe request is rejected, and an error message is returned
सही उत्तर / Answer: (B)
हल / Solution
इसे buffer miss कहते हैं। buffer manager उस block को disk से पढ़ता है, buffer में किसी ख़ाली खाने में रखता है और फिर माँगने वाले को उसका पता देता है। जगह न बची हो तो पहले किसी पुराने पन्ने को हटाया जाता है, और वह बदला हुआ हो तो disk पर लिखा जाता है। बैकअप सिर्फ़ आपदा में खोला जाता है। दूर का server इस बात में आता ही नहीं। माँग ठुकराई नहीं जाती, बस थोड़ी देर लगती है।
This situation is called a buffer miss. The buffer manager reads that block from disk, places it in a free slot of the buffer and then hands the address to whoever asked for it. If no slot is free, an older page is evicted first, and if that page was modified it is written back to disk. A backup is opened only after a disaster. A remote server does not enter the picture, and the request is never rejected.
आगे के 10 प्रश्नों के उत्तर और हल app मेंFliQi Question Bank — अभ्यास, हल और आपकी प्रगति
ER मॉडल के समुच्चयन (aggregation) संबंध को डेटाबेस schema में बदलते समय, समुच्चित entity में foreign key का होना क्या बताता है?
In converting an aggregation relationship from an ER model to a database schema, what does the existence of a foreign key in the aggregated entity signify?
Aयह एक-से-एक संबंध बताता है।It indicates a one-to-one relationship.
Bयह एक-से-अनेक संबंध बताता है।It indicates a one-to-many relationship.
Cयह अनेक-से-एक संबंध बताता है।It represents a many-to-one relationship.
Dयह अनेक-से-अनेक संबंध बताता है।It represents a many-to-many relationship.
एक healthcare डेटाबेस में transaction T1 किसी मरीज़ का medical record बदलता है और transaction T2 उसी मरीज़ की demographic जानकारी पढ़ता है। दोनों के बीच view serializability की क्या स्थिति है?
In a healthcare database, transaction T1 updates a patient's medical record, while transaction T2 retrieves the patient's demographic information. What is the view serializability between T1 and T2?
AT1 और T2 view serializable हैं।T1 and T2 are view serializable.
Bview serializability तय नहीं की जा सकती।View serializability cannot be determined.
Cइस स्थिति में view serializability लागू ही नहीं होती।View serializability is not applicable in this scenario.
DT1 और T2 view serializable नहीं हैं।T1 and T2 are not view serializable.