Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

SQL Assignment 12

 Write down different attributes of a SIMPLE VIEW in Oracle.

 What is the use of FORCE clause during view creation in oracle?

 Write down in which situation, it is not possible to insert data to the base table

through a view.

 What is the use of WITH READ ONLY clause during view creation in oracle?

 If a base table is dropped then what will happen to its dependent views?

 During sequence creation if START WITH and INCREMENT clause is omitted,

then what will be the starting number and interval between sequence numbers for

that sequence?

 In which situation, gaps in sequence values can occur?

 For modifying a sequence, which privilege (s) is required?

 In which situations indexes are useful and to be created?

 What is the difference between PRIVATE and PUBLIC SYNONYM in Oracle?

 The Staff in the HR department want to hide some of the data in the EMPLOYEES

table. They want a view called EMPLOYEES_VU based on the employee’s number,

employee last name and department numbers from the EMPLOYEES table. They

want heading for the employee last name as EMPLOYEE.

 Confirm that the above created view works by displaying the structure and contents

of the view (EMPLOYEES_VU).

 Using your EMPLOYEES_VU view, write a query for the HR department to display

all employee names and department numbers.

 Department 50 needs access to its employee data. Create a view named DEPT50 that

contains the employee numbers, employee last names and department numbers for
all employees in department 50. You are asked to label the view columns EMPNO,

EMPLOYEE, and DEPTNO. For security purposes, do not allow an employee to be

reassigned to another department through the view.

 Create a sequence which should start at 200 and have a maximum value of 2000.

Have your sequence increment by 10. Name the sequence DEPT_ID_SEQ.

 Create a synonym for your EMPLOYEES table. Call it EMP.

 Write a query to display the following information about your sequences.

o Sequence name

o Maximum Value

o Increment Size

o Last Number.

 You need to determine the names and definitions of all the views in your schema.

Create a report that retrieves the view information: the view name and text from the

USER_VIEWS data dictionary view.

 Alter the session to set the NLS_DATE_FORMAT to DD-MON-YYYY HH24: MI:

SS.

 Alter the session to set the TIME_ZONE parameter value to the time zone Offset of

“Egypt”.

 Write a single query to display the CURRENT_DATE, CURRENT_TIMESTAMP,

and LOCALTIMESTAMP for your session.

 Write a query to extract YEAR from the HIRE_DATE column of the EMPLOYEES

table for those employees who work in department number 90.

You might also like