Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. What happens when you try to delete the following records from the COURSE tab

ID: 3563843 • Letter: 1

Question

1. What happens when you try to delete the following records from the COURSE table.

2. Specify whether the following records can be added to the GRADE table:

Justify your answer in each case:

3. Explain when you try to delete the folowing records from the STUDENT table.

COURSE_NO COURSE_NAME DEPT_CODE CREDITS CS120 Algorithms CS 3 CS100 Data Structures CS 3 1. What happens when you try to delete the following records from the COURSE table. COURSE_NO COURSE_NAME DEPT_CODE CREDITS CS120 Algorithms CS 3 CS100 Data Structures CS 3 2. Specify whether the following records can be added to the GRADE table: Justify your answer in each case: COURSE_NO STUDENT_ID GRADE CS220 900-90-9000 B CS100 B CS100 980-70-5879 B MA220 967-54-7112 B CS230 660-80-5497 B 3. Explain when you try to delete the folowing records from the STUDENT table. STUDENT_ID STUDENT_LNAME STUDENT_FNAME MAJOR 150-70-5879 Jones Ray CS 280-90-8766 Lee Mae CS

Explanation / Answer

Answer for (1) question :

Answer for (2) question :

CS220   900-90-9000   B
It can added into Grade table because course no,student id and grade are valid values and these are available in master table respectively.

CS100 B
It cannot be added because even though course no is valie but student id is null and i am assuming student id column as not null column. if this is the case
we cannot add this row.it will through exception if proper constraints(pk and fk) implemented in all tables.

CS100   980-70-5879   B
It cannot be added because student id is not valid which is not available in student master table. it will through exception if proper constraints(pk and fk) implemented in all tables.

MA220   967-54-7112   B
It can added into Grade table because course no,student id and grade are valid values and these are available in master table respectively.

CS230   660-80-5497   B
It cannot be added because course no is not valid which is not available in course master table. it will through exception if proper constraints(pk and fk) implemented in all tables.

Answer for (3) question :

150-70-5879 Jones Ray CS
it will give primary key and foriegn key error message... because this student is referred in Grade table. so it cannot be deleted because it is parent record if you want to delete this record before that we need to delete all references (child table) needs to deleted first then we can delete this records this scenario it cannot be deleted.

280-90-8766 Lee Mae CS
it will give primary key and foriegn key error message... because this student is referred in Grade table. so it cannot be deleted because it is parent record if you want to delete this record before that we need to delete all references (child table) needs to deleted first then we can delete this records his scenario it cannot be deleted.