पहले 10 प्रश्नों के उत्तर और हल यहीं खुले हैं; बाक़ी 15 के उत्तर और हल FliQi Question Bank app में।
भाषा
प्रश्न 1उत्तर + हल
Oracle database में जब GRANT statement चलाया जाता है, तब चल रहे transaction का क्या होता है?
In an Oracle database, what happens to the transaction in progress when a GRANT statement is executed?
Aकुछ नहीं; GRANT स्पष्ट COMMIT की प्रतीक्षा करता हैNothing; the GRANT waits for an explicit COMMIT
BGRANT अपने आप commit हो जाता है, और लंबित transaction भी उसके साथ commit हो जाता हैThe GRANT commits by itself, and the pending transaction is committed along with it
Cलंबित transaction rollback हो जाता है और GRANT रद्द हो जाता हैThe pending transaction is rolled back and the GRANT is cancelled
Dtransaction खुला होने पर GRANT नाकाम हो जाता हैThe GRANT fails because a transaction is open
सही उत्तर / Answer: (B)
हल / Solution
Oracle में DDL और DCL statements अपने साथ निहित COMMIT लेकर चलते हैं, इसलिए GRANT तुरंत प्रभावी हो जाता है और उससे पहले के लंबित DML बदलाव भी उसी के साथ स्थायी हो जाते हैं। यही कारण है कि बाद का ROLLBACK किसी GRANT को नहीं पलटता। COMMIT और ROLLBACK जैसे TCL command केवल आँकड़ों के बदलाव सँभालने के लिए ज़रूरी रहते हैं।
In Oracle, DDL and DCL statements carry an implicit COMMIT with them, so a GRANT takes effect at once and the pending DML changes made before it become permanent along with it. This is the reason a later ROLLBACK will not undo a GRANT. TCL commands such as COMMIT and ROLLBACK stay necessary only for handling changes to the data itself.
प्रश्न 2उत्तर + हल
GRANT SELECT ON exam_result TO PUBLIC; — इस statement का प्रभाव क्या होगा?
GRANT SELECT ON exam_result TO PUBLIC; What is the effect of this statement?
Aकेवल DBA ही exam_result पढ़ सकेगाOnly the DBA will be able to read exam_result
Bdatabase का हर user exam_result पढ़ने की अनुमति पा जाएगाEvery user of the database gets permission to read exam_result
Ctable उसके मालिक के लिए भी केवल पढ़ने योग्य रह जाएगाThe table becomes read-only even for its owner
Dtable network पर बाहरी लोगों के लिए प्रकाशित हो जाएगाThe table is published on the network for outsiders
सही उत्तर / Answer: (B)
हल / Solution
PUBLIC किसी एक user का नाम नहीं, बल्कि database के सभी खातों का प्रतिनिधि है — जो अभी हैं और जो आगे बनेंगे, उन सबको यह SELECT मिल जाती है। इसी कारण संवेदनशील table पर PUBLIC को अनुमति देना जोखिम भरा माना जाता है। मालिक के अपने अधिकार घटते नहीं, और database के बाहर के लोगों को इससे कोई पहुँच नहीं मिलती — उन्हें खाता चाहिए।
PUBLIC is not the name of one user but stands for every account in the database, so this SELECT reaches all users who exist now and all who will be created later. That is exactly why granting to PUBLIC on a sensitive table counts as risky. The owner's own rights are not reduced, and people outside the database gain nothing, since they still need an account.
प्रश्न 3उत्तर + हल
हर user को अलग-अलग अनुमति देने के बजाय role के ज़रिये अनुमतियाँ देने का मुख्य प्रशासनिक लाभ क्या है?
What is the main administrative advantage of granting privileges through a role instead of granting them to each user separately?
Arole को एक बार बदलकर अनेक users की अनुमतियाँ बदली जा सकती हैंThe privileges of many users can be changed by altering the role just once
Bdatabase queries अधिक तेज़ी से चलने लगती हैंDatabase queries begin to run faster
Crole होने पर user खाते बनाने की ज़रूरत ही नहीं रहतीRoles remove the need to create user accounts at all
Dtables में रखे आँकड़े कम जगह लेने लगते हैंThe data stored in tables takes up less space
सही उत्तर / Answer: (A)
हल / Solution
role से अनुमतियाँ देने पर सभी users एक ही समूह से जुड़ जाते हैं, इसलिए नियम बदलते समय केवल role की privileges सुधारनी पड़ती हैं और बदलाव हर जुड़े user पर अपने आप लागू हो जाता है — सैकड़ों GRANT दोहराने की ज़रूरत नहीं रहती। role का उद्देश्य प्रशासन सरल करना है; इससे query की गति या भंडारण की जगह नहीं बदलती, और user खाते अलग से बनाने ही पड़ते हैं।
Granting through a role attaches all the users to one group, so when the rules change only the role's privileges need correcting and the change applies by itself to every attached user, with no need to repeat hundreds of GRANT statements. The purpose of a role is to simplify administration; it changes neither query speed nor storage space, and user accounts still have to be created separately.
प्रश्न 4उत्तर + हल
role के ज़रिये अनुमतियाँ देने के लिए चरणों का सही क्रम कौन-सा है?
Which is the correct order of steps for granting privileges through a role?
Arole बनाइए, फिर role को privileges दीजिए, फिर role users को दीजिएCreate the role, then grant privileges to the role, then grant the role to users
Busers को privileges दीजिए, फिर role बनाइए, फिर role users को दीजिएGrant privileges to users, then create the role, then grant the role to users
Crole बनाइए, फिर role users को दीजिए, फिर role से privileges वापस लीजिएCreate the role, then grant the role to users, then revoke privileges from the role
Drole users को दीजिए, फिर role बनाइए, फिर role को privileges दीजिएGrant the role to users, then create the role, then grant privileges to the role
सही उत्तर / Answer: (A)
हल / Solution
पहले CREATE ROLE से role बनाना पड़ता है, क्योंकि जो चीज़ मौजूद ही न हो उसे कुछ दिया नहीं जा सकता। फिर GRANT से उसमें ज़रूरी privileges भरी जाती हैं, और अंत में वही role users को दे दिया जाता है — तब users को समूह की सारी अनुमतियाँ मिल जाती हैं। जिस क्रम में role बनने से पहले ही उसे users को दिया जा रहा है, वह असंभव है।
The role has to be built first with CREATE ROLE, since nothing can be given to something that does not yet exist. Privileges are then loaded into it with GRANT, and finally that same role is granted to the users, who thereby receive every permission in the group. Any order that hands the role out before it has even been created is simply impossible.
प्रश्न 5उत्तर + हल
SQL में role का सबसे सही वर्णन क्या है?
In SQL, a role is best described as:
Aअनुमतियों का एक नामित समूह, जिसे एक इकाई के रूप में दिया जा सकता हैA named group of privileges that can be granted as a single unit
Bकिसी table की वह प्रतिलिपि जो backup के लिए रखी जाती हैA copy of a table that is kept for backup
Ctransaction के भीतर बनाया गया एक अस्थायी tableA temporary table created inside a transaction
Dएक constraint, जो किसी column के मानों को सीमित करता हैA constraint that limits the values in a column
सही उत्तर / Answer: (A)
हल / Solution
role अनुमतियों का एक नामित समूह होता है: एक बार उसमें privileges डाल दीजिए, फिर पूरे समूह को एक ही GRANT से किसी user को दे दीजिए। यही उसका उद्देश्य है, इसलिए अनुमतियों का नामित समूह ही सही उत्तर है। backup की प्रतिलिपि, अस्थायी table और constraint — तीनों database की अलग-अलग अवधारणाएँ हैं और किसी का भी काम अनुमतियाँ सँभालना नहीं है।
A role is a named group of privileges: you put privileges into it once, and then hand the whole group to a user with a single GRANT. That is exactly its purpose, so a named group of privileges is the right answer. A backup copy, a temporary table and a constraint are three quite separate database ideas, and not one of them has the job of managing permissions.
प्रश्न 6उत्तर + हल
मानक SQL में REVOKE statement का कौन-सा शब्द उस statement को नाकाम करा देता है, यदि वापस ली जा रही अनुमति पर कोई दूसरी अनुमति निर्भर हो?
In standard SQL, which keyword in a REVOKE statement makes the statement fail if other privileges depend on the one being revoked?
ACASCADE
BFORCE
CRESTRICT
DCHECK
सही उत्तर / Answer: (C)
हल / Solution
मानक SQL में REVOKE के साथ RESTRICT लिखने पर, जब तक कोई निर्भर अनुमति मौजूद है, DBMS वापसी से इनकार कर देता है और statement नाकाम हो जाता है — यह सतर्कता का विकल्प है। CASCADE इसके उलट काम करता है: वह निर्भर अनुमतियों को भी साथ ही हटा देता है। FORCE और CHECK REVOKE के शब्द नहीं हैं; CHECK तो constraint के लिए प्रयोग होता है।
Writing RESTRICT with REVOKE in standard SQL makes the DBMS refuse the withdrawal while any dependent privilege still exists, so the statement fails; it is the cautious choice. CASCADE does the opposite and removes the dependent privileges along with it. FORCE and CHECK are not keywords of REVOKE at all, and CHECK in fact belongs to constraints.
प्रश्न 7उत्तर + हल
मालिक एक table पर SELECT की अनुमति B को WITH GRANT OPTION के साथ देता है, और B उसी पर SELECT की अनुमति C को दे देता है। अब मालिक B से SELECT वापस ले लेता है। अधिकांश DBMS के डिफ़ॉल्ट झरना (cascade) व्यवहार में C का क्या होगा?
The owner grants SELECT on a table to B WITH GRANT OPTION, and B then grants SELECT on it to C. The owner now revokes SELECT from B. Under the default cascading behaviour of most DBMS, what happens to C?
AC की अनुमति बनी रहेगी, क्योंकि वह B ने स्वतंत्र रूप से दी थीC keeps the privilege, because B granted it independently
BC की अनुमति भी चली जाएगी, क्योंकि जिस अनुमति पर वह टिकी थी वही वापस ले ली गईC also loses the privilege, because the grant it depended upon has been withdrawn
CC की अनुमति बनी रहेगी, पर उसे आगे बाँटने का अधिकार चला जाएगाC keeps the privilege but loses the right to pass it on further
DC की अनुमति रुक जाएगी और B को फिर अनुमति मिलने पर अपने आप लौट आएगीC's privilege is suspended and returns by itself once B is granted again
सही उत्तर / Answer: (B)
हल / Solution
B अपनी ही पाई हुई अनुमति के बल पर C को अनुमति दे सका था, इसलिए C की अनुमति B की अनुमति पर निर्भर थी। मालिक जब B से SELECT वापस लेता है तो यह निर्भरता टूट जाती है और वापसी झरने की तरह आगे चलकर C की अनुमति भी हटा देती है; इसे cascading revoke कहते हैं। इसीलिए C की अनुमति न बची रहती है, न रुककर अपने आप लौटती है।
B could grant the permission to C only on the strength of the permission B had himself received, so C's privilege depended upon B's. When the owner revokes SELECT from B that dependence breaks, and the revoke flows onward like a cascade to remove C's privilege too, which is called a cascading revoke. C's privilege therefore neither survives nor returns by itself later.
प्रश्न 8उत्तर + हल
GRANT SELECT ON marks TO raju WITH GRANT OPTION; — इस statement का अंतिम भाग raju के लिए कौन-सा काम संभव बनाता है?
GRANT SELECT ON marks TO raju WITH GRANT OPTION; Which action does the last part of this statement make possible for raju?
Aवह marks की पंक्तियाँ भी बदल सकता हैHe can change the rows of marks as well
Bवह marks पर SELECT की अनुमति दूसरे users को दे सकता हैHe can give SELECT on marks to other users
Cवह marks table को हटा सकता हैHe can drop the table marks
Dउसे यह अनुमति केवल log out होने तक मिलती हैHe holds the permission only until he logs out
सही उत्तर / Answer: (B)
हल / Solution
WITH GRANT OPTION पाने वाले user को मिली अनुमति आगे बाँटने का अधिकार भी दे देता है, इसलिए raju अब marks पर SELECT दूसरों को दे सकेगा। यह उसकी अपनी अनुमति का दायरा नहीं बढ़ाता — पंक्तियाँ बदलने के लिए अलग से UPDATE और table हटाने के लिए मालिक का अधिकार चाहिए। यह अनुमति session समाप्त होने पर ख़त्म नहीं होती, REVOKE तक बनी रहती है।
WITH GRANT OPTION also hands the receiving user the right to pass the granted permission further on, so raju may now give SELECT on marks to others. It does not widen his own permission: changing rows would need UPDATE separately, and dropping the table needs the owner's authority. The permission does not lapse when his session ends either; it lasts until a REVOKE.
प्रश्न 9उत्तर + हल
कौन-सी object privilege किसी user को table में नई पंक्तियाँ जोड़ने देती है?
Which object privilege allows a user to add new rows to a table?
ASELECT
BINSERT
CUPDATE
DDELETE
सही उत्तर / Answer: (B)
हल / Solution
नई पंक्ति जोड़ने का काम INSERT statement करता है, इसलिए उसे चलाने की छूट देने वाली privilege भी INSERT ही है। SELECT से केवल पंक्तियाँ पढ़ी जाती हैं, UPDATE से पहले से मौजूद पंक्तियों के मान बदले जाते हैं, और DELETE से पंक्तियाँ हटाई जाती हैं — इनमें से कोई भी नई पंक्ति नहीं बनाता। ये चारों table पर दी जाने वाली object privileges हैं।
Adding a new row is the work of the INSERT statement, so the privilege permitting it is likewise called INSERT. SELECT only reads rows, UPDATE changes the values in rows that already exist, and DELETE removes rows, so none of those three ever creates a new row. All four of them are object privileges granted on a table.
प्रश्न 10उत्तर + हल
किसी दूसरे user के stored procedure को चलाने के लिए user के पास कौन-सी privilege होनी चाहिए?
Which privilege must a user hold in order to run a stored procedure owned by another user?
ASELECT
BUPDATE
CREFERENCES
DEXECUTE
सही उत्तर / Answer: (D)
हल / Solution
procedure, function और package जैसे चलाए जाने वाले objects पर दी जाने वाली object privilege EXECUTE है, इसलिए दूसरे user का procedure चलाने के लिए उसी की ज़रूरत है। SELECT और UPDATE table या view की पंक्तियों पर लागू होती हैं, procedure पर नहीं। REFERENCES केवल foreign key बनाने के काम आती है। EXECUTE मिलने पर user procedure का भीतरी code बदल नहीं सकता, केवल चला सकता है।
EXECUTE is the object privilege given on runnable objects such as procedures, functions and packages, so that is what is needed to run another user's procedure. SELECT and UPDATE apply to the rows of a table or view and not to a procedure. REFERENCES serves only for building a foreign key. Holding EXECUTE lets a user run the procedure but never alter the code inside it.
आगे के 15 प्रश्नों के उत्तर और हल app मेंFliQi Question Bank — अभ्यास, हल और आपकी प्रगति
raju ऐसा table बनाना चाहता है जिसकी foreign key किसी दूसरे user के table की primary key की ओर संकेत करे। उस table पर उसे कौन-सी privilege मिलनी चाहिए?
Raju wants to create a table whose foreign key points at the primary key of a table owned by another user. Which privilege must he be granted on that table?
एक DBA पहले किसी table का ढाँचा ही हटा देता है, फिर दूसरे table पर एक user का SELECT अधिकार वापस ले लेता है। ये दोनों काम क्रमशः किन श्रेणियों के command से होते हैं?
A DBA first removes the structure of a table, and then withdraws a user's SELECT right on another table. These two actions use commands from which categories, in that order?