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
Using SQL create a view RS for the relations R and S. The view consists of the columns A and D renamed as X and Y in that order. Insert a tuple into it. Show the contents of t

Greater potential for bugs: Since the sites of a distributed system operate simultaneously, it is more complex to ensure the correctness of algorithms. The art of constructing dis

using the invoice table shown below,write the relational schema,draw a dependencies,inclunding all partial and transitive dependencies.assume that the table does not contain repeat

Why a report generator is used ? Report generator is used for print files on paper.

What is called block-level striping? Block level striping stripes blocks across many disks. It treats the array of disks as a large disk, and provides blocks logical numbers

Discuss The difference between drop table R and delete from R.  DROP TABLE command deletes all the records with the table definition. This command will automatically committed

Explain Object oriented Model ? Object Oriented Model - This model is based on the object-oriented programming language paradigm. It involves the features of OOP such as inhe

The State of NewYork certifies firefighters throughout state and keep track all of them, as well as of the state’s fire departments. Each fire department has unique department numb

Explain Hierarchical Model ? Hierarchical Model - It was established to model several kinds of hierarchical organizations which exist in the real world. It uses tree structur

What are the various properties of Relational tables? Relational tables have 6 properties: 1. Each row is unique. 2. Column values are of the same kind. 3. Values are