LIVE Course for free

Rated by 1 million+ students
Get app now
JEE MAIN 2024
JEE MAIN 2025 Foundation Course
NEET 2024 Crash Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
251 views
in Programming by (48.2k points)
closed by

Given the following statements:

S1: A foreign key declaration can always be replaced by an equivalent check assertion in SQL.

S2: Given the table R (a, b, c) where a and b together form the primary key, the following is a valid table definition.

CREATE TABLE S (

                a INTEGER,

                d INTEGER,

                e INTEGER,

                PRIMARY KEY (d)

                FOREIGN KEY (a) references R)

Which one of the following statements is CORRECT?
1. S1 is TRUE and S2 is FALSE
2. BOTH S1 and S2 are TRUE
3. S1 is FALSE and S2 is TRUE
4. BOTH S1 and S2 are FALSE

1 Answer

0 votes
by (41.0k points)
selected by
 
Best answer
Correct Answer - Option 4 : BOTH S1 and S2 are FALSE

Concept:

A foreign key in one table should uniquely identify an entire row of another table correctly. Check insertion do not always ensure sufficient-ness for replacing the foreign key.

Explanation:

S1 is false, as in our case foreign key declaration may have cascade delete which is not possible to ensure by just using check insertion.

S2 is false because in above table definition, table S has a foreign key that refers to field a of R. The field a is table S does not uniquely identify a row in table R.

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...