Q.For the above given database STUDENT-PROJECT, can we perform the following operations? (Refers to the Student Project Database printed with Question 12: Table STUDENT (Roll No, Name, Class, Section, Registration_ID), Table PROJECT (ProjectNo, PName, SubmissionDate) and Table PROJECT ASSIGNED (Registration_ID, ProjectNo).)
You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.
Start your 14-day free trial to unlock the full solution →Whether an INSERT succeeds depends on the constraints on the columns involved: a primary key can never be NULL (entity integrity), an ordinary non-key column can be NULL, and a foreign key accepts only values that already exist in the parent table (referential integrity).
So: (a) No,
(b) Yes — unless Registration_ID was declared NOT NULL,
(c) Yes,
(d) No.
a) Insert a student record with a missing roll number — NOT possible.
RollNo is the primary key of STUDENT. The entity-integrity rule says a primary key must be unique and NOT NULL in every row, so the DBMS refuses:
INSERT INTO STUDENT (Name, Class, Section, Registration_ID)
VALUES ('Aman', 'XI', 1, 'IP-108-15');
ERROR 1364 (HY000): Field 'RollNo' doesn't have a default value
(Passing NULL explicitly gives ERROR 1048 (23000): Column 'RollNo' cannot be null.) Without a roll number the row has no identity — the DBMS could never tell this student apart.
b) Insert a student record with a missing registration number — possible (with a caveat).
Registration_ID is not the primary key, so entity integrity does not forbid a NULL here. With the schema as the book presents it (only RollNo declared as key), this succeeds:
INSERT INTO STUDENT (RollNo, Name, Class, Section)
VALUES (13, 'Aman', 'XI', 1);
Query OK, 1 row affected
Two things to note honestly: such a student can never appear in PROJECT-ASSIGNED (there is no registration ID to link on), and if the designer had declared the alternate key properly as UNIQUE NOT NULL, this insert would be rejected. The textbook-level answer is: yes, the operation is allowed because Registration_ID is not the primary key.
c) Insert a project detail without a submission date — possible.
SubmissionDate is an ordinary non-key attribute; NULL simply means "not decided yet":
INSERT INTO PROJECT (ProjectNo, PName)
VALUES (107, 'Hospital Database');
Query OK, 1 row affected
d) Insert (IP-101-19, 206) into PROJECT-ASSIGNED — NOT possible. …
Unlock everything free for 14 days
- Full step-by-step solutions
- Concept-first explanations
- Methods, shortcuts & mistakes
- PYQ mapping + timed mock tests
Full access for 14 days. No credit card required.