Database Administration and PL/SQL Concepts
Covers data architecture, database modeling, PL/SQL procedures, triggers, packages, functions, and database administration concepts
Questions
Transaction ends
- Only when it is Committed
- Only when it is Rolledback
- When it is Committed or Rolledback
- None of the above
What SYSTEM VARIABLE is used to refer DATABASE TIME ?
- $$dbtime$$
- $$time$$
- $$datetime$$
- None of the above
Which of the following is not correct about a View ?
- To protect some of the columns of a table from other users
- Ocuupies data storage space
- To hide complexity of a query
- To hide complexity of a calculations
CREATE OR REPLACE FUNCTION CALC_PLAYER_AVG (V_ID in PLAYER_BAT_STAT.PLAYER_ID%TYPE) RETURN NUMBER IS V_AVG NUMBER; BEGIN SELECT HITS / AT_BATS INTO V_AVG FROM PLAYER_BAT_STAT WHERE PLAYER_ID = V_ID; RETURN (V_AVG); END; Which statement will successfully invoke this function in SQL *Plus
- SELECT CALC_PLAYER_AVG(PLAYER_ID) FROM PLAYER_BAT_STAT;
- EXECUTE CALC_PLAYER_AVG(31);
- CALC_PLAYER(‘RUTH’);
- CALC_PLAYER_AVG(31);
Which is the true statements about dependent objects?
- An object with status of invalid cannot be a referenced object.
- The Oracle server automatically records dependencies among objects.
- All schema objects have a status that is recorded in the data dictionary.
- You can view whether an object is valid or invalid in the USER_STATUS data dictionary view.
You have created a stored procedure DELETE_TEMP_TABLE that uses dynamic SQL to remove a table in your schema. You have granted the EXECUTE privilege to user A on this procedure. When user A executes the DELETE_TEMP_TABLE procedure, under whose privileges are the operations performed by default?
- SYS privileges
- Your privileges
- Public privileges
- User A’s privileges
CREATE OR REPLACE PRODECURE add_dept (p_dept_name VARCHAR2 DEFAULT ‘placeholder’, p_location VARCHAR2 DEFAULT ‘Boston’) IS BEGIN INSERT INTO departments VALUES (dept_id_seq.NEXTVAL, p_dept_name, p_location); END add_dept; / Which is invalid call to the add_dep procedure? (Choose three
- add_dept;
- add_dept(‘Accounting’);
- add_dept(, ‘New York’);
- add_dept(p_location=>’New York’);
Which programming constructs can be grouped within a package?
- Cursor
- Trigger
- Sequence
- View
Which statement describe the state of a package variable after executing the package in which it is declared?
- It persists across transactions within a session.
- It persists from session to session for the same user.
- It does not persist across transaction within a session.
- It persists from user to user when the package is invoked.
Which statement is valid when removing procedures?
- Use a drop procedure statement to drop a standalone procedure.
- Use a drop procedure statement to drop a procedure that is part of a package. Then recompile the package specification.
- Use a drop procedure statement to drop a procedure that is part of a package. Then recompile the package body.
- For faster removal and re-creation, do not use a drop procedure statement. Instead, recompile the procedure using the alter procedure statement with the REUSE SETTINGS clause.
Which statement is false?
- If errors occur during the compilation of a trigger, the trigger is still created.
- If errors occur during the compilation of a trigger you can go into SQL *Plus and query the USER_TRIGGERS data dictionary view to see the compilation errors.
- If errors occur during the compilation of a trigger you can use the SHOW ERRORS command within iSQL *Plus to see the compilation errors.
- If errors occur during the compilation of a trigger you can go into SQL *Plus and query the USER_ERRORS data dictionary view to see compilation errors.
Which dictionary views track dependencies?
- USER_SOURCE
- UTL_DEPTREE
- USER_OBJECTS
- DEPTREE_TEMPTAB
What happens during the execute phase with dynamic SQL for INSERT, UPDATE, and DELETE operations?
- The rows are selected and ordered.
- The validity of the SQL statement is established.
- An area of memory is established to process the SQL statement.
- The SQL statement is run and the number of rows processed is returned.
What part of a database trigger determines the number of times the trigger body executes?
- Trigger type
- Trigger body
- Trigger event
- Trigger timing
Which table should you query to determine when your procedure was last compiled?
- USER_PROCEDURES
- USER_PROCS
- USER_OBJECTS
- USER_PLSQL_UNITS
In strict relational terminology, an attribute is
- a record
- a field
- a table
- an entity
"A student has such attributes as name, address, and gender. A student can also attend a graduate, undergraduate, or elective class that has the following attributes: class name, section name, major, and instructor. Based on the scenario above, which is the composite key in a junction table if many students can attend many classes?
- section name, age
- name
- undergraduate
- name, class name
- major, gender
Which of the following is not a data modeling tool?
- Visio
- ERwin
- ER/Studio
- Data Builder
- empowER
What is the goal of Data Architecture?
- Design logical data systems
- Design physical storage system
- Define data entities relevant to the enterprise
- All of the above
Data architecture document does not include:
- Business Data Model
- Logical Data Model
- Data Management Process Model
- Data entity/business function Matrix
- Data Interface requirements