Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

( CREATE TABLE Class ( ClassID INTEGER PRIMARY KEY, Section TEXT, Time TEXT, CourseCode TEXT, ProfessorID INTEGER, RoomID INTEGER, SemesterID INTEGER, FOREIGN KEY ( CourseCode

(CREATE TABLE Class (
ClassID INTEGER PRIMARY KEY,
Section TEXT,
Time TEXT,
CourseCode TEXT,
ProfessorID INTEGER,
RoomID INTEGER,
SemesterID INTEGER,
FOREIGN KEY (
CourseCode
)
REFERENCES Course (CourseCode),
FOREIGN KEY (
ProfessorID
)
REFERENCES Professor (ProfessorID),
FOREIGN KEY (
RoomID
)
REFERENCES Room (RoomID),
FOREIGN KEY (
SemesterID
)
REFERENCES Semester (SemesterID)
); ) for this DDL i am trying to insert (INSERT INTO Class (ClassID, Section, Time, CourseCode, ProfessorID, RoomID, SemesterID) VALUES
(1,'A','09:00-11:00','AC102',5,1,7),
(2,'B','11:00-13:00','MS103',8,2,3),
(3,'A','10:00-12:00','CS201',11,3,7),
(4,'B','12:00-14:00','TD202',14,4,7),
(5,'A','09:00-11:00','SA203',6,6,7),
(6,'B','11:00-13:00','BN301',1,7,7),
(7,'A','10:00-12:00','DA302',11,8,7),
(8,'B','12:00-14:00','SE401',14,9,5),
(9,'A','09:00-11:00','MN405',6,7,7),
(10,'A','10:00-12:00','CM401',6,8,2),
(11,'B','12:00-14:00', 'Cal402',8,9,3),
(12,'A','09:00-11:00','OC403',6,6,7);) this data i am getting error [21:19:23] Error while executing SQL query on database 'MIT221566_MITUni': FOREIGN KEY constraint failed Please help with the error

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions