MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SQL

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
GROUP BY
A
For each distinct Grouped Columns Calculate aggregate function Add row to result
B
Sort on Grouped Columns For each distinct Grouped Columns Calculate aggregate function
C
Sort on Grouped Columns Calculate aggregate function Add row to result
D
Sort on Grouped Columns For each distinct Grouped Columns Calculate aggregate function Add row to result
Explanation: 

Detailed explanation-1: -The Group By statement is used to group together any rows of a column with the same value stored in them, based on a function specified in the statement. Generally, these functions are one of the aggregate functions such as MAX() and SUM(). This statement is used with the SELECT command in SQL.

Detailed explanation-2: -The COUNT() function returns the number of rows in a database table.

Detailed explanation-3: -The GROUP BY statement groups rows that have the same values into summary rows, like “find the number of customers in each country". The GROUP BY statement is often used with aggregate functions ( COUNT(), MAX(), MIN(), SUM(), AVG() ) to group the result-set by one or more columns.

Detailed explanation-4: -The SUM() function returns the total sum of a numeric column.

There is 1 question to complete.