FliQi Education App Download
प्रश्न-बैंक · DBMS

SQL Data Control Language — प्रश्न और उत्तर

DBMS · 25 जाँचे हुए (verified) प्रश्न

  • 25 जाँचे हुए प्रश्न
  • हिंदी + English

पहले 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?
  1. Aकुछ नहीं; GRANT स्पष्ट COMMIT की प्रतीक्षा करता हैNothing; the GRANT waits for an explicit COMMIT
  2. BGRANT अपने आप commit हो जाता है, और लंबित transaction भी उसके साथ commit हो जाता हैThe GRANT commits by itself, and the pending transaction is committed along with it
  3. Cलंबित transaction rollback हो जाता है और GRANT रद्द हो जाता हैThe pending transaction is rolled back and the GRANT is cancelled
  4. 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?
  1. Aकेवल DBA ही exam_result पढ़ सकेगाOnly the DBA will be able to read exam_result
  2. Bdatabase का हर user exam_result पढ़ने की अनुमति पा जाएगाEvery user of the database gets permission to read exam_result
  3. Ctable उसके मालिक के लिए भी केवल पढ़ने योग्य रह जाएगाThe table becomes read-only even for its owner
  4. 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?
  1. Arole को एक बार बदलकर अनेक users की अनुमतियाँ बदली जा सकती हैंThe privileges of many users can be changed by altering the role just once
  2. Bdatabase queries अधिक तेज़ी से चलने लगती हैंDatabase queries begin to run faster
  3. Crole होने पर user खाते बनाने की ज़रूरत ही नहीं रहतीRoles remove the need to create user accounts at all
  4. 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?
  1. Arole बनाइए, फिर role को privileges दीजिए, फिर role users को दीजिएCreate the role, then grant privileges to the role, then grant the role to users
  2. Busers को privileges दीजिए, फिर role बनाइए, फिर role users को दीजिएGrant privileges to users, then create the role, then grant the role to users
  3. Crole बनाइए, फिर role users को दीजिए, फिर role से privileges वापस लीजिएCreate the role, then grant the role to users, then revoke privileges from the role
  4. 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:
  1. Aअनुमतियों का एक नामित समूह, जिसे एक इकाई के रूप में दिया जा सकता हैA named group of privileges that can be granted as a single unit
  2. Bकिसी table की वह प्रतिलिपि जो backup के लिए रखी जाती हैA copy of a table that is kept for backup
  3. Ctransaction के भीतर बनाया गया एक अस्थायी tableA temporary table created inside a transaction
  4. 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?
  1. ACASCADE
  2. BFORCE
  3. CRESTRICT
  4. 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?
  1. AC की अनुमति बनी रहेगी, क्योंकि वह B ने स्वतंत्र रूप से दी थीC keeps the privilege, because B granted it independently
  2. BC की अनुमति भी चली जाएगी, क्योंकि जिस अनुमति पर वह टिकी थी वही वापस ले ली गईC also loses the privilege, because the grant it depended upon has been withdrawn
  3. CC की अनुमति बनी रहेगी, पर उसे आगे बाँटने का अधिकार चला जाएगाC keeps the privilege but loses the right to pass it on further
  4. 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?
  1. Aवह marks की पंक्तियाँ भी बदल सकता हैHe can change the rows of marks as well
  2. Bवह marks पर SELECT की अनुमति दूसरे users को दे सकता हैHe can give SELECT on marks to other users
  3. Cवह marks table को हटा सकता हैHe can drop the table marks
  4. 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?
  1. ASELECT
  2. BINSERT
  3. CUPDATE
  4. 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?
  1. ASELECT
  2. BUPDATE
  3. CREFERENCES
  4. 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 — अभ्यास, हल और आपकी प्रगति
App खोलिए
प्रश्न 11उत्तर app में
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?
  1. ASELECT
  2. BEXECUTE
  3. CREFERENCES
  4. DINDEX
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 14उत्तर app में
relational DBMS में अनुमतियाँ (privileges) मोटे तौर पर किन दो प्रकारों में बाँटी जाती हैं?
Privileges in a relational DBMS are broadly divided into which two kinds?
  1. Asystem privilege और object privilegeSystem privileges and object privileges
  2. Bread privilege और write privilegeRead privileges and write privileges
  3. Clocal privilege और remote privilegeLocal privileges and remote privileges
  4. Dprimary privilege और secondary privilegePrimary privileges and secondary privileges
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 15उत्तर app में
user A ने एक table पर SELECT की अनुमति user C को दी। उसी table पर SELECT रखने वाला एक साधारण user B क्या C की यह अनुमति वापस ले सकता है?
User A grants SELECT on a table to user C. Can user B, an ordinary user who also holds SELECT on the same table, revoke C's privilege?
  1. Aहाँ, वही अनुमति रखने वाला कोई भी user उसे वापस ले सकता हैYes, any user who holds the same privilege can revoke it
  2. Bहाँ, पर तभी जब B, CASCADE शब्द का प्रयोग करेYes, but only if B uses the keyword CASCADE
  3. Cनहीं — सामान्यतः वही user, जिसने अनुमति दी थी, या DBA ही उसे वापस ले सकता हैNo — normally only the user who granted it, or the DBA, can revoke it
  4. Dहाँ, क्योंकि SELECT सभी के लिए खुली अनुमति मानी जाती हैYes, because SELECT is treated as an open permission for everyone
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 16उत्तर app में
किसी table पर दूसरे users को अनुमति (privilege) कौन दे सकता है?
Who can grant privileges on a table to other users?
  1. Aवह कोई भी user जो उस table को पढ़ सकता हैAny user who is able to read that table
  2. Bकेवल operating system का प्रशासकOnly the administrator of the operating system
  3. Cdatabase का हर userEvery user of the database
  4. Dउस table का मालिक, तथा DBAThe owner of that table, and the DBA
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 17उत्तर app में
एक user के पास STOCK table पर SELECT, INSERT और UPDATE अनुमतियाँ हैं। मालिक अब चलाता है — REVOKE INSERT ON STOCK FROM <user>; इसका परिणाम क्या होगा?
A user holds SELECT, INSERT and UPDATE on the table STOCK. The owner now runs: REVOKE INSERT ON STOCK FROM <user>; What is the result?
  1. Auser की तीनों अनुमतियाँ चली जाएँगीThe user loses all three privileges on STOCK
  2. BSELECT और UPDATE बनी रहेंगी, पर वह नई पंक्ति नहीं जोड़ पाएगाSELECT and UPDATE remain, but the user can no longer add new rows
  3. Cकेवल SELECT बचेगी, UPDATE भी चली जाएगीOnly SELECT remains, UPDATE is lost as well
  4. Dstatement नाकाम होगा, क्योंकि अनुमतियाँ एक साथ ही वापस ली जा सकती हैंThe statement fails, because privileges can only be revoked together
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 18उत्तर app में
GRANT UPDATE(salary) ON employee TO raju; — यह statement raju को क्या करने देता है?
GRANT UPDATE(salary) ON employee TO raju; What does this statement allow raju to do?
  1. Aemployee के हर column का मान बदलनाChange the values in every column of employee
  2. Bemployee में नई पंक्तियाँ जोड़नाInsert new rows into employee
  3. Cemployee के सारे column पढ़ना, पर कोई बदलाव न करनाRead all columns of employee but change none of them
  4. Demployee के केवल salary column का मान बदलनाChange the values only in the salary column of employee
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 19उत्तर app में
निम्नलिखित में से कौन-सा statement user raju को EMPLOYEE table की पंक्तियाँ पढ़ने की अनुमति सही ढंग से देता है?
Which of the following statements correctly gives the user raju permission to read rows from the EMPLOYEE table?
  1. AGRANT SELECT ON EMPLOYEE TO raju;
  2. BGRANT raju TO SELECT ON EMPLOYEE;
  3. CGRANT SELECT TO EMPLOYEE ON raju;
  4. DGRANT SELECT FROM EMPLOYEE TO raju;
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 20उत्तर app में
एक 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?
  1. ADML और DCLDML and DCL
  2. BDDL और TCLDDL and TCL
  3. CDCL और DDLDCL and DDL
  4. DDDL और DCLDDL and DCL
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 21उत्तर app में
प्रत्येक command को उसकी श्रेणी से मिलाइए:
(a) CREATE
(b) DELETE
(c) REVOKE
(d) COMMIT
Match each command with the category it belongs to:
(a) CREATE
(b) DELETE
(c) REVOKE
(d) COMMIT
  1. A(a) DDL, (b) DML, (c) DCL, (d) TCL
  2. B(a) DDL, (b) DML, (c) TCL, (d) DCL
  3. C(a) DML, (b) DDL, (c) DCL, (d) TCL
  4. D(a) DDL, (b) DCL, (c) DML, (d) TCL
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
SQL Data Control Language के सभी 25 प्रश्न — उत्तर, हल और अभ्यास

FliQi Question Bank app में topic-वार अभ्यास, कठिनाई-स्तर और आपकी प्रगति।

  • पहला test मुफ़्त
  • हिंदी + English
  • जाँचे हुए उत्तर और हल

यह topic किन परीक्षाओं में आता है

DBMS के दूसरे topics

सभी topics