|
aidmondo
Starting Member
Ghana
23 Posts |
Posted - 05/18/2012 : 08:44:09
|
Create table Events( EventID int Primary Key Identity, EventName Varchar(30) not null, StartDate datetime not null, EndDate datetime not null, NoOfPeople int not null )
Create table EventType( EventTypeID int Primary Key, Description Varchar(50) ChargePerPerson money )
Create table Payments( PaymentID int Primary Key, EventID int Foreign Key References Events(EventID), PaymentDate datetime not null, PaymentAmount )
Now the following validations are to be performed on the Payments Table. 1. Payment date should be less than or equal to the StartDate of the Event.(StartDate in the Events table) 2. PaymentAmount = ChargePerPerson * NoOfPeople (chargePerPerson in EventType table and NoOfPeople in Events table)
Can this be done in the course of creating the tables? If yes help.
aidmondo |
|