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

Structured Query Language (SQL) — प्रश्न और उत्तर

DBMS · 147 जाँचे हुए (verified) प्रश्न · इनमें 4 पिछले वर्षों के पेपरों से

  • 147 जाँचे हुए प्रश्न
  • 4 पिछले पेपरों से
  • हिंदी + English

पहले 10 प्रश्नों के उत्तर और हल यहीं खुले हैं; बाक़ी 20 के उत्तर और हल FliQi Question Bank app में।

भाषा
प्रश्न 1उत्तर + हल
ANSI-standard SQL, WHERE क्लॉज़ के साथ विशेष ऑपरेटरों के उपयोग की अनुमति देता है। किसी एट्रिब्यूट का मान null है या नहीं, यह जाँचने वाला विशेष ऑपरेटर है—
ANSI-standard SQL allows the use of special operators in conjunction with the WHERE clause. A special operator used to check whether an attribute value is null is:
  1. AIS NULL
  2. BLIKE
  3. CIN
  4. DEXISTS

सही उत्तर / Answer: (A)

हल / Solution
NULL का अर्थ है मान मौजूद नहीं या पता नहीं। इसे = से नहीं जाँचा जा सकता, क्योंकि NULL से कोई भी तुलना UNKNOWN देती है। इसलिए WHERE phone IS NULL जैसा लिखना पड़ता है। LIKE पाठ के पैटर्न से मिलान करता है। IN देखता है कि मान किसी सूची में है या नहीं। EXISTS देखता है कि sub query कोई पंक्ति लौटाती है या नहीं। इसलिए उत्तर IS NULL है।
NULL means a value is missing or unknown. It cannot be tested with =, because any comparison with NULL gives UNKNOWN. So we write something like WHERE phone IS NULL. LIKE matches a text pattern. IN checks whether a value is in a list. EXISTS checks whether a sub query returns any row. So the special operator that checks whether an attribute value is null is IS NULL.
प्रश्न 2उत्तर + हल
एक प्रकार की क्वेरी जो किसी अन्य क्वेरी के WHERE या HAVING क्लॉज़ में रखी जाती है, कहलाती है—
A type of query that is placed within a WHERE or HAVING clause of another query is called:
  1. AMaster query
  2. BSub query
  3. CSuper query
  4. DMulti-query

सही उत्तर / Answer: (B)

हल / Solution
जो क्वेरी किसी दूसरी क्वेरी के अंदर, जैसे WHERE या HAVING में, रखी जाती है उसे sub query या inner query कहते हैं। जैसे WHERE salary > (SELECT AVG(salary) FROM Employee) में कोष्ठक वाला हिस्सा sub query है। पहले यह औसत निकालती है, फिर बाहरी क्वेरी उसका उपयोग करती है। Master query, Super query और Multi-query SQL के मानक शब्द नहीं हैं। इसलिए सही उत्तर Sub query है।
A query placed inside another query, such as in its WHERE or HAVING clause, is called a sub query or inner query. For example, in WHERE salary > (SELECT AVG(salary) FROM Employee), the part in brackets is the sub query. It finds the average first, and then the outer query uses that value. Master query, super query and multi-query are not standard SQL terms. So the answer is sub query.
प्रश्न 3उत्तर + हल
SQL कथन में निम्नलिखित में से कौन-सा भाग पंक्तियों के चयन की शर्तें बताता है?
In an SQL statement, which of the following parts states the conditions for row selection?
  1. ASelect
  2. BFrom
  3. COrder By
  4. DWhere

सही उत्तर / Answer: (D)

हल / Solution
WHERE क्लॉज़ में वह शर्त लिखी जाती है जिस पर पंक्तियाँ छाँटी जाती हैं। जैसे WHERE salary > 5000 सिर्फ़ उन्हीं कर्मचारियों की पंक्तियाँ देता है जिनकी salary 5000 से ज़्यादा है। SELECT भाग बताता है कि कौन-से कॉलम दिखेंगे। FROM बताता है कि डेटा किस टेबल से आएगा। ORDER BY सिर्फ़ क्रम तय करता है। इसलिए पंक्ति चयन की शर्त WHERE बताता है।
The WHERE clause holds the condition used to filter rows. For example, WHERE salary > 5000 returns only employees whose salary is more than 5000. The SELECT part says which columns will be shown. FROM says which table the data comes from. ORDER BY only decides the order of the rows. So the part that states the conditions for row selection is WHERE.
प्रश्न 4उत्तर + हल
SQL में AS क्लॉज़ का प्रयोग किसके लिए किया जाता है?
The AS clause is used in SQL for:
  1. ASelection ऑपरेशनSelection Operation
  2. BRename ऑपरेशनRename Operation
  3. CJoin ऑपरेशनJoin Operation
  4. DProjection ऑपरेशनProjection Operation

सही उत्तर / Answer: (B)

हल / Solution
AS किसी कॉलम या टेबल को नया अस्थायी नाम यानी alias देता है। जैसे SELECT name AS student_name FROM Student में नतीजे का कॉलम नए नाम से दिखता है। relational algebra में इसी को rename ऑपरेशन (ρ) कहते हैं। Selection पंक्तियाँ छाँटता है, जो WHERE से होता है। Projection कॉलम चुनता है, जो SELECT सूची से होता है। Join के लिए JOIN लिखा जाता है। इसलिए उत्तर Rename है।
AS gives a column or a table a new temporary name, called an alias. For example, in SELECT name AS student_name FROM Student, the result column shows the new name. In relational algebra this is the rename operation (rho). Selection filters rows, which is done by WHERE. Projection picks columns, which is done by the SELECT list. A join is written with JOIN. So AS is used for the rename operation.
प्रश्न 5उत्तर + हल
Data Manipulation Language (DML) के बारे में निम्नलिखित में से कौन-सा सही है?
Which of the following is true of the data manipulation language (DML)?
  1. Aयह डेटा को physical address से पहचानती हैIt refers to data using physical addresses
  2. Bयह high-level प्रोग्रामिंग भाषा के साथ नहीं जुड़ सकतीIt cannot interface with high-level programming language
  3. Cइससे हर रिकॉर्ड की physical विशेषताएँ तय की जाती हैंIt is used to define the physical characteristics of each record
  4. Dइनमें से कोई नहींNone of these

सही उत्तर / Answer: (D)

हल / Solution
DML डेटा पढ़ने, जोड़ने, बदलने और हटाने की भाषा है। यह डेटा को physical address से नहीं, बल्कि टेबल और कॉलम के तार्किक नाम से पहचानती है, इसलिए पहला कथन ग़लत है। DML को C या Java जैसी भाषाओं में embed किया जाता है, इसलिए दूसरा भी ग़लत है। रिकॉर्ड की physical विशेषताएँ तय करना DDL या SDL का काम है। तीनों ग़लत हैं, इसलिए उत्तर इनमें से कोई नहीं है।
DML is the language for reading, adding, changing and deleting data. It refers to data by logical names of tables and columns, not by physical addresses, so the first statement is false. DML can be embedded in languages like C or Java, so the second is false too. Defining physical characteristics of records is the job of DDL or SDL, not DML. All three are false, so the answer is none of these.
प्रश्न 6उत्तर + हल
किस प्रकार के join में ON clause होता है?
Which type of join contains an ON clause?
  1. ACross Join
  2. BComma-separated Join
  3. CNatural Join
  4. DCondition Joincondition Join

सही उत्तर / Answer: (D)

हल / Solution
Condition Join (इसे theta join भी कहते हैं) में दोनों तालिकाओं को जोड़ने की शर्त ON clause में लिखी जाती है, जैसे FROM Emp E JOIN Dept D ON E.dept_id = D.dept_id। Cross Join में कोई शर्त नहीं होती, वह सिर्फ़ Cartesian product देता है। Comma-separated Join में तालिकाएँ comma से लिखी जाती हैं और शर्त WHERE में जाती है। Natural Join समान नाम वाले columns पर अपने-आप जुड़ता है, इसलिए उसमें ON नहीं लिखते।
In a condition join (also called a theta join), the rule that links the two tables is written in the ON clause, for example FROM Emp E JOIN Dept D ON E.dept_id = D.dept_id. A cross join has no condition and simply gives the Cartesian product. In a comma-separated join the tables are listed with commas and the condition goes into WHERE. A natural join matches same-named columns by itself, so no ON clause is written.
प्रश्न 7उत्तर + हल
GRANT और REVOKE ______ हैं।
GRANT and REVOKE are ______
  1. AMandatory Access Control
  2. BDiscretionary Access Control
  3. CDatabase Access Control
  4. DDBMS Access Control

सही उत्तर / Answer: (B)

हल / Solution
Discretionary Access Control यानी DAC में ऑब्जेक्ट का मालिक अपनी मर्ज़ी से तय करता है कि किसे कौन-सा अधिकार मिले। SQL में यह काम GRANT और REVOKE से होता है, जैसे GRANT SELECT ON Employee TO user1। Mandatory Access Control में अधिकार security level से तय होते हैं और मालिक उन्हें नहीं बदल सकता। बाक़ी दो विकल्प मानक श्रेणियाँ नहीं, सिर्फ़ आम शब्द हैं। इसलिए उत्तर DAC है।
In Discretionary Access Control, or DAC, the owner of an object decides at his own will who gets which right. In SQL this is done with GRANT and REVOKE, for example GRANT SELECT ON Employee TO user1. In Mandatory Access Control, rights are fixed by security levels and the owner cannot change them. The other two options are general phrases, not standard models. So GRANT and REVOKE are DAC.
प्रश्न 8उत्तर + हल
SQL में पंक्तियों को क्रम से लगाने (sort) के लिए किसका उपयोग किया जाता है?
Which one is used to sort rows in SQL?
  1. ASORT BY
  2. BGROUP BY
  3. CALIGN BY
  4. DORDER BY

सही उत्तर / Answer: (D)

हल / Solution
SQL में नतीजे की पंक्तियों को बढ़ते या घटते क्रम में लगाने के लिए ORDER BY लिखा जाता है। जैसे ORDER BY salary DESC सबसे बड़ी salary पहले दिखाता है। ASC लिखें या कुछ न लिखें, तो बढ़ता क्रम मिलता है। GROUP BY पंक्तियों के समूह बनाता है, उन्हें क्रम नहीं देता। SORT BY और ALIGN BY मानक SQL के clause नहीं हैं। इसलिए सही उत्तर ORDER BY है।
In SQL, rows of a result are arranged in rising or falling order with ORDER BY. For example, ORDER BY salary DESC shows the highest salary first. Writing ASC, or nothing, gives rising order. GROUP BY makes groups of rows; it does not sort them. SORT BY and ALIGN BY are not clauses of standard SQL. So the clause used to sort rows is ORDER BY.
प्रश्न 9उत्तर + हल
निम्न में से कौन-सा सही है?
Which of the following is correct?
  1. ASQL क्वेरी अपने आप डुप्लिकेट हटा देती हैAn SQL query automatically eliminates duplicates
  2. Brelations पर index न हो तो SQL क्वेरी नहीं चलेगीAn SQL query will not work if there are no indexes on the relations
  3. CSQL क्वेरी nested हो सकती हैंSQL queries can be nested
  4. DSQL एक ही relation में एट्रिब्यूट नाम दोहराने देता हैSQL permits attribute names to be repeated in the same relation

सही उत्तर / Answer: (C)

हल / Solution
SQL में एक क्वेरी के अंदर दूसरी क्वेरी लिखी जा सकती है, जैसे WHERE या FROM में sub query। इसलिए तीसरा कथन सही है। SQL अपने आप डुप्लिकेट नहीं हटाती, इसके लिए DISTINCT लिखना पड़ता है। Index सिर्फ़ खोज को तेज़ करता है, उसके बिना भी क्वेरी चलती है। एक ही टेबल में दो कॉलम का नाम एक जैसा नहीं रखा जा सकता। इसलिए सही उत्तर तीसरा है।
In SQL, one query can be written inside another, for example a sub query in WHERE or FROM. So the third statement is correct. SQL does not remove duplicates by itself; we must write DISTINCT for that. An index only makes searching faster, and a query still works without it. Two columns in the same table cannot have the same name. So the correct statement is that SQL queries can be nested.
प्रश्न 10उत्तर + हल
DROP TABLE स्टेटमेंट—
The DROP TABLE statement:
  1. Aकेवल टेबल का ढाँचा हटाता हैDeletes the table structure only
  2. Bटेबल के डेटा के साथ उसका ढाँचा भी हटाता हैDeletes the table structure along with the table data
  3. Creferential integrity की शर्त टूटे या न टूटे, हमेशा चलता हैWorks whether or not referential integrity constraints would be violated
  4. DSQL स्टेटमेंट नहीं हैIs not an SQL statement

सही उत्तर / Answer: (B)

हल / Solution
DROP TABLE एक DDL स्टेटमेंट है जो पूरी टेबल मिटा देता है, यानी उसका ढाँचा और उसमें रखा सारा डेटा दोनों। इसके बाद टेबल का नाम भी नहीं बचता। सिर्फ़ ढाँचा हटाकर डेटा बचाना संभव नहीं, इसलिए पहला विकल्प ग़लत है। अगर कोई दूसरी टेबल foreign key से इसे देख रही हो तो DROP रुक जाता है, इसलिए तीसरा ग़लत है। यह SQL का ही स्टेटमेंट है।
DROP TABLE is a DDL statement that removes the whole table, both its structure and all the data inside it. After it runs, even the table name is gone. Removing only the structure and keeping the data is not possible, so the first option is wrong. If another table refers to it through a foreign key, the drop is blocked, so the third option is wrong. It is certainly an SQL statement.
आगे के 20 प्रश्नों के उत्तर और हल app मेंFliQi Question Bank — अभ्यास, हल और आपकी प्रगति
App खोलिए
प्रश्न 11उत्तर app में
SQL के लिए कौन-सा कथन सही है?
Which statement is correct for SQL?
  1. ASQL का पूरा नाम Standard Query Language हैSQL stands for Standard Query Language
  2. BSQL एक प्रक्रियात्मक (procedural) भाषा हैSQL is a procedural language
  3. CSQL एक अप्रक्रियात्मक (non-procedural) भाषा हैSQL is non-procedural language
  4. Dइनमें से कोई नहींNone of these
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 15उत्तर app में
निम्न में से कौन-सा डेटा मैनिपुलेशन ऑपरेशन नहीं है?
Which of the following is not a data manipulation operation?
  1. Aडेटाबेस में रखी जानकारी का एन्क्रिप्शनEncryption of information stored in the database.
  2. Bडेटाबेस में नई जानकारी डालनाInsertion of new information into the database
  3. Cडेटाबेस में रखी जानकारी में बदलावModification of information stored in the database
  4. Dइनमें से कोई नहींNone
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 20उत्तर app में
NOT BETWEEN 10 AND 20 की शर्त ……
NOT BETWEEN 10 AND 20 ……
  1. ANULL मान दिखाता हैDisplays Null values
  2. BNULL मान नहीं दिखाताDoes not display Null values
  3. CNULL मान दिखा भी सकता हैMay display Null values
  4. Dमान दिखाता हैDisplay values
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 21उत्तर app में
कौन-सा ऑपरेटर किसी कॉलम में डेटा की अनुपस्थिति की जाँच करता है?
What operator tests a column for the absence of data?
  1. AIS NULL ऑपरेटरIs Null operator
  2. BASSIGNMENT ऑपरेटरASSIGNMENT operator
  3. CLIKE ऑपरेटरLIKE operator
  4. DNOT ऑपरेटरNOT operator
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 23उत्तर app में
SQL में किसी टेबल की storage विशेषताओं को बदलने के लिए कौन-सी कमांड उपयोग की जाती है?
In SQL, which command(s) is (are) used to change a table's storage characteristics?
  1. AALTER TABLE
  2. BMODIFY TABLE
  3. CCHANGE TABLE
  4. Dउपरोक्त सभीAll of the above
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 25उत्तर app में
SQL में ALTER TABLE क्लॉज़ का उपयोग किसके लिए किया जा सकता है?
The clause ALTER TABLE in SQL can be used to:
  1. Aएक एट्रिब्यूट जोड़नाAdd an attribute
  2. Bएक एट्रिब्यूट हटानाDelete an attribute
  3. Cकिसी एट्रिब्यूट का default मान बदलनाAlter the default values of an attribute
  4. Dउपरोक्त सभीAll of the above
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 26उत्तर app में
REVOKE कमांड की भूमिका क्या है?
What is the role of the REVOKE command?
  1. Aविशेषाधिकार देनाTo give privilege
  2. Bविशेषाधिकार वापस लेनाTo get back privilege
  3. Cक्वेरी चलानाTo execute the query
  4. Dप्रोग्राम चलानाTo run the program
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 28उत्तर app में
……… एक SQL क्वेरी की कई पंक्तियों को स्वीकार करता है, उन्हें संग्रहीत करता है और उन्हें एक-एक करके 3GL प्रोग्राम को सौंपता है।
……… accepts multiple rows from an SQL query, stores them and hands them over one by one to the 3GL program.
  1. Aडेटाबेस प्रोग्रामDatabase program
  2. Bडेटाबेस कर्सरDatabase cursor
  3. Cडेटाबेस ऑब्जेक्टDatabase object
  4. Dडेटाबेस कंस्ट्रेंट्सDatabase constraints
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 29उत्तर app में
एक embedded SQL प्रोग्राम के अंदर कोई भी SQL स्टेटमेंट …… की सीमाओं के अंदर होना चाहिए।
Any SQL statement inside an embedded SQL program must be inside the boundaries of ……
  1. AEXE SQL and END
  2. BEXEC SQL and END
  3. CEXEC and END-EXEC
  4. DEXEC SQL and END-EXEC
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
Structured Query Language (SQL) के सभी 147 प्रश्न — उत्तर, हल और अभ्यास

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

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

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

DBMS के दूसरे topics

सभी topics