SELECT flavor, SUM (ice_cream_sales) FROM sales_detail
GROUP BY flavor ORDER BY 2 DESC

If the "sales_detail" table contains ten records with
different values in the flavor column (two "vanilla,"
three "chocolate," four "strawberry," and one NULL), how
many rows are returned by the sample code above?

1. 0 rows
2. 1 row
3. 3 rows
4. 4 rows
5. 10 rows

Answers were Sorted based on User's Feedback



SELECT flavor, SUM (ice_cream_sales) FROM sales_detail GROUP BY flavor ORDER BY 2 DESC If the &..

Answer / tulsi

four rows will be returned displaying null as the last row

Is This Answer Correct ?    13 Yes 1 No

SELECT flavor, SUM (ice_cream_sales) FROM sales_detail GROUP BY flavor ORDER BY 2 DESC If the &..

Answer / sdp

4 rows

Is This Answer Correct ?    5 Yes 2 No

SELECT flavor, SUM (ice_cream_sales) FROM sales_detail GROUP BY flavor ORDER BY 2 DESC If the &..

Answer / gvmahesh

4 rows

1.vanilla
2.chocolate
3.strawberry
4.null

Is This Answer Correct ?    4 Yes 1 No

SELECT flavor, SUM (ice_cream_sales) FROM sales_detail GROUP BY flavor ORDER BY 2 DESC If the &..

Answer / kapil

It would return 4 rows

because there is also a sum of ice_cream_sales for null also

so it would return 4 rows including null with order
dependimg on the value of sum function returned .

Is This Answer Correct ?    3 Yes 1 No

SELECT flavor, SUM (ice_cream_sales) FROM sales_detail GROUP BY flavor ORDER BY 2 DESC If the &..

Answer / sree

3 rows

Is This Answer Correct ?    1 Yes 2 No

SELECT flavor, SUM (ice_cream_sales) FROM sales_detail GROUP BY flavor ORDER BY 2 DESC If the &..

Answer / roopa

3rows'

Is This Answer Correct ?    2 Yes 5 No

SELECT flavor, SUM (ice_cream_sales) FROM sales_detail GROUP BY flavor ORDER BY 2 DESC If the &..

Answer / shilpa.oracle

3 Rows.
Because group functions ignore NULL values.

flavour sum(ice_cream_sales)
vanilla 10
chocolate 27
strawberry 8

Is This Answer Correct ?    2 Yes 5 No

SELECT flavor, SUM (ice_cream_sales) FROM sales_detail GROUP BY flavor ORDER BY 2 DESC If the &..

Answer / guest

10 rows

Is This Answer Correct ?    1 Yes 9 No

Post New Answer

More SQL PLSQL Interview Questions

Let us suppose we have a table with structure in order empno empname empdesig empcountry and now i want to re-organize the columns of this table to empno empdesig empname empcountry how can i do this with queries ? assume that table contains the data.

3 Answers  


Give the order of sql select?

0 Answers  


what will be the output: select 1 from emp union all select 2 from emp;

2 Answers   iNautix,


How would you go about increasing the buffer cache hit ratio? 0. Explain the difference between a hot backup and a cold backup and the benefits associated with each 1. You have just had to restore from backup and do not have any control files. How would you go about bringing up this database? 2. How do you switch from an init.ora file to a spfile? 3. Explain the difference between a data block, an extent and a segment. 4. Give two examples of how you might determine the structure of the table DEPT. 5. Where would you look for errors from the database engine? 6. Compare and contrast TRUNCATE and DELETE for a table. 7. Give the reasoning behind using an index. 8. Give the two types of tables involved in producing a star schema and the type of data they hold. 9. What type of index should you use on a fact table? 10. Give two examples of referential integrity constraints. 11. A table is classified as a parent table and you want to drop and re-create it. How would you do this without affecting the children tables? 12. Explain the difference between ARCHIVELOG mode and NOARCHIVELOG mode and the benefits and disadvantages to each. 13. What command would you use to create a backup control file? 14. Give the stages of instance startup to a usable state where normal users may access it. 15. What column differentiates the V$ views to the GV$ views and how? 16. How would you go about generating an EXPLAIN plan?

2 Answers  


What is an ndf file?

0 Answers  






Is a foreign key always unique?

0 Answers  


How do you rank data in sql?

0 Answers  


Explain the significance of the & and && operators in pl sql.

0 Answers  


What is a unique key?

0 Answers  


Why do we use triggers?

0 Answers  


What is dcl in sql?

0 Answers  


What are the operators in sql?

0 Answers  


Categories