Question

In: Computer Science

Why would you want to use grouping in a query? Explain.

Why would you want to use grouping in a query? Explain.

Solutions

Expert Solution

We use grouping in queries to collect the rows having similar data.

Grouping is done in queries with the help of the Group By clause.

We have to specify the name of the coloum with group by clause to identify that coloum similar data.

Synatx:

SELECT statements... GROUP BY column_name1[,column_name2,...] 

I am uploading some images by them you can easily understand the grouping concept with example.

There are some major points that needs to remember for grouping

GROUP BY clause is used with the SELECT statement.

GROUP BY clause is always written after WHERE clause.

GROUP BY clause is always written before ORDER BY clauseif order by is used.

Still if you are having any doubt feel free to ask.


Related Solutions

why would you want to use grouping in a query? Explain. Give Examples.
why would you want to use grouping in a query? Explain. Give Examples.
Recursion Discussions Question: Why would you want to use recursion? Concerning programming, when would you want...
Recursion Discussions Question: Why would you want to use recursion? Concerning programming, when would you want to use iterative vs. recursive programming? Where does coding fit in concerning the software process (i.e. its use in design, in coding, etc.)? Describe recursion problems, and why does it seem to fit with recursion? (e.g. nature, math, music, sports game, etc.)  
If you have a computer, why would you want an IP address? Why would you want...
If you have a computer, why would you want an IP address? Why would you want a URL? Would you ever want both? Why? Detailed answer please.
a) Explain what is meant by UBV filters. b) Explain why astronomers would want to use...
a) Explain what is meant by UBV filters. b) Explain why astronomers would want to use such filters. c) Give an example of the usage of UBV filters.
if you want to increase aggregate supply what policy would you use? why?
if you want to increase aggregate supply what policy would you use? why?
why would society want to adopt the use of autonomous cars ?
why would society want to adopt the use of autonomous cars ?
Why and when would you want to use ANOVA in marketing research? Provide an example where...
Why and when would you want to use ANOVA in marketing research? Provide an example where you would use ANOVA. Please make relevant to MARKETING research!
Why would you want to use the Monte Carlo Simulation to explore a decision option rather...
Why would you want to use the Monte Carlo Simulation to explore a decision option rather than solve the branch analytically?
If you were delivering a child , would you want to use anesthetic medication ? Would...
If you were delivering a child , would you want to use anesthetic medication ? Would you use the Lamaze method ? Why or why not ? If you were a prospective father , what would your thoughts be ? What are the pros and cons of both methods ?   
Would you want to know if your spouse or lover cheated on you? Why or why...
Would you want to know if your spouse or lover cheated on you? Why or why not ? Does being married make a difference in how you feel about this issue? Why or why not?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT