Group and having query, PL-SQL Programming

Using a join on 2 tables, select all columns and 10 rows from the 2 tables without the use of a Cartesian product.

Query:

SELECT * FROM EMPLOYEE1 E JOIN STAFF S ON E.EMP_ID=S.EMP_ID WHERE ROWNUM<11;

Use group by & having in a select statement using one or more table(s) (If more than 1 table then, don't use a Cartesian product).

Query:

SELECT BRANCH,COUNT(*) FROM STAFF  GROUP BY BRANCH;

 

 

Posted Date: 3/14/2013 2:02:58 AM | Location : United States







Related Discussions:- Group and having query, Assignment Help, Ask Question on Group and having query, Get Answer, Expert's Help, Group and having query Discussions

Write discussion on Group and having query
Your posts are moderated
Related Questions
Relational Operators and Logical Operators It prepares the ground for subsequent sections in which each specific relational operator is paired with its logical counterpart, su

Data Abstraction The Data abstraction extracts the important properties of data while ignoring the not necessary details. Once you design a data structure, you can fail to reme

%NOTFOUND The %NOTFOUND is the logical opposite of the %FOUND. The %NOTFOUND yields TRUE when an INSERT, UPDATE, or DELETE statement affected no rows, or the SELECT INTO state

Parameter Modes: You do not require to specify a parameter mode for the input bind arguments (those used, for illustration, in the WHERE clause) as the mode defaults to IN. Th

Disjunction (OR, ∨) Again we have nine rows instead of just four and again, when unknown is not involved, the rows are as for 2VL. Also, when anything is paired with true, t

On occasion, some of Brewbean's customers mistakenly leave an item out of a basket already checked out, so they create a new basket containing the missing items. However, they requ

Brewbean's is implementing a new discount for return shoppers - every fifth completed order receives a 10% discount. The count of orders for a shopper is placed in a packaged varia

Using EXISTS The EXISTS(n) returns TRUE if the nth element in a collection exist. Or else, EXISTS(n) returns FALSE. Primarily, you use EXISTS with DELETE to maintain the spars

Keys in SQL SQL support for keys in the following respects: SQL does not require at least one key for every base table. If no key is explicitly declared, then KEY {ALL B

Benefit of the dynamic SQL: This part shows you how to take full benefit of the dynamic SQL and how to keep away from some of the common pitfalls. Passing the Names of Sc