MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SQL

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which SQL keyword is used to retrieve a maximum value?
A
MOST
B
TOP
C
MAX
D
UPPER
Explanation: 

Detailed explanation-1: -To retrieve the maximum value, you can make use of a MAX() SQL keyword. The SQL MAX() function is used to find the largest value of a certain column or an expression in a table.

Detailed explanation-2: -To find the max value of a column, use the MAX() aggregate function; it takes as its argument the name of the column for which you want to find the maximum value. If you have not specified any other columns in the SELECT clause, the maximum will be calculated for all records in the table.

Detailed explanation-3: -The MIN() function returns the smallest value of the selected column. The MAX() function returns the largest value of the selected column.

Detailed explanation-4: -Example-With Single Expression SELECT MAX(salary) AS “Highest salary” FROM employees; In this SQL MAX function example, we’ve aliased the MAX(salary) field as “Highest salary". As a result, “Highest salary” will display as the field name when the result set is returned.

Detailed explanation-5: -The SQL MIN function is an aggregate function that is used to find the minimum values in columns or rows in a table.

There is 1 question to complete.