Oracle Cube | Cube - oracle tutorial - sql tutorial

What is Oracle CUBE ?

  • In addition to the subtotals generated by the ROLLUP extension, the CUBE extension will generate subtotals for all combinations of the dimensions specified.
oracle tutorial , sql tutorial , sql , pl sql tutorial , oracle , pl sql , plsql


SELECT Column_1,
SUM(some_column) AS some_column
FROM table_name
GROUP BY CUBE (Column_1,Column_2,..)
ORDER BY column_1, Column_2;
click below button to copy the code. By - oracle tutorial - team


       SUM(salary) AS salary 
FROM   wikitechy_employee
GROUP BY CUBE (id, city)
ORDER BY id, name;
click below button to copy the code. By - oracle tutorial - team

Sample Database:

  • For better understanding of cube concept we are using a Wikitechy_employee table.
 cube table 1 output

Code Explanation:

 cube query
  • The select list contains the dimension columns and aggregate function expressions selected from wikitechy_employee table.
  • The CUBE operator is specified in the GROUP BY clause of a SELECT statement.
  • The GROUP BY specifies the dimension columns and the keywords WITH CUBE.
Oracle cubes-data-warehousing-data-mart

Oracle cubes-data-warehousing-data-mart

Cube Example Output:

 cube output
  1. This row report the subtotal for the City dimension. It have null in the ID dimension to show that the aggregate data came from row having any value for the ID dimension.
  2. This row depicts the total value of each city.

This tutorial provides an indepth knowledge on the following items such as oracle tutorial , sql tutorial , sql , pl sql tutorial , oracle , pl sql , mysql tutorial , sql tutorial for beginners , learn sql , oracle database tutorial , sql query tutorial , oracle dba tutorial , plsql tutorial , oracle tutorial pdf , oracle pl sql tutorial , oracle sql tutorial , sql tutorial point , oracle tutorial for beginners , learn oracle online free , learn oracle online , learning pl sql programming , learn sql online for free , sql learning online , dba oracle tutorial , oracle sql tutorial advanced , oracle 11g dba tutorial with examples , oracle online learning , oracle learning online , how to learn pl sql , sql coding tutorial , sql learning websites , sql basic learning

Related Searches to Cube Oracle | Cube

Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

We don't have any banner, Flash, animation, obnoxious sound, or popup ad. We do not implement these annoying types of ads!

We need money to operate the site, and almost all of it comes from our online advertising.

Please add to your ad blocking whitelist or disable your adblocking software.