Exercise relation Accounts, the attributes are:
acctNo, type, balance
For relation Customers, the attributes are:
firstName, lastName, idNo, account
Exercise relation Accounts, the tuples are:
(12345, savings, 12000), (23456, checking, 1000),
(34567, savings, 25)
For relation Customers, the tuples are:
(Robbie, Banks, 901-222, 12345), (Lena, Hand, 805-333, 12345),
(Lena, Hand, 805-333, 23456)
Exercise relation Accounts and the first tuple, are:
the components
123456 acctNo savings type 12000 balance
For relation Customers and the first tuple, the components are:
Robbie firstName Banks lastName 901-222 idNo 12345 account
Exercise relation Accounts, a relation schema is:
Accounts(acctNo, type, balance)
For relation Customers, a relation schema is:
Customers(firstName, lastName, idNo, account)
Exercise example database schema is:
Accounts (
acctNo, type, balance
)
Customers ( firstName, lastName, idNo, account
)
Exercise suitable domain for each attribute:
acctNo Integer type String balance Integer firstName String
lastName String
idNo String (because there is a hyphen Integer)
account Integer
we cannot use
Exercise equivalent way to present the Account relation:
acctNo 34567 23456 12345
balance 25 1000 12000 type savings checking savings Another equivalent way to present the Customers relation:
idNo 805-333 805-333 901-222
firstName Lena Lena Robbie lastName Hand Hand Banks account 23456 12345 12345 Exercise of attributes that are created for primarily serving as keys in a relation:
Universal Product Code (UPC) used widely in United States and Canada to track products in stores.
Serial Numbers on a wide variety of products to allow the manufacturer to individually track each product.
Vehicle Identification Numbers (VIN), a unique serial number used by the automotive industry to identify vehicles.
Exercise can order the three tuples in any of 3! = 6 ways. Also, the columns can be ordered in any of 3! = 6 ways. Thus, the number of presentations is 6*6 = 36.
Exercise can order the three tuples in any of 5! = 120 ways. Also, the columns can be ordered in any of 4! = 24 ways. Thus, the number of presentations is 120*24 = 2880
Exercise can order the three tuples in any of m! ways. Also, the columns can be ordered in any of n! ways. Thus, the number of presentations is n!m!
Exercise TABLE Product ( );
maker CHAR(30),
model CHAR(10) PRIMARY KEY, type CHAR(15)