Computer AwarenessHardIBPS SO IT Officer
In which order does a database logically process the clauses of a SELECT statement?
- A. SELECT → FROM → WHERE → GROUP BY → HAVING → ORDER BY
- B. FROM → GROUP BY → WHERE → HAVING → SELECT → ORDER BY
- C. FROM → WHERE → GROUP BY → HAVING → SELECT → ORDER BY
- D. FROM → WHERE → HAVING → GROUP BY → ORDER BY → SELECT
Correct answer: C. FROM → WHERE → GROUP BY → HAVING → SELECT → ORDER BY
Rows are taken FROM the tables, filtered by WHERE, grouped, filtered as groups by HAVING, then the SELECT list is computed and finally sorted. That is why WHERE cannot use aggregates but HAVING can.
हिंदी में
डेटाबेस SELECT कथन के क्लॉज़ों को तार्किक रूप से किस क्रम में संसाधित करता है?
- A. SELECT → FROM → WHERE → GROUP BY → HAVING → ORDER BY
- B. FROM → GROUP BY → WHERE → HAVING → SELECT → ORDER BY
- C. FROM → WHERE → GROUP BY → HAVING → SELECT → ORDER BY
- D. FROM → WHERE → HAVING → GROUP BY → ORDER BY → SELECT
उत्तर: C. पंक्तियाँ तालिकाओं से FROM द्वारा ली जाती हैं, WHERE से फ़िल्टर होती हैं, समूहित होती हैं, HAVING से समूहों के रूप में फ़िल्टर होती हैं, फिर SELECT सूची की गणना होती है और अंत में क्रमबद्ध की जाती हैं। इसीलिए WHERE समुच्चय का प्रयोग नहीं कर सकता पर HAVING कर सकता है।
More Computer Awareness questions
- The condition WHERE Salary BETWEEN 20000 AND 30000 selects rows whose salary is:
- A query must list the customers who have no phone number recorded (the Phone column is NULL). Which condition works?
- A City column holds Delhi, Pune, Delhi, NULL, Pune, NULL in six rows. What does SELECT COUNT(DISTINCT City) return?
- A transaction runs: INSERT row 1; SAVEPOINT s1; INSERT row 2; ROLLBACK TO s1; COMMIT. Which of the inserted rows are in the table…
- A transfer debits Account A, but the system crashes before Account B is credited. On restart, the debit is undone, so it is as if the…
- Two transactions run at the same time on the same accounts, yet the final result is the same as if one had run fully before the other…