referential integrity

Results 1 to 2 of 2

Thread: referential integrity

  1. #1
    Join Date
    Dec 1969

    Default referential integrity

    &nbsp;<BR>i have 2 tables<BR><BR>CREATE TABLE Customers (<BR>CustomerID COUNTER,<BR>LastName VARCHAR(50),<BR>FirstName VARCHAR(50)<BR>)<BR><BR>CREATE TABLE Orders (<BR>OrderID COUNTER,<BR>CustomerID INTEGER CONSTRAINT REFERENCES Customers<BR>(CustomerID),<BR>ProductID INTEGER,<BR>ProductName VARCHAR(50),<BR>Price CURRENCY<BR>)<BR><BR>how do get the CustomerID to match up in the two tables when i insert into<BR>Orders? thanx.<BR>

  2. #2
    Join Date
    Dec 1969

    Default How do you recognize the customer..

    ..when placing the order the customer must be giving his customer ID or something, how do u find out who the customer is whose order you are taking ? Or may be you check with the last name, whatever it is.<BR><BR>Write a query to get the customer Id from table one and then insert the same in table 2 while placing the order.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts