Group by clauses-data manipulation language, Database Management System

Group By clauses

 • It is used to group database tuples on the basis of definite common attribute value like as employees of a department.

  • WHERE clause still can be used, if required.

Example: Search department number and Number of Employees working in that department.

 SELECT DEPTNO, COUNT(EMPNO) FROM EMP

GROUP BY DEPTNO;

Please note that as using group by and aggregate functions the only attributes that can be put in select clause are the aggregated functions and the attributes that have been used for grouping the information. For instance, in the example 20, we cannot put ENAME attribute in the SELECT clause as it will not have a distinct value for the group. Please note the group here is formed on DEPTNO.

 

Posted Date: 3/11/2013 1:08:19 AM | Location : United States







Related Discussions:- Group by clauses-data manipulation language, Assignment Help, Ask Question on Group by clauses-data manipulation language, Get Answer, Expert's Help, Group by clauses-data manipulation language Discussions

Write discussion on Group by clauses-data manipulation language
Your posts are moderated
Related Questions
What is meant by heuristic optimisation?  Discuss the main heuristics that are applied during query optimisation.  Ans:  In heuristic optimization, heuristics are employed to r

explain the steps for reduction of er model into relational model?

How to create a table from existing table? Create table as e.g, To create a new table ‘N_emp' with employee names and their identification numbers only from employee ta

what are the states of transaction?

how to implement mid square hashing?

properties of derirable decomposition

In a relation, tuples are not inserted in any definite order. Ordering of tuples is not defined as a part of a relation definition. Though, records may be structured later accordin

Question : (a) Explain with the help of appropriate examples the difference between ‘Data' and ‘Information'. (b) A digital image is an array of pixels, where each pixel h

cardnality ratio for humanresource mangement system

How do you find the final model after iterative analysis? Why is iterative analysis of any of the problem needed? The final model serves as the base for system architectur