Sunteți pe pagina 1din 2

Part 1

1.select sum(qty_sold) "total_quantity_sold",to_char(order_day,'mon') from orders group by


to_char(order_day,'mon');

2.select sum(qty_sold) "total_quantity_sold",decode(customer_id,'c1','chennai','delhi') from orders


o group by customer_id;

3.select * from (select prod_id,qty_sold from orders order by qty_sold) where rownum < 11;

4. select * from orders where customer_id ='c1' and order_day in (to_date('10-apr-2010','dd-mon-


yyyy'),to_date('10-mar-2010','dd-mon-yyyy'));

Part2

No Rows will be selected .

Ans 3 select e1.last_name ||’ works for ‘||e2.last_name “Employees and their Managers” from
employees e1,employees e2 where e1.manager_id =e2.employee_id;

Ques4 What are the Oracle Partitions and how they are useful?

Ans Partition enables tables and indexes or index organized tables to be subdivided into smaller
manageable pieces and these each small piece is called a “partition”.

Advantage of using Partition’s in table

1.Smaller and more manageable pieces of data(partition)

2.Reduce recovery time.

3.Failure impact is less.

4.Import/export can be done at the partition level”.

5.Faster access of data

6.Partition work independent of the other partitions.

7.Very easy to use.

Ques5.What are the oracle parallelism and how they are useful?
Ans

The Oracle database provides functionality to perform a complex task in parallel, without manual
intervention. Operations that can be executed in parallel include:

-SQL loader and SQL based data loads

- Queries

- Index builds

- Gathering statistics

One of the best way to implement parallelism in an Oracle environment is to use Oracle parallel
query(OPQ).

When Oracle has to perform a legitimate, large, full-table scan, OPQ can make a dramatic difference
in the response time. Using OPQ ,Oracle partitions the table into logical chuncks.

Once the table has been partitioned into pieces, Oracle fires off parallel query slaves and each slave
simultaneously reads a single piece of the large table. Upon completion of all slave process, Oracle
passes the results back to

S-ar putea să vă placă și