Database Reference
In-Depth Information
USER_TABLES Table
Figure 1-13
Generic Metadata tables
TableName
NumberColumns
PrimaryKey
STUDENT
4
StudentNumber
CLASS
4
ClassNumber
GRADE
3
(StudentNumber, ClassNumber)
USER_COLUMNS Table
ColumnName
TableName
DataType
Length (bytes)
StudentNumber
STUDENT
Integer
4
LastName
STUDENT
Text
25
FirstName
STUDENT
Text
25
EmailAddress
STUDENT
Text
100
ClassNumber
CLASS
Integer
4
Name
CLASS
Text
25
Text
Term
CLASS
12
Section
CLASS
Integer
4
StudentNumber
GRADE
Integer
4
ClassNumber
GRADE
Integer
4
Grade
GRADE
Decimal
(2, 1)
By The Way Because metadata is stored in tables, you can use SQL to query it, as just
illustrated. Thus, by learning how to write SQL to query user tables, you
will also learn how to write SQL to query metadata. To do that, you just apply the SQL
statements to metadata tables rather than user tables.
In addition to user tables and metadata, databases contain other elements, as shown in
Figure 1-14. These other components will be described in detail in subsequent chapters. For
now, however, understand that indexes are structures that speed the sorting and searching
of database data. Triggers and stored procedures are programs that are stored within the da-
tabase. Triggers are used to maintain database accuracy and consistency and to enforce data
constraints. Stored procedures are used for database administration tasks and are sometimes
part of database applications. You will learn more about these different elements in Chapters 7,
10, 10A, 10B, and 10C.
Security data define users, groups, and allowed permissions for users and groups. The
particulars depend on the DBMS product in use. Finally, backup and recovery data are used
 
 
Search WWH ::




Custom Search