Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Trigger issues

Author  Topic 

TP143
Starting Member

1 Post

Posted - 2007-08-03 : 07:41:53
Hi,

I'm a newbie in database and begin to write some queries in MS SQL Server 2000. I have a homework with question:

Table: InventoryTransactions
a. TransactionID should be uniquely identify each record in the table
b. TransactionID should be auto generated
c. The Transaction date should not be greater than the current date
d. The Transaction date should be the current date if not entered
e. The Transaction date should be greater than the order date
f. Quantity Ordered, Quantity Received, and UnitPrice should be greater than 0
g. The Quantity Received cannot be greater than the quantity ordered.
h. Total Amount should be automatically calculated using the formula:
((Quantity Received * Unit Price of Item) + Freight Charge) and be stored in the Total Amount field.
i. The Shipment date should be updated to two days after the transaction date after the transaction is successfully completed.
j. The Quantity received should be added to the QoH in the Items table
k. When a record is inserted into the table, the QoH in the Items table should be updated automatically

I need your help to do these questions. I'm just start to learn SQL so don't laugh me

Thanks !

= - Free eBooks Portal: www.new4hack.com - =

nr
SQLTeam MVY

12543 Posts

Posted - 2007-08-04 : 21:42:09
Have a look at
identity
check constraint
trigger


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -