2 Replies - 405 Views - Last Post: 23 June 2017 - 07:04 AM Rate Topic: -----

#1 program94  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 42
  • Joined: 19-April 14

Referential Integrity Constraints Help SQL

Posted 22 June 2017 - 09:35 PM

Constraints Table
CREATE TABLE OFFERING
(
OfferNo INTEGER, CourseNo INTEGER, OfferTerm CHAR (20), OfferYear INTEGER, OfferLocation CHAR (20), OfferTime TIME, OfferDays CHAR (20), FacSSN INTEGER
FOREIGN KEY (FacSSN) REFERENCES FACULTY(FacSSN); //ERROR IN THIS LINE
)

What am I doing wrong? Its giving me an error

This post has been edited by program94: 22 June 2017 - 09:42 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Referential Integrity Constraints Help SQL

#2 andrewsw  Icon User is online

  • the case is sol-ved
  • member icon

Reputation: 6379
  • View blog
  • Posts: 25,770
  • Joined: 12-December 12

Re: Referential Integrity Constraints Help SQL

Posted 22 June 2017 - 10:43 PM

What error?
Was This Post Helpful? 0
  • +
  • -

#3 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon


Reputation: 6979
  • View blog
  • Posts: 14,602
  • Joined: 16-October 07

Re: Referential Integrity Constraints Help SQL

Posted 23 June 2017 - 07:04 AM

Remove the semi colon?

Also, FacSSN should be the primary key of FACULTY. Considering you haven't yet defined a primary key for OFFERING, this could also be an issue. Note also that NOT NULL is not implicit and you may want to define it on some of those columns.

Hope this helps.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1