Customers
|
UserID
|
Int
|
Primary Key
|
Name
|
VarChar(50)
|
|
State
|
Char(2)
|
|
|
|
StockOrders
|
UserId
|
Integer
|
Foreign Key References Customers
|
StockId
|
Integer
|
Foreign Key references Stocks
|
Day
|
Date
|
Foreign Key references Stockprices(Day)
|
Price
|
Numeric(10,2)
|
> 0.0
|
Shares
|
Integer
|
> 0
|
Commission
|
Numeric(10,2)
|
Not Null
|
Total
|
Numeric(10,2)
|
= Price * Shares + Commission
|
Flag
|
Char
|
Must be 'b' or 's'
|
|