In this article, we will talk about Important QnA GroupBy OrderBy Class 12. As we have seen the topic in detail in the previous article MySQL Queries IP Class 12. Let us start!
QnA GroupBy OrderBy Class 12
As usual, we will start the Important QnA GroupBy OrderBy Class 12 session with objective type questions of 1 marks, that consists of fill in the blanks, true/false or MCQs.
Objective Type Questions
- The ______ clause combines all records from a particular field of a table.
- You can use group by with a column name with ________ functions to display the results for each group.
- Which of the following clause applies conditions on the group by results?
- group by
- order by
- Order by clause is used to sort the results in the ascending or descending order. (True/False)
- You cannot use multiple group by clause in a query. (True/False)
- The ____________ clause have either simple boolean expression or use aggregate function with a condition.
- The order by clause display the results in ascending order by default. (True/False)
- The ________ keyword is required to display the results in descending order.
- Select the correct option to display the records in increasing order of the country column from the table population:
- select population, country from population in increasing order to country;
- select population, country from population increasing order by country;
- select population, country from population order by country;
- select population, country from population where order by country;
- Which of the following statement is correct for having clause?
- It is exactly as similar as where clause
- It works only on columns not on groups
- It works only on rows not on column groups
- It works on column groups
- You can use having and where clause together in MySQL statement. (True/False)
- The group by clause always comes before order by clause in the SQL statement if both used in SQL statement. (True/False)
- You have to use the column in both select and group by clause to group the results. (True/False)
- Which of the following word is used to display the result in descending order?
- You cannot where and order by clause in a single SQL statement. (True/False)
Let us have a look on the answers of objective type questions for our article Important QnA GroupBy OrderBy Class 12.
- group by
- b) having
- c) select population, country from population order by country;
- d) It works on column groups
- d) desc
In the next section of Important QnA GroupBy OrderBy Class 12, we will discuss the short answer questions.
Short Answer questions
- What do you mean by group by clause?
- What is the significance of having clause in SQL statement?
- How you can use group by clause?
- Ms. Sandhya is working on a table named customers. She wants to count the customer according to their category, she wrote following statement, but not getting proper result, help her to resolve the problem and get the proper output: select category, count(*) from customers;
- Mr. Kartik is wanted to show the results of employees according to the each city. Suggest him the proper SQL statement.
- Ms. Manisha is working on a table and want to display the students who scored more than 85% marks in science stream. Write a SQL command to do this.
- How to display the employees who are earning more than 1200 from each department?
- How you can display non-group expression using group by clause?
- What is the use of order by in SQL statement? Explain with example.
- Write SQL statement to display all the employees records in increasing orders of names.
That’s all from the Important QnA GroupBy and OrderBy Class 12. Try to write the answers yourself. If you have any doubt, leave your comments.
Don’t forget to hit the like button if you enjoyed the article Important QnA GroupBy and OrderBy Class 12.
We will cover the queries part and practical questions for Important QnA GroupBy and OrderBy Class 12 in the practical session.
Thank you for visiting our blog.