SSC IMD SA 2017 – Question 178

Question:

select name
from instructor
where dept_name = ‘Physics’
order by name;
By default, the order by clause lists items in ______ order.

प्रशिक्षक से
नाम चुनें
जहां विभाग का नाम = ‘Physics’
नाम से क्रम;
डिफ़ॉॉल्ट रूप से, आर्डर बाय क्लॉज़ लिस्ट आइटम्स में, ______ आर्डर में करता है।

Options:

  • Descending
  • Any
  • Same
  • Ascending
  • अवरोही
  • कोई
  • समान
  • आरोही

Correct Answer: d)

Explanation:

Detailed Explanation:

The correct answer is d) Ascending (आरोही).

In standard SQL, the ORDER BY clause is used to sort the rows returned by a SELECT query according to one or more specified columns:

  • Default Sort Direction: If neither ASC nor DESC is explicitly specified, the SQL engine sorts the result set in Ascending order (ASC) by default.
  • Sorting Behavior:
    • Numeric values are arranged from lowest to highest ($0, 1, 2, …$).
    • Textual/character data is arranged alphabetically from A to Z.
    • Temporal data (dates/times) is sorted chronologically from earliest to latest.
  • To achieve reverse or descending sorting (largest to smallest, Z to A), the keyword DESC must be explicitly added after the column name (e.g., ORDER BY name DESC;).

विस्तृत व्याख्या:

सही उत्तर d) आरोही (Ascending) है।

एसक्यूएल (SQL) में ORDER BY क्लॉज का उपयोग क्वेरी परिणाम को एक या अधिक कॉलम के आधार पर क्रमबद्ध (Sort) करने के लिए किया जाता है:

  • डिफ़ॉल्ट क्रम (Default Order): यदि कोई क्रम स्पष्ट रूप से नहीं दिया गया हो, तो ORDER BY क्लॉज परिणामों को डिफ़ॉल्ट रूप से आरोही क्रम (Ascending order – ASC) में क्रमबद्ध करता है।
  • क्रमबद्धता का नियम: टेक्स्ट मान वर्णमाला के अनुसार (A से Z) तथा संख्यात्मक मान न्यूनतम से अधिकतम (छोटे से बड़े) क्रम में व्यवस्थित होते हैं।
  • अवरोही क्रम (बड़े से छोटा / Z से A) प्राप्त करने के लिए स्पष्ट रूप से DESC कीवर्ड लिखना पड़ता है।

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top