Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assignment No: 04 SQL Commands Task No.1: Write a database description for each of the relations shown, using SQL DDL (shorten, abbreviate, or change
Assignment No: 04 SQL Commands Task No.1: Write a database description for each of the relations shown, using SQL DDL (shorten, abbreviate, or change any data names, as needed for your SQL version). Assume the following attribute data types: StudentID (integer, primary key) StudentName (25 characters) FacultyID (integer, primary key) Faculty Name (25 characters) CourseID (8 characters, primary key) CourseName (15 characters) DateQualified (date) Section No (integer, primary key) Semester (7 characters) STUDENT (StudentID, StudentName) QUALIFIED (FacultyID, CourseID, DateQualified) StudentID StudentName 38214 54907 Letersky Altvater 66324 70542 Aiken Marra FACULTY (FacultyID, FacultyName) FacultyID 2143 Birkin 3467 Berndt 4756 Collins FacultyID CourseID DateQualified 2143 ISM 3112 9/1988 2143 ISM 3113 9/1988 3467 ISM 4212 9/1995 3467 ISM 4930 9/1996 4756 ISM 3113 9/1991 4756 ISM 3112 9/1991 SECTION (Section No, Semester, CourseID) FacultyName SectionNo Semester CourseID 2712 2713 2714 2715 1-2008 I-2008 1-2008 1-2008 ISM 3113 ISM 3113 ISM 4212 ISM 4930 COURSE (CourseID, CourseName) REGISTRATION (StudentID, Section No, Semester) CourseID CourseName StudentID Section No Semester ISM 3113 Syst Analysis 38214 2714 ISM 3112 Syst Design 54907 2714 1-2008 1-2008 ISM 4212 Database 54907 2715 1-2008 ISM 4930 Networking 66324 2713 1-2008 Task 2: Because of referential integrity, before any row can be entered into the SECTION table, the CourseID to be entered must already exist in the COURSE table. Write an SQL assertion that will enforce this constraint. Task 3: Write SQL data definition commands for each of the following queries: a. How would you add an attribute, Class, to the Student table? b. How would you remove the Registration table? c. How would you change the Faculty Name field from 25 characters to 40 characters? Task 4: Write SQL commands for the following: a. Create two different forms of the INSERT command to add a student with a student ID of 65798 and last name Lopez to the Student table. b. Now write a command that will remove Lopez from the Student table. c. Create an SQL command that will modify the name ofcourse ISM 4212 from Database to Introduction to Relational Databases.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started