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

Multiple Row Functions — प्रश्न और उत्तर

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

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

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

भाषा
प्रश्न 1उत्तर + हल
इस query में
SELECT dept_id, COUNT(*) FROM employee GROUP BY dept_id ORDER BY ______;
ख़ाली जगह पर निम्नलिखित में से क्या नहीं रखा जा सकता?
In the query
SELECT dept_id, COUNT(*) FROM employee GROUP BY dept_id ORDER BY ______;
which of the following CANNOT be placed in the blank?
  1. Adept_id
  2. BCOUNT(*)
  3. Cename
  4. DSUM(salary)

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

हल / Solution
ORDER BY समूह बनने के बाद चलता है, इसलिए उस समय केवल दो चीज़ें उपलब्ध रहती हैं — GROUP BY वाले column और समूह-फलन के मान। dept_id समूह बनाने वाला column है, तथा गिनती और योग दोनों समूह-फलन हैं, सो ये तीनों चल जाते हैं। ename न समूह बनाने वाला column है और न किसी फलन के भीतर, इसलिए एक समूह में उसके अनेक मान पड़ सकते हैं और क्रम लगाना असंभव हो जाता है — यहीं त्रुटि मिलती है।
ORDER BY runs after grouping, so only two kinds of thing are available at that moment, the GROUP BY columns and the values of group functions. Here dept_id is the grouping column, while the count and the total are both group functions, so all three work. The column ename is neither grouped nor wrapped in a function, so one group may hold many of its values and no ordering is possible, which is where the error arises.
प्रश्न 2उत्तर + हल
employee तालिका में नौ पंक्तियाँ हैं जिनके dept_id मान A, B, A, C, B, A, C, C और C हैं। इस query के परिणाम में कौन-सी पंक्ति सबसे पहले आएगी?
SELECT dept_id, COUNT(*) FROM employee GROUP BY dept_id ORDER BY COUNT(*) DESC;
The employee table holds nine rows whose dept_id values are A, B, A, C, B, A, C, C and C. Which row will appear first in the output of this query?
SELECT dept_id, COUNT(*) FROM employee GROUP BY dept_id ORDER BY COUNT(*) DESC;
  1. AA, गिनती 3 के साथA with the count 3
  2. BB, गिनती 2 के साथB with the count 2
  3. CC, गिनती 4 के साथC with the count 4
  4. Dत्रुटि, क्योंकि ORDER BY में समूह-फलन नहीं रखा जा सकताAn error, because a group function cannot be placed in ORDER BY

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

हल / Solution
पहले समूह बनते हैं और गिनती निकलती है: A की तीन पंक्तियाँ, B की दो और C की चार। ORDER BY समूह बनने के बाद चलता है, इसलिए उसमें गिनती वाले समूह-फलन का प्रयोग पूरी तरह मान्य है। DESC से बड़ी गिनती ऊपर आती है, अतः चार गिनती वाला C सबसे पहले दिखेगा, उसके बाद A और अंत में B। इसे त्रुटि मानना ग़लत है, क्योंकि ORDER BY में समूह-फलन रखने पर कोई रोक नहीं है।
Groups are formed first and the counts come out as three rows for A, two for B and four for C. ORDER BY runs after grouping, so using a counting group function there is entirely valid. DESC lifts the larger count to the top, so C with its count of four appears first, followed by A and then B. Calling it an error is wrong, since ORDER BY places no bar on a group function.
प्रश्न 3उत्तर + हल
निम्नलिखित कथन चलाने पर क्या होता है?
SELECT MAX(AVG(salary)) FROM employee;
What happens when the following statement is executed?
SELECT MAX(AVG(salary)) FROM employee;
  1. Aयह तालिका का सबसे बड़ा वेतन लौटाता हैIt returns the largest salary of the table
  2. Bयह तालिका का औसत वेतन लौटाता हैIt returns the average salary of the table
  3. Cयह त्रुटि देता है, क्योंकि nested समूह-फलन के लिए GROUP BY clause आवश्यक हैIt raises an error, because a nested group function needs a GROUP BY clause
  4. Dयह NULL लौटाता हैIt returns NULL

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

हल / Solution
भीतरी AVG बिना GROUP BY के पूरी तालिका का एक ही औसत देता है, और एक अकेले मान पर बाहरी MAX लगाने का कोई अर्थ नहीं बचता — इसीलिए दो समूह-फलन एक में रखते समय GROUP BY अनिवार्य है, जो समूहों की एक पूरी सूची बनाकर बाहरी फलन को देती है। GROUP BY के अभाव में कथन चलता ही नहीं, इसलिए यह न सर्वोच्च वेतन देता है, न औसत और न NULL।
Without GROUP BY the inner AVG yields just one average for the whole table, and applying the outer MAX to a single value carries no meaning, which is why GROUP BY is required whenever two group functions are nested; it builds a whole list of groups for the outer function to work on. Lacking GROUP BY the statement does not run at all, so it returns neither the highest salary nor the average nor NULL.
प्रश्न 4उत्तर + हल
निम्नलिखित query क्या लौटाएगी?
SELECT MAX(AVG(salary)) FROM employee GROUP BY dept_id;
What will the following query return?
SELECT MAX(AVG(salary)) FROM employee GROUP BY dept_id;
  1. Aप्रत्येक विभाग का औसत वेतन, हर विभाग के लिए एक पंक्तिThe average salary of every department, one row for each department
  2. Bविभाग-वार औसत वेतनों में से सबसे बड़ा, एक ही पंक्ति मेंThe largest among the department wise average salaries, in a single row
  3. Cपूरी तालिका का सबसे बड़ा वेतन, एक ही पंक्ति मेंThe largest salary of the whole table, in a single row
  4. Dत्रुटि, क्योंकि दो समूह-फलन कभी nested नहीं हो सकतेAn error, because two group functions can never be nested

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

हल / Solution
भीतरी AVG पहले चलता है और GROUP BY के कारण प्रत्येक विभाग का एक औसत बनाता है। बाहरी MAX उन्हीं औसतों पर लगकर उनमें से सबसे बड़ा चुनता है, इसलिए परिणाम एक ही पंक्ति का होता है। विभाग-वार सभी औसत पाने के लिए केवल AVG लिखना होता, बाहरी MAX नहीं। किसी एक कर्मचारी का सर्वोच्च वेतन इससे नहीं मिलता, क्योंकि तुलना औसतों के बीच है, और समूह-फलन का यह दो-स्तरीय nesting वर्जित नहीं है।
The inner AVG runs first and, because of GROUP BY, produces one average for each department. The outer MAX then works on those averages and picks the largest of them, so the result is a single row. To see every department average you would write AVG alone, without the outer MAX. The highest salary of one employee does not come out of this, since the comparison is among averages, and such two level nesting is not forbidden.
प्रश्न 5उत्तर + हल
employee तालिका में पाँच पंक्तियाँ हैं और उनमें से प्रत्येक का salary ठीक 25000 है। यह query क्या लौटाएगी?
SELECT VARIANCE(salary), STDDEV(salary) FROM employee;
In the employee table there are five rows and the salary of every one of them is exactly 25000. What will this query return?
SELECT VARIANCE(salary), STDDEV(salary) FROM employee;
  1. A25000 और 2500025000 and 25000
  2. B0 और 10 and 1
  3. C0 और 00 and 0
  4. DNULL और NULLNULL and NULL

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

हल / Solution
प्रसरण मानों के औसत से हटाव नापता है। यहाँ सभी मान बराबर हैं, इसलिए औसत भी 25000 है और हर पंक्ति का हटाव शून्य; शून्यों के वर्गों का जोड़ भी शून्य रहता है, सो प्रसरण शून्य है। मानक विचलन उसका वर्गमूल है, अतः वह भी शून्य। 25000 मान है, बिखराव नहीं। NULL तब मिलता जब एक भी मान न होता, पर यहाँ पाँच मान मौजूद हैं।
Variance measures how far the values stray from their mean. Here every value is the same, so the mean is also 25000 and each row deviates by zero; a sum of squared zeros is still zero, so the variance is zero. Standard deviation is its square root and is therefore zero too. The figure 25000 is a value, not a spread, and NULL would arise only with no value present.
प्रश्न 6उत्तर + हल
कौन-सा समूह फलन किसी संख्यात्मक column के प्रसरण (variance) का वर्गमूल लौटाता है?
Which group function returns the square root of the variance of a numeric column?
  1. AAVG()
  2. BSUM()
  3. CCOUNT()
  4. DSTDDEV()

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

हल / Solution
मानक विचलन (standard deviation) की परिभाषा ही प्रसरण का वर्गमूल है, और SQL में उसे निकालने वाला समूह फलन STDDEV है; प्रसरण स्वयं VARIANCE देता है। दोनों बिखराव नापते हैं, इसलिए साथ-साथ पढ़ाए जाते हैं। AVG केवल औसत देता है, SUM जोड़ देता है और COUNT पंक्तियाँ गिनता है — इनमें से कोई बिखराव नहीं नापता, इसलिए वे इस प्रश्न का उत्तर नहीं हो सकते।
Standard deviation is by definition the square root of the variance, and the group function that returns it in SQL is STDDEV, while the variance itself comes from VARIANCE. Both measure spread, which is why they are taught together. AVG gives only the mean, SUM gives a total and COUNT counts rows; none of them measures spread, so none can answer this question.
प्रश्न 7उत्तर + हल
employee तालिका में चार पंक्तियाँ हैं जिनके ename मान Ramesh, Anita, Suresh और Mohan हैं। यह query क्या लौटाएगी?
SELECT MIN(ename) FROM employee;
The employee table holds four rows whose ename values are Ramesh, Anita, Suresh and Mohan. What will this query return?
SELECT MIN(ename) FROM employee;
  1. AAnita
  2. BMohan
  3. CSuresh
  4. Dत्रुटि, क्योंकि MIN() केवल संख्यात्मक column पर चलता हैAn error, because MIN() runs only on numeric columns

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

हल / Solution
MIN और MAX संख्याओं के साथ-साथ अक्षर और दिनांक वाले column पर भी चलते हैं; अक्षरों में तुलना वर्णक्रम से होती है। दिए गए नामों का वर्णक्रम Anita, Mohan, Ramesh, Suresh है, इसलिए सबसे छोटा मान Anita है। Suresh वर्णक्रम में अंतिम है, सो वह MAX का उत्तर होता। MIN को केवल संख्या तक सीमित मानना भी ग़लत है, क्योंकि अक्षर वाले column पर उसे लगाने से कोई त्रुटि नहीं आती।
MIN and MAX work on character and date columns just as they do on numbers; for characters the comparison follows alphabetical order. The given names in that order read Anita, Mohan, Ramesh, Suresh, so the smallest value is Anita. Suresh stands last alphabetically, so it would be the answer for MAX instead. Calling it an error is wrong, since applying MIN to a character column raises none.
प्रश्न 8उत्तर + हल
payment तालिका में पाँच पंक्तियाँ हैं जिनके amount मान 100, 200, 100, 300 और 200 हैं। यह query क्या लौटाएगी?
SELECT SUM(amount), SUM(DISTINCT amount) FROM payment;
The payment table holds five rows whose amount values are 100, 200, 100, 300 and 200. What will this query return?
SELECT SUM(amount), SUM(DISTINCT amount) FROM payment;
  1. A900 और 900900 and 900
  2. B600 और 600600 and 600
  3. C600 और 900600 and 900
  4. D900 और 600900 and 600

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

हल / Solution
सादा SUM हर पंक्ति का मान जोड़ता है: 100+200+100+300+200 = 900। DISTINCT लगाने पर दोहराए गए मान एक-एक बार लिए जाते हैं, अतः जोड़ 100+200+300 = 600 रह जाता है। इसलिए क्रम से उत्तर 900 और 600 है। दोनों बराबर तभी होते जब किसी मान का दोहराव ही न होता, और 600 को पहले रखना दोनों रूपों को उलट देना है, जो यहाँ ग़लत है।
A plain SUM adds the value of every row: 100+200+100+300+200 = 900. With DISTINCT the repeated values are taken only once, so the total shrinks to 100+200+300 = 600. Hence the answer in order is 900 and 600. The two would be equal only if no value repeated, and putting 600 first simply swaps the two forms, which is wrong here.
प्रश्न 9उत्तर + हल
visit तालिका में सात पंक्तियाँ हैं जिनके city मान Jaipur, Kota, Jaipur, Ajmer, Udaipur, Kota और Jaipur हैं। यह query क्या लौटाएगी?
SELECT COUNT(DISTINCT city) FROM visit;
The visit table holds seven rows whose city values are Jaipur, Kota, Jaipur, Ajmer, Udaipur, Kota and Jaipur. What will this query return?
SELECT COUNT(DISTINCT city) FROM visit;
  1. A4
  2. B7
  3. C3
  4. D5

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

हल / Solution
DISTINCT लगाने पर गिनती से दोहराव हट जाता है, इसलिए हर नाम एक ही बार गिना जाता है। यहाँ भिन्न नाम चार हैं — Jaipur, Kota, Ajmer और Udaipur — अतः उत्तर चार है। सात कुल पंक्तियों की संख्या है, जो DISTINCT हटाने पर मिलती। तीन और पाँच किसी गणना से नहीं बनते; तीन तब आता जब एक शहर छोड़ दिया जाता। ध्यान रहे, DISTINCT दोहराव हटाता है, NULL की छनाई अलग नियम से होती है।
DISTINCT strips repetitions out of the count, so each name is counted just once. Here the distinct names number four, Jaipur, Kota, Ajmer and Udaipur, so the answer is four. Seven is the total row count, which is what you would get without DISTINCT. Neither three nor five follows from any correct counting. Note that DISTINCT removes duplicates, while the handling of NULL is governed by a separate rule.
प्रश्न 10उत्तर + हल
तालिका के किसी भी कर्मचारी का dept_id 99 नहीं है। निम्नलिखित query क्या लौटाएगी?
SELECT COUNT(*), SUM(salary) FROM employee WHERE dept_id = 99;
No employee of the table has dept_id equal to 99. What will the following query return?
SELECT COUNT(*), SUM(salary) FROM employee WHERE dept_id = 99;
  1. A0 और 00 and 0
  2. B0 और NULL0 and NULL
  3. CNULL और NULLNULL and NULL
  4. Dकोई पंक्ति नहीं, और त्रुटि मिलती हैNo row at all, and an error is raised

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

हल / Solution
WHERE के बाद एक भी पंक्ति न बचे, तब भी समूह-फलन वाली query एक पंक्ति देती है। COUNT इस दशा में शून्य लौटाता है, क्योंकि गिनती शून्य होना एक वैध संख्या है। पर SUM के पास जोड़ने को कुछ नहीं होता, इसलिए वह शून्य नहीं बल्कि NULL देता है — यही वह जाल है जहाँ छात्र शून्य मान बैठते हैं। त्रुटि कहीं नहीं आती, क्योंकि कथन की रचना पूरी तरह शुद्ध है।
Even when no row survives the WHERE condition, a query made of group functions still returns one row. COUNT gives zero here, since a count of zero is a perfectly valid number. SUM, however, has nothing to add up, so it yields NULL rather than zero, and that is the trap where learners assume a zero. No error arises, because the statement itself is perfectly well formed.
आगे के 15 प्रश्नों के उत्तर और हल app मेंFliQi Question Bank — अभ्यास, हल और आपकी प्रगति
App खोलिए
प्रश्न 11उत्तर app में
employee तालिका में पाँच पंक्तियाँ हैं जिनके salary मान 2000, 4000, NULL, 6000 और NULL हैं। यह query क्या लौटाएगी?
SELECT SUM(salary)/COUNT(*), AVG(salary) FROM employee;
The employee table holds five rows whose salary values are 2000, 4000, NULL, 6000 and NULL. What will this query return?
SELECT SUM(salary)/COUNT(*), AVG(salary) FROM employee;
  1. A2400 और 40002400 and 4000
  2. B4000 और 40004000 and 4000
  3. C2400 और 24002400 and 2400
  4. D12000 और 400012000 and 4000
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 13उत्तर app में
student तालिका इस प्रकार है:
roll | phone
1 | 9001
2 | NULL
3 | 9003
4 | NULL
5 | 9005
यह query क्या लौटाएगी?
SELECT COUNT(*), COUNT(phone) FROM student;
The student table holds:
roll | phone
1 | 9001
2 | NULL
3 | 9003
4 | NULL
5 | 9005
What will this query return?
SELECT COUNT(*), COUNT(phone) FROM student;
  1. A3 और 33 and 3
  2. B5 और 55 and 5
  3. C3 और 53 and 5
  4. D5 और 35 and 3
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 14उत्तर app में
निम्नलिखित query के बारे में क्या सत्य है?
SELECT SUM(salary) FROM employee GROUP BY dept_id;
What is true about the following query?
SELECT SUM(salary) FROM employee GROUP BY dept_id;
  1. Aयह त्रुटि देती है, क्योंकि dept_id SELECT सूची में नहीं हैIt raises an error, because dept_id is missing from the SELECT list
  2. Bयह सफलतापूर्वक चलती है और प्रत्येक विभाग का एक योग देती है, पर परिणाम से यह पता नहीं चलता कि कौन-सा योग किस विभाग का हैIt runs successfully and gives one sum per department, but the output does not show which department each sum belongs to
  3. Cयह पूरी तालिका के वेतन का कुल योग एक ही पंक्ति में लौटाती हैIt returns the salary total of the whole table in a single row
  4. Dयह त्रुटि देती है, क्योंकि SUM() को GROUP BY के साथ प्रयोग नहीं किया जा सकताIt raises an error, because SUM() cannot be used along with GROUP BY
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 15उत्तर app में
order_item तालिका इस प्रकार है:
city | product
Jaipur | Pen
Jaipur | Book
Kota | Pen
Jaipur | Pen
Kota | Book
Kota | Pen
यह query कितनी पंक्तियाँ लौटाएगी?
SELECT city, product, COUNT(*) FROM order_item GROUP BY city, product;
The order_item table holds:
city | product
Jaipur | Pen
Jaipur | Book
Kota | Pen
Jaipur | Pen
Kota | Book
Kota | Pen
How many rows will this query return?
SELECT city, product, COUNT(*) FROM order_item GROUP BY city, product;
  1. A2
  2. B3
  3. C4
  4. D6
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 16उत्तर app में
sale तालिका इस प्रकार है:
city | amount
Jaipur | 500
Kota | 300
Jaipur | 700
Ajmer | 200
Kota | 400
Jaipur | 100
यह query कितनी पंक्तियाँ लौटाएगी?
SELECT city, SUM(amount) FROM sale GROUP BY city;
The sale table holds:
city | amount
Jaipur | 500
Kota | 300
Jaipur | 700
Ajmer | 200
Kota | 400
Jaipur | 100
How many rows will this query return?
SELECT city, SUM(amount) FROM sale GROUP BY city;
  1. A1
  2. B2
  3. C3
  4. D6
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 17उत्तर app में
यह query
SELECT dept_id, job_id, SUM(salary) FROM employee GROUP BY dept_id;
अमान्य है। कौन-सा सुधार इसे चला देगा?
The query
SELECT dept_id, job_id, SUM(salary) FROM employee GROUP BY dept_id;
is invalid. Which correction will make it work?
  1. ASUM() के स्थान पर AVG() रखना चाहिएSUM() should be replaced by AVG()
  2. BGROUP BY के स्थान पर HAVING रखना चाहिएGROUP BY should be replaced by HAVING
  3. Cdept_id को GROUP BY clause से हटा देना चाहिएdept_id should be removed from the GROUP BY clause
  4. Djob_id को भी GROUP BY clause में जोड़ना होगाjob_id must also be added to the GROUP BY clause
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 18उत्तर app में
यह कथन
SELECT dept_id, COUNT(*) FROM employee;
त्रुटि देता है। इसका कारण क्या है?
The statement
SELECT dept_id, COUNT(*) FROM employee;
raises an error. What is the reason?
  1. ACOUNT() के कोष्ठक में column का नाम देना सदैव आवश्यक हैCOUNT() always needs a column name inside its brackets
  2. Bdept_id एक अकेला column है जो समूह-फलन के साथ रखा गया है, अतः उसे GROUP BY clause में आना ही चाहिएdept_id is a lone column placed beside a group function, so it must appear in a GROUP BY clause
  3. CCOUNT(*) को SELECT सूची में रखने की अनुमति ही नहीं हैCOUNT(*) is not allowed in the SELECT list at all
  4. Dएक SELECT सूची में दो expressions एक साथ नहीं चुने जा सकतेTwo expressions cannot be selected together in one SELECT list
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 19उत्तर app में
निम्नलिखित में से कौन-सा क्रम SELECT कथन में clauses के लिखे जाने का सही क्रम दर्शाता है?
Which of the following shows the correct order in which the clauses are WRITTEN in a SELECT statement?
  1. ASELECT ... FROM ... WHERE ... GROUP BY ... HAVING ... ORDER BY
  2. BSELECT ... FROM ... GROUP BY ... WHERE ... HAVING ... ORDER BY
  3. CSELECT ... FROM ... WHERE ... HAVING ... GROUP BY ... ORDER BY
  4. DSELECT ... FROM ... WHERE ... GROUP BY ... ORDER BY ... HAVING
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 21उत्तर app में
marks तालिका इस प्रकार है:
student | subject | marks
Ravi | Maths | 80
Ravi | Science | 40
Sita | Maths | 90
Sita | Science | 70
Query P: SELECT student, AVG(marks) FROM marks WHERE marks >= 70 GROUP BY student;
Query Q: SELECT student, AVG(marks) FROM marks GROUP BY student HAVING AVG(marks) >= 70;
कौन-सा कथन सही है?
The marks table holds:
student | subject | marks
Ravi | Maths | 80
Ravi | Science | 40
Sita | Maths | 90
Sita | Science | 70
Query P: SELECT student, AVG(marks) FROM marks WHERE marks >= 70 GROUP BY student;
Query Q: SELECT student, AVG(marks) FROM marks GROUP BY student HAVING AVG(marks) >= 70;
Which statement is correct?
  1. Aदोनों queries ठीक वही दो पंक्तियाँ लौटाती हैंBoth queries return exactly the same two rows
  2. BP एक पंक्ति लौटाती है और Q दो पंक्तियाँP returns one row and Q returns two rows
  3. Cदोनों queries असफल होती हैं, क्योंकि HAVING में AVG() नहीं रखा जा सकताBoth queries fail, because AVG() cannot be placed in HAVING
  4. DP दो पंक्तियाँ लौटाती है जबकि Q केवल एक पंक्ति, जो Sita की हैP returns two rows while Q returns only one row, that of Sita
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 22उत्तर app में
निम्नलिखित कथन के बारे में क्या सत्य है?
SELECT MAX(salary) FROM employee HAVING MAX(salary) > 50000;
What is true about the following statement?
SELECT MAX(salary) FROM employee HAVING MAX(salary) > 50000;
  1. Aयह मान्य है; GROUP BY के अभाव में पूरी तालिका को एक ही समूह माना जाता हैIt is valid; in the absence of GROUP BY the whole table is treated as a single group
  2. Bयह अमान्य है, क्योंकि HAVING कभी भी GROUP BY के बिना नहीं लिखा जा सकताIt is invalid, because HAVING can never be written without GROUP BY
  3. Cयह अमान्य है, क्योंकि HAVING के भीतर MAX() की अनुमति नहीं हैIt is invalid, because MAX() is not allowed inside HAVING
  4. Dयह केवल तब मान्य है जब salary तालिका की प्राथमिक कुंजी (Primary Key) होIt is valid only when salary is the primary key of the table
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 23उत्तर app में
किसी SELECT कथन में कौन-सा clause पंक्तियों को समूहों में बाँटे जाने से पहले ही अनचाही पंक्तियाँ हटा देता है?
In a SELECT statement, which clause discards unwanted rows before the remaining rows are collected into groups?
  1. AHAVING
  2. BGROUP BY
  3. CORDER BY
  4. DWHERE
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 24उत्तर app में
employee तालिका में निम्नलिखित पंक्तियाँ हैं:
dept | salary
A | 3000
A | 9000
B | 4000
B | 2000
C | 8000
निम्न query कितनी पंक्तियाँ लौटाएगी?
SELECT dept, COUNT(*) FROM employee WHERE salary >= 3000 GROUP BY dept;
The employee table holds the following rows:
dept | salary
A | 3000
A | 9000
B | 4000
B | 2000
C | 8000
How many rows will the following query return?
SELECT dept, COUNT(*) FROM employee WHERE salary >= 3000 GROUP BY dept;
  1. A5
  2. B4
  3. C3
  4. D2
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 25उत्तर app में
निम्नलिखित कथन पर विचार कीजिए:
SELECT dept_id, AVG(salary) FROM employee WHERE AVG(salary) > 20000 GROUP BY dept_id;
यह कथन क्यों असफल होगा?
Consider the following statement:
SELECT dept_id, AVG(salary) FROM employee WHERE AVG(salary) > 20000 GROUP BY dept_id;
Why will this statement fail?
  1. Adept_id के साथ SELECT सूची में AVG() नहीं लिखा जा सकताAVG() cannot be written in the SELECT list along with dept_id
  2. BWHERE में group function नहीं आ सकता; ऐसी शर्त HAVING में लिखी जाती हैA group function cannot be used in the WHERE clause; such a condition belongs to HAVING
  3. CGROUP BY हमेशा WHERE से पहले लिखा जाना चाहिएGROUP BY must always be written before WHERE
  4. DAVG() केवल integer प्रकार के column पर ही चलता हैAVG() works only on columns of integer type
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
Multiple Row Functions के सभी 25 प्रश्न — उत्तर, हल और अभ्यास

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

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

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

DBMS के दूसरे topics

सभी topics