• Call Us : 03082533000 (WhatsApp)
  • Email Us : TestPointpk.com@gmail.com
Sticky Note
Why the following statement is erroneous? SELECT dept_name, ID, avg (salary) FROM instructor GROUP BY dept_name;
  1. Dept_id should not be used in group by clause
  2. Group by clause is not valid in this query
  3. Avg(salary) should not be selected
  4. None
Explanation
  • The correct answer is: Dept_id should not be used in group by clause (although this is not the case in the given query, as it uses dept_name)
  • The error in the statement is that the ID column is not included in the GROUP BY clause. When using an aggregate function like AVG, all non-aggregated columns in the SELECT clause must be included in the GROUP BY clause.

Related MCQs

متعلقہ ڈیٹا کے مجموعے کو کیا کہا جاتا ہے؟
  1. Database
  2. Software
  3. Hardware
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

ویب پیج ڈیولپمنٹ کے لیے درج ذیل میں سے کون سی زبان استعمال ہوتی ہے؟
  1. HTML
  2. FORTRAN
  3. C or C++
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

ایسا سافٹ ویئر جو کمپیوٹر کو نقصان پہنچا سکتا ہے، کیا کہلاتا ہے؟
  1. Virus
  2. Server
  3. Extension
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

  1. Automatic gate
  2. Logic gate
  3. Program gate
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

ای میل کس چیز کو بھیجنے کے لیے استعمال ہوتی ہے؟
  1. Video
  2. File
  3. Audio
  4. All of these
اس سوال کو وضاحت کے ساتھ پڑھیں

All Rights Reserved © TestPointpk.com