For the above given database STUDENT-PROJECT, can we perform the following operations?
Table: PROJECT
| ProjectNo | PName | SubmissionDate |
|---|---|---|
| 101 | Airline Database | 12/01/2018 |
| 102 | Library Database | 12/01/2018 |
| 103 | Employee Database | 15/01/2018 |
| 104 | Student Database | 12/01/2018 |
| 105 | Inventory Database | 15/01/2018 |
| 106 | Railway Database | 15/01/2018 |
Table: PROJECT ASSIGNED
| Registration_ID | ProjectNo |
|---|---|
| IP-101-15 | 101 |
| IP-104-15 | 103 |
| CS-103-14 | 102 |
| CS-101-14 | 105 |
| CS-101-10 | 104 |
Table: STUDENT
| Roll No | Name | Class | Section | Registration_ID |
|---|---|---|---|---|
| 11 | Mohan | XI | 1 | IP-101-15 |
| 12 | Sohan | XI | 2 | IP-104-15 |
| 21 | John | XII | 1 | CS-103-14 |
| 22 | Meena | XII | 2 | CS-101-14 |
| 23 | Juhi | XII | 2 | CS-101-10 |
- Insert a student record with missing roll number value.
- Insert a student record with missing registration number value.
- Insert a project detail without submission-date.
- Insert a record with registration ID IP-101-19 and ProjectNo 206 in table PROJECT-ASSIGNED.
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 →This question tests understanding of referential integrity and NULL constraints in a relational database — whether foreign keys and primary keys permit missing or invalid values.
Understanding the Schema Constraints
Before we can answer what operations are allowed, we need to infer the logical constraints from the given tables. While the question doesn't explicitly state PRIMARY KEY or FOREIGN KEY declarations, the structure and data reveal them:
STUDENT table:
Roll Noappears to be the primary key (unique identifier for each student)Registration_IDis a unique identifier (each student has exactly one; it links to PROJECT_ASSIGNED)
PROJECT table:
ProjectNois the primary key (unique identifier for each project)
PROJECT_ASSIGNED table:
- This is a junction/linking table connecting students to projects
Registration_IDis a foreign key referencing STUDENTProjectNois a foreign key referencing PROJECT- Together they likely form a composite primary key (one student can be assigned one project)
Now let's examine each operation:
(a) Insert a student record with missing roll number value
Can we do this? No.
Roll No is the primary key of the STUDENT table. A primary key has two fundamental properties:
- Uniqueness — no two rows can have the same value
- NOT NULL — every row must have a value
A missing (NULL) roll number violates the second property. The database will reject this insertion with a constraint violation error.
-- This will FAIL
INSERT INTO STUDENT (Roll_No, Name, Class, Section, Registration_ID)
VALUES (NULL, 'Rahul', 'XI', '1', 'IP-102-15');
-- Error: PRIMARY KEY constraint violation - NULL not allowed
Primary keys cannot be NULL. This is a fundamental rule in relational databases — the primary key must uniquely identify every row, and NULL means "unknown," which cannot serve as an identifier.
(b) Insert a student record with missing registration number value
Can we do this? It depends on the constraint definition, but most likely No.
Looking at the data, every student has a Registration_ID, and PROJECT_ASSIGNED uses it as a foreign key. This suggests two possible scenarios:
Scenario 1: Registration_ID is defined as UNIQUE NOT NULL
- The insertion would fail because NULL violates the NOT NULL constraint
Scenario 2: Registration_ID allows NULL but is UNIQUE
- The insertion would succeed — the student exists but hasn't been assigned a project yet
However, given that Registration_ID appears to be a student identifier (like an enrollment number) rather than just a link to projects, it's most likely defined as NOT NULL. A student without a registration ID doesn't make practical sense in an academic system.
-- This will likely FAIL
INSERT INTO STUDENT (Roll_No, Name, Class, Section, Registration_ID)
VALUES (13, 'Rahul', 'XI', '1', NULL);
-- Error: NOT NULL constraint violation (if Registration_ID is NOT NULL)
Most probable answer: No — the registration ID is a required attribute.
(c) Insert a project detail without submission-date
Can we do this? Yes, most likely.
SubmissionDate is not the primary key of PROJECT (that's ProjectNo). Unless explicitly defined with a NOT NULL constraint, regular columns in SQL can accept NULL values.
A NULL submission date could represent:
- A project that hasn't been submitted yet
- A project with an unknown/unrecorded submission date
-- This will likely SUCCEED
INSERT INTO PROJECT (ProjectNo, PName, SubmissionDate)
VALUES (107, 'Hospital Database', NULL);
-- Success: NULL is allowed in non-key columns unless explicitly restricted
In real-world database design, whether SubmissionDate should allow NULL depends on business rules. If every project must have a submission date, the column should be defined as NOT NULL. But without that explicit constraint, NULL is permitted.
(d) Insert a record with registration ID IP-101-19 and ProjectNo 206 in table PROJECT_ASSIGNED
Can we do this? No.
PROJECT_ASSIGNED has two foreign key constraints: …
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.