Tag: databases

Questions Related to databases

Evalute the follwing SQL statements? ALTER TABLE HR.EMP SET UNUSED ( MGR_ID ); which statements is true ?

  1. Any constraints defined on the MGR_ID column would be removed by the above command

  2. Any views created on the EMP table that include the MGR_ID column would have to bve dropped and re-created

  3. Any index created on the MGR_ID column would continue to exists until the DROP UNUSED COLUMNS command is executed.

  4. Any synonym existing on the EMP table would have to be re-created


Correct Option: D
  1. To find the groups forming the subtotal in a row

  2. To create group-wise totals for the groups specified within a GROUPBY clause

  3. To create grouping for expressions or columns specified within a GROUPBY clause in one direction,from right to left for calculating the subtotals.

  4. To create grouping for expressions or columns specified within a GROUPBY clause in all possible direction,which is cross-tabular report for calculating the subtotals


Correct Option: C

Which statement best describes the GROUPING function?

  1. used to set the order for the groups to be used for calculating the grand totals and subtotals

  2. used to form various groups to caculate totals and subtotals created using ROLLUP and CUBE operators

  3. used to specify if the NULLL value in an expresion is a stored NULL value or created by ROLLUP and CUBE

  4. used to specify the concatenated groups expressions to be used for calculating the grand totals and subtotals


Correct Option: C

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) used to set the order for the groups to be used for calculating the grand totals and subtotals - This option is incorrect. The GROUPING function is not used to set the order of groups. It is used to specify if a NULL value in an expression is a stored NULL value or created by the ROLLUP and CUBE operators.

Option B) used to form various groups to calculate totals and subtotals created using ROLLUP and CUBE operators - This option is incorrect. The GROUPING function is not used to form groups. It is used to determine if a NULL value in an expression is a stored NULL value or created by the ROLLUP and CUBE operators.

Option C) used to specify if the NULL value in an expression is a stored NULL value or created by ROLLUP and CUBE - This option is correct. The GROUPING function is used to determine whether a NULL value in an expression is a stored NULL value or created by the ROLLUP and CUBE operators.

Option D) used to specify the concatenated group expressions to be used for calculating the grand totals and subtotals - This option is incorrect. The GROUPING function is not used to specify concatenated group expressions. It is used to determine if a NULL value in an expression is a stored NULL value or created by the ROLLUP and CUBE operators.

The correct answer is Option C. This option is correct because the GROUPING function is used to specify if a NULL value in an expression is a stored NULL value or created by the ROLLUP and CUBE operators.

  1. used to find the groups forming the subtotal in a row

  2. used to identify the NULL value in the aggregate function.

  3. use to form the group sets involved in generating the totals and subtotals

  4. only be used with ROLLUP and CUBE operators specified in the GROUP BY clause


Correct Option: A,D
  1. specify large pct free

  2. specify large pct used

  3. specify large initial & next sizes

  4. specify small initrans


Correct Option: A