Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

CREATE TABLE WheelspeedSensor(
  WheelspeedSensorID INT NOT NULL,
  Timestamp DATETIME NULL,
  RPM float NULL,
  PRIMARY KEY (WheelspeedSensorID));

Foreign key scripts

DriverRaces DriverID to

...

Driver DriverID 

  Alter TABLE DriverRaces
  ADD CONSTRAINT FK_DriversRacesID FOREIGN KEY (DriverID) REFERENCES Driver(DriverID);

DriverRaces RoundID to Rounds RoundNumber

Alter TABLE DriverRaces
  ADD CONSTRAINT FK_RoundDriverRaces FOREIGN KEY (RoundID) REFERENCES Rounds(RoundNumber);

DriverRaces RaceID to Race RaceID

Alter TABLE DriverRaces
ADD CONSTRAINT FK_RaceDriversID FOREIGN KEY (RaceID) REFERENCES Race(RaceID);

Tabs RaceID to Race RaceID

ALTER TABLE Tabs
ADD CONSTRAINT fk_TabsRaceID FOREIGN KEY (RaceID) REFERENCES Race(RaceID);

UserTabs UserID to User UserID

ALTER TABLE UserTabs
ADD CONSTRAINT fk_UserTabsID FOREIGN KEY (UserID) REFERENCES User(UserID);

Tab TabID to Graphs TabID

ALTER TABLE Tabs
ADD CONSTRAINT fk_GraphsTabID FOREIGN KEY (TabID) REFERENCES TabGraphs(TabID);

TabGraphs GraphID to Graphs GraphID

ALTER TABLE TabGraphs
ADD CONSTRAINT fk_TabGraphsID FOREIGN KEY (GraphID) REFERENCES Graphs(GraphID);

Graphs SensorID to Sensors SensorID

ALTER TABLE Graphs
ADD CONSTRAINT fk_GraphsSensorID FOREIGN KEY (SensorID) REFERENCES Sensors(SensorID);