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
If the insertion violates one or more constraints, then two alternatives are available: Default option: - Insertion can be discarded and the reason of refusal can also be ex

A step-wise distributed database design methodology Following is a step-wise methodology for distributed database design. (1) Examine the nature of distribution. Find out wh

How can you map NULL values to other values while display? IF( ) , IFNULL( ) keywords are used to do so. They are 'LIMIT' is used for the following kinds of problems: 1) Ans

Write short notes on domain relational calculus The domain relational calculus uses domain variables that take on values from an attribute domain rather than values for whole t

Write short note on Data models? Data models: A data model is an abstract model which elaborates how data is represented and accessed. The term data model has two commonly ac

write a short note on participation role? Participation role: roles are indicating in E-R diagram by labelling the lines that connect diamonds to rectangles.

Explain the integrity constraints: Not Null,  Unique, Primary Key with an example each. Is the combination 'Not Null, Primary Key' a valid combination. Justify. Not Null - Shou


Construct an ER diagram for a hospital along with a set of patients and a set of medical doctors Associate with every patient a log of the several tests and examinations conducted.

What do you mean by persistence? How you will make your data persistent? Persistent data is the data, which has a longer lifetime than program which has created it. Enabling th