Java Reference
In-Depth Information
Stocks table. Therefore, it consists only of foreign keys to the Users and Stocks
tables, respectively. It is common to name a table such as this with a name
indicative of the relationship. Figure 11-3a illustrates the three tables, their fields,
primary keys (in bold), and the relationships between the tables.
UserStocks table
primary key
(compound)
(a) Stock Tracker Database
Relationships
foreign key
to Users table
infinity
symbol
Stocks table
primary key
one-to-many
(Stocks to
UserStocks)
relationship
Stocks table
Users table
foreign key
to Stocks table
one-to-many
(Users to
UserStocks)
relationship
Users table
primary key
UserStocks table
(b) Sample Data in
Stock Tracker
Database
User owns
three stocks
Stock held
by two users
-1 is True;
0 is False
binary data
for Password objects
FIGURE 11-3
 
Search WWH ::




Custom Search