The following points should be observed and discussed. Do this with SQL: Below i
ID: 3794780 • Letter: T
Question
The following points should be observed and discussed. Do this with SQL:
Below is a picture of the full problem as well as a diagram of the tables we're working with for this assignment. Please provide working SQL code to answer each part.
3. The following points should be observed and discussed. Do this with SQL (a) Do the following two problems: (1) Create an index with UNIQUE option on JNAME of PROJECT table. Show that you successfully created the index by appropriately interrogating system catalog. (2) This time try to create an index with UNIQUE option on PNAME of PART table. Are you successful in this attempt? (b) Insert in SPJ table the following values: (S5, P6, J9, NULL). What do you find and why?Explanation / Answer
(a)
CREATE UNIQUE INDEX jIndex
ON PROJECT (JNAME)
On trying to create UNIQUE INDEX on PNAME of PART table, it returns error,
because there are duplicate entries in the PNAME column of PART table. (Screw name appears twice)
(b)
Inserting in SPJ table will again fail, because JNO is the foreign key which refers to PROJECT table.
since J9 is not present there, it will not succeed.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.