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
Explain the θ-join and equijoin Refer tables Car and Boat which list models of cars and boats and their relevant prices. Assume a customer wants to buy a car and a boat, but sh

Discuss the mechanism to read data from and write to a disk? Disk read/write heads are mechanisms in which read data from or write data to disk drives. The heads have gone by

Produce a set of relations (equivalent to the Finkelstein entity list) in third normal form (3NF) from the following un-normalised relation. You must use the Finkelstein methodolog

Need a sample of a clinic database relationships

The following data are required to be stored by a family physician. Family#, FamilyAddress, Patient#, PatientName, ServiceCode, ServiceFee, ServiceDate A family can have seve

What are the costs to be considered when a transaction has to be rolled back when recovering from deadlock?         Ans: A few transaction will must rolled back (made a victim)

#quCreate a database design specification (Enhanced Entity Relationship Diagram (EERD) and Relational Data Model (RDM)) from the given business description. The RDM must be in 3rd

You are managing the following database system: • DBMS: Oracle 11g • OS: Sun Solaris • System architecture: Web-based application using ASP.Net • Purpose of Server: HR managem

Adding Redundant Associations for Efficient Access Redundant associations do not add any type of information, therefore during design we should actually examine structure of o

Multiple column Queries: Syntax: SELECT COLUMN1, COL2,...... FROM TABLE WHERE (COLUMN1, COL2, ...) IN (SELECT COLUMN1, COL2,....  FROM TABLE WHERE );