问题描述:

I am trying to insert a row into a table while having the FK field reference the PK field in the related table, but it does not compile. this is what i have so far.

Insert into Location(LocNo, FacNo, LocName)

values('L120', 'F111','Door');

The FacNo needs to relate to the PK facNo in the Facility table, so i have made the FacNo here the same, but when i try and run this it does not compile. What am i doing wrong?

  1. Insert a new row into the Facility table with facility name Swimming Pool.
  2. Insert a new row in the Location table related to the Facility row in modification problem 1. The new row should have Door for the

    location name.

I have already done question one, but i am having trouble with the second question.

相关阅读:
Top