1 / 4

SQL – IV Grouping data from tables in SQL The concept of grouping GROUP BY clause HAVING Clause

SQL – IV Grouping data from tables in SQL The concept of grouping GROUP BY clause HAVING Clause Determining whether values are unique Group by using the ROLLUP operator Grouping by using the CUBE operator Sub-Queries Using sub-query in the FROM clause. Using correlated sub-query

qamra
Télécharger la présentation

SQL – IV Grouping data from tables in SQL The concept of grouping GROUP BY clause HAVING Clause

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SQL – IV Grouping data from tables in SQL The concept of grouping GROUP BY clause HAVING Clause Determining whether values are unique Group by using the ROLLUP operator Grouping by using the CUBE operator Sub-Queries Using sub-query in the FROM clause. Using correlated sub-query Using multi column sub-query Using sub-query in the CASE expression Using sub-query in an ORDERBY clause Using EXISTS/NOT EXISTS operator JOINS Joining multiple tables Inner join Outer join Cross join

  2. Guidelines for creating joins Joining a table to itself Concatenating data from table columns Using the UNION, Intersect and Minus clause Union clause Intersect clause Minus clause

  3. Grouping data from tables in SQL The concept of grouping SQL SELECT statements have: all, WHERE, DISTINCT, ORDER BY GROUP BY and HAVING. Theses are parallel to the order by and where clause, except that they act on record sets and not on individual records. GROUP BY clause: It is another section of the select statement. This optional clause tells Oracle to group rows based on distinct values that exits for specified columns. SELECT col1, col2, col3 AGGREGATE_FUNCTION(<exp>) FROM tablename WHERE <condition> GROUP BY col1, col2, col3 e.g., SELECT branch-no “Branch No.”, count (emp_no) “NO. Of Employees” FROM EMP_MSTR GROUP BY branch_no; SELECT branch-no “Branch No.”, type “Type”, count (acct_no) “NO. Of Accounts” FROM EMP_MSTR GROUP BY branch_no, type; HAVING Clause Determining whether values are unique Group by using the ROLLUP operator Grouping by using the CUBE operator

More Related