T3-TECHNICAL - RubickMid (Cruz, Hernaez, Sumagui)
T3-TECHNICAL - RubickMid (Cruz, Hernaez, Sumagui)
T3-TECHNICAL - RubickMid (Cruz, Hernaez, Sumagui)
TECHNICAL ASSESSMENT 3
Part A:
Write a series of scripts that would create a new user, grant at least four system and at least four object
privileges. Each script should have a comment statement what is statement is doing and its purpose.
Save the script as Tech9_fullname. Save this file as Tech3Document_fullname.
Part B:
Answer the following using SQL developer. Use the schema of HR to answer this. Copy and paste your
answer below each number. And also paste the result of your answers.
1. Create a sequence that starts with 1, an interval of 2 and the biggest number is 999999. Name the
sequence as Sequence1.
START WITH 1
INCREMENT BY 2
MAXVALUE 999999;
2. Create a view that will show all the salaries and names of employees in the Administration
department.
from Administration_department
for job_history;
4. Create an anonymous block that would output your complete name of the screen.
DECLARE
v_name VARCHAR(30);
BEGIN
DBMS_OUTPUT.put_line ('Mervin Kim E. Sumagui');
DBMS_OUTPUT.put_line ('Jose Mari E. Hernaez');
DBMS_OUTPUT.put_line ('Cruz, Gabriel John P.');
END;
5. Create an anonymous block to get the average of 5 numbers. Each number should come from the
input of the user.
6. Create an anonymous block that will input the name of an employee, birthday, address and age. The
name of the employee, birthday and address should come from the input of the user, while the age
should be calculated based on his/her birthday.
declare ename VARCHAR2(50);
bdate DATE;
eaddress VARCHAR2(50);
eage NUMBER;
begin
ename := '&empname';
bdate := TO_DATE('&birthdate','DD-MON-YY');
eaddress := '&empaddress';
eage := &empage;
DBMS_OUTPUT.put_line (ename);
DBMS_OUTPUT.put_line (bdate);
DBMS_OUTPUT.put_line (eaddress);
DBMS_OUTPUT.put_line (eage);
end;
Part C: