Professional Documents
Culture Documents
Practical No 1
Practical No 1
Practical No 1
Practical no 1
Aim: Implementation of data partitioning to range and list partitioning
Objective: understand partition concept with range and list partitioning
Theory:
What is paetitionig:
Partitioning enable tables and index to be subdivided into individual smaller
pieces. Each piece of database object is called partition. Partition has its own name and may have
its own storage characters
.
Type of partitioning:
1.range partition: the data is distributed based on a range of value of partition key.
2.list partition: the data is distributed based on a descrete of list of value of partition key
Range partition:
create table sales3_range
(
salesman_id number(5),
salesman_name varchar2(30),
sales_amount number(10),
sales_date date)
partition by range(sales_date)
(
partition sales_jan2000 values less than(to_date('01/02/2000','DD/MM/YYYY')),
partition sales_feb2000 values less than(to_date('01/03/2000','DD/MM/YYYY')),
partition sales_mar2000 values less than(to_date('01/04/2000','DD/MM/YYYY')),
partition sales_apr2000 values less than(to_date('01/05/2000','DD/MM/YYYY'))
Mca L13-ABDBMS LAB
)
;
7 rows selected.
PRACTICAL NO 2
Aim: implementation of analytical queries like: ROLL_UP, CUBE, ROW_NUMBER, RANK, DENSE_RANK,
LEAD,LAG, FIRST,LAST
employee_id number(5),
departmen_id number(5),
employee_name varchar(30),
salary number(10),
dob date,
doj date,
job varchar(20)
);
Mca L13-ABDBMS LAB
ERROR:
ERROR:
ERROR:
1 row created.
1 row created.
Mca L13-ABDBMS LAB
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
Mca L13-ABDBMS LAB
SQL
aim: display department id ,job ,count, sum of salary and group them using rollup function in the order
of department id and job.
Display department id , job, count, sum of salary , group them up using cub function in the order of
department id and job