Introduction To PLSQL and Other Schema Objects
Introduction To PLSQL and Other Schema Objects
In order to accomplish this exercise, the student must have a clear understanding of the following topics:
Create simple and complex views.
Retrieve data from views.
Create, maintain, and use sequences.
Create and maintain indexes.
Create private and public synonyms.
1. Create a view that would contain the department id and department name of the departments table, wherein
the manage id is null. Name this view as DeptIDName.
2. Create view that would contain the employee id, first name, last name, salary of the employee, including his/
her department name and job title of employees that has an employee id that starts with 200 and above.
Name this view as EMPLOYEE_DET.
3. Write the code the show the content of the view EMPLOYEE_DET.
4. Create a view that would contain the street address, postal code, city, and state province of the countries
Brazil, Belgium and Mexico. Name this view as AddressofCountries.
5. Edit the view AddressofCountries. Create an alias for each columns of the view. Here are the aliases:
Street address = ST
Postal Code = PC
City = City
State Province = S_Province
6. Create a sequence named Dept_Seq1. This sequence increases by 5 and begins with number 600. Its
biggest value is 10000. There should be no cache nor cycle.
7. Using the new sequence Dept_Seq1, insert a new record on the departments table using the sequence as the
department id value.
8. Change the starting number of Dept_Seq1. The sequence should start at 700.
9. Create an index to optimize the column of the Commision PCT in the employees table. Name this index as
INDEX_comm.
10. Create a synonym for the table countries. Name this synonym as BANSA.
1. What are the parts of a PL/SQL block? Define each ones purposes?
VIII. REFERENCES
Hoffer, J., Ramesh, V., Topi, H. (2013). Modern Database Management 11 th Edition, Prentice Hall.
Singh, P., Pottle, B. (2009). Oracle Database 11g: SQL Fundamentals I, Oracle.