Creating and Managing Tables
Creating and Managing Tables
Object Description
Table Basic unit of storage; composed of rows
and columns
• You specify:
– Table name
– Column name, column data type, and column size
• User Tables:
– Are a collection of tables created and maintained by
the user
– Contain user information
• Data Dictionary:
– Is a collection of tables created and maintained by
the Oracle Server
– Contain database information
•• See
See the
the names
names of
of tables
tables owned
owned by
by the
the user.
user.
SELECT table_name
FROM user_tables ;
•• View
View distinct
distinct object
object types
types owned
owned by
by the
the user.
user.
SELECT DISTINCT object_type
FROM user_objects ;
•• View
View tables,
tables, views,
views, synonyms,
synonyms, and
and sequences
sequences owned
owned by
by
the
the user.
user.
SELECT *
FROM user_catalog ;
“Add a new
column to the
DEPT80
table.”
DEPT80
ALTER
ALTER TABLE
TABLE table
table
DROP
DROP UNUSED
UNUSED COLUMNS;
COLUMNS;