Java Reference
In-Depth Information
Application Users
Application Programs
Database Management System
Database Management System
database
F IGURE 32.2
An application program can access multiple database systems.
Structure defines the representation of the data. Integrity imposes constraints on the data.
Language provides the means for accessing and manipulating data.
32.2.1 Relational Structures
The relational model is built around a simple and natural structure. A relation is actually a
table that consists of nonduplicate rows. Tables are easy to understand and use. The relational
model provides a simple yet powerful way to represent data.
A row of a table represents a record , and a column of a table represents the value of a single
attribute of the record. In relational database theory, a row is called a tuple and a column is
called an attribute . Figure 32.3 shows a sample table that stores information about the courses
offered by a university. The table has eight tuples, and each tuple has five attributes.
relational model
tuple
attribute
Columns/Attributes
Relation/Table Name
courseId subjectId
courseNumber
title
numOfCredits
Course Table
Tuples/
Rows
11111 CSCI 1301 Introduction to Java I 4
11112 CSCI 1302 Introduction to Java II
3
11113 CSCI 3720 Database Systems
3
11114 CSCI 4750 Rapid Java Application
3
11115 MATH 2750 Calculus I
5
11116 MATH 3750 Calculus II
5
11117 EDUC 1111 Reading
3
11118 ITEC 1344 Database Administration
3
F IGURE 32.3
A table has a table name, column names, and rows.
Tables describe the relationship among data. Each row in a table represents a record of
related data. For example, “11111,” “CSCI,” “1301,” “Introduction to Java I,” and “4” are
related to form a record (the first row in Figure 32.3) in the Course table. Just as the data in
the same row are related, so too data in different tables may be related through common attrib-
utes. Suppose the database has two other tables, Student and Enrollment , as shown  in
 
 
Search WWH ::




Custom Search