• 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. Ciphertext
  2. Plaintext
  3. Hashed text
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

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

اعلیٰ معیار کا سی اے ڈی سسٹم ڈرائنگ اور گرافکس پرنٹ کرنے کے لیے کس آلے کا استعمال کرتا ہے؟
  1. Digital plotter
  2. Digital picture
  3. Digital pixel
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

کمپیوٹر میں ہیش فنکشن کا بنیادی مقصد کیا ہے؟
  1. Data integrity verification and fast lookup
  2. Playing audio
  3. Increasing screen brightness
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

ایس ایس ڈی میں کس قسم کی میموری استعمال ہوتی ہے؟
  1. Magnetic memory
  2. Flash memory
  3. Optical memory
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

All Rights Reserved © TestPointpk.com