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)
983 students joined Teachoo Black. What are you waiting for?
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)
Made by
Davneet Singh
Davneet Singh is a graduate from Indian Institute of Technology, Kanpur. He has been teaching from the past 12 years. He provides courses for Maths and Science at Teachoo.