PLSQL 9 3 Practice
PLSQL 9 3 Practice
com/academy
Data Dictionary
A catalog of all database objects contained in an Oracle database.
User_table
Contain information about objects you own.
Try It / Solve It
1. Which of the following statements are true:
A) The Data Dictionary is a list of hard coded table names in all Oracle databases.
B) The Data Dictionary can be updated by all users with Select statements.
C) All users of an Oracle Database can see details of all tables in that database.
D) The Data Dictionary is owned by the user called SYS.
2. List the three different classes of Data Dictionary views, and state what kind of information is
shown by each class.
USER_ views*: Information about objects owned by the current user.
ALL_ views*: Information about all objects accessible to the current user.
DBA_ views*: Comprehensive information about all objects in the database, accessible by
database administrators.
2
3. Write and execute a SELECT statement that lists all the stored objects you have created in your
account so far. The query should return the object name, its type, and its status. Order the output
by type of object.
SELECT
OBJECT_NAME,
OBJECT_TYPE,
STATUS
FROM
USER_OBJECTS
ORDER BY
OBJECT_TYPE;
4. Modify the query from question 3 to show only functions and procedures to which you have access.
Add the owner of the object to display in the results.
SELECT
OWNER,
OBJECT_NAME,
OBJECT_TYPE,
STATUS
FROM
ALL_OBJECTS
WHERE
OBJECT_TYPE IN ('FUNCTION', 'PROCEDURE')
ORDER BY
OBJECT_TYPE;
6. Write and execute a suitable SELECT…FROM DICT… statement to list dictionary views which
contain information about all views which you own.
SELECT
TABLE_NAME,
COMMENTS
FROM
DICT
WHERE
COMMENTS LIKE '%view%'
AND
COMMENTS LIKE '%own%'
ORDER BY
TABLE_NAME;