Question: Execute the SQL statement at the beginning of Exercise 7 . 1 4 to reset the two tables and their relationship before this exercise. IF
Execute the SQL statement at the beginning of Exercise to reset the two tables and their relationship before this exercise.
IF OBJECTIDNChapterExercise.Courses' IS NOT NULL
DROP TABLE ChapterExercise.Courses;
IF OBJECTIDNChapterExercise.Instructors' IS NOT NULL
DROP TABLE ChapterExercise.Instructors;
CREATE TABLE ChapterExercise.Instructors
InstructorId INT IDENTITY,
InstructorName NVARCHAR NOT NULL,
Office NVARCHAR NULL,
CONSTRAINT pkInstructors PRIMARY KEYInstructorId
;
CREATE TABLE ChapterExercise.Courses
CourseId INT IDENTITY,
CourseNumber NVARCHAR NOT NULL,
CourseTitle NVARCHAR NULL,
InstructorId INT NULL,
CONSTRAINT pkCourses PRIMARY KEYCourseId
CONSTRAINT fkCoursesInstructors
FOREIGN KEY InstructorId
REFERENCES ChapterExcercise.InstructorsInstructorId
;
SET IDENTITYINSERT ChapterExercise.Instructors ON;
CourseNumber CourseTitle, InstructorId
VALES
'Ralph Moore', 'Tiger ;
SET IDENTITYINSERT ChapterExcercise.Instructors OFF;
INSERT INTO ChapterExercise.Courses
CourseNumberCourseTitle, InstructorId
VALUES
CS 'Instroduction to Database', ;
CourseNumber CourseTitle, InstructorId
VALUES
CS 'Advanced TSQL;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
