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.
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 has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science and Computer Science at Teachoo
Hi, it looks like you're using AdBlock :(
Displaying ads are our only source of revenue. To help Teachoo create more content, and view the ad-free version of Teachooo... please purchase Teachoo Black subscription.
Please login to view more pages. It's free :)
Teachoo gives you a better experience when you're logged in. Please login :)
Solve all your doubts with Teachoo Black!
Teachoo answers all your questions if you are a Black user!