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
At times, customers make mistakes in submitting their orders and call to cancel the order. Brewbean’s wants to create a trigger that automatically updates the stock level of all pr

Cursor Attributes   The Cursors and cursor variables have 4 attributes which give you helpful information about the execution of a data manipulation statement. Syntax:

Overview of control structures According to the structure theorem, any computer program can be written by using the basic control structures as shown in figure below. They can b

Scoping Within the similar scope, all the declared identifiers should be unique. So, even if their datatypes differ, the variables and parameters cannot share the similar name.

Implicit Cursor Attributes The Implicit cursor attributes returns the information about the execution of an INSERT, DELETE, UPDATE, or SELECT INTO statement. The cursor attribu

DECLARE : This keyword signals the beginning of the declarative section of the PL/SQL block, that contains local declarations. The Items declared locally exist only within the

Write a query to find academics that are authors and that have only ever coauthored papers with authors from institutes in the same state as their own. List their academic number,

Special cases of projection This section describes the identity projection, r {ALL BUT}, and the projection on no attributes, r { }, which yields TABLE_DUM when r is empty, ot

Processing Transactions This part describes how to do the transaction processing. You learn the fundamental techniques that safeguard the consistency of your database, involvin

Inner Join We have learned how to retrieve data from one table by using SELECT statement. But, as we have learned, normalized relational databases mean the data is spread betw