Check sibling questions

Consider the following statement: SELECT emp_no, name FROM employee _________desig Which of the following option will be used to display the employee number and names of similar designations together?

(A) FIELD()

(B) GROUP BY

(C) ORDER BY

(D) Both (b) and (c)

 

Answer:

Checking the options

  • (A) FIELD() - It is not an aggregate function is SQL
  • (B) GROUP BY - It is used to arrange identical data into groups
  • (C) ORDER BY - It is used to sort the data in ascending or descending order, based on one or more columns
  • (D) Both (b) and (c) 

So, to display the employee number and names of similar designations together we have to use the GROUP BY clause.

So, the correct answer is (B)


Transcript

Consider the following statement: SELECT emp_no, name FROM employee _________desig Which of the following option will be used to display the employee number and names of similar designations together? (A) FIELD() (B) GROUP BY (C) ORDER BY (D) Both (b) and (c) Answer: Checking the options (A) FIELD() - It is not an aggregate function is SQL (B) GROUP BY - It is used to arrange identical data into groups (C) ORDER BY - It is used to sort the data in ascending or descending order, based on one or more columns (D) Both (b) and (c) So, to display the employee number and names of similar designations together we have to use the GROUP BY clause. So, the correct answer is (B)

Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 12 years. He provides courses for Maths, Science, Social Science, Physics, Chemistry, Computer Science at Teachoo.