Skip to content
Exercises · Q13
Q.

For the above given database STUDENT-PROJECT, can we perform the following operations?

Table: PROJECT

ProjectNoPNameSubmissionDate
101Airline Database12/01/2018
102Library Database12/01/2018
103Employee Database15/01/2018
104Student Database12/01/2018
105Inventory Database15/01/2018
106Railway Database15/01/2018

Table: PROJECT ASSIGNED

Registration_IDProjectNo
IP-101-15101
IP-104-15103
CS-103-14102
CS-101-14105
CS-101-10104

Table: STUDENT

Roll NoNameClassSectionRegistration_ID
11MohanXI1IP-101-15
12SohanXI2IP-104-15
21JohnXII1CS-103-14
22MeenaXII2CS-101-14
23JuhiXII2CS-101-10
  1. Insert a student record with missing roll number value.
  2. Insert a student record with missing registration number value.
  3. Insert a project detail without submission-date.
  4. Insert a record with registration ID IP-101-19 and ProjectNo 206 in table PROJECT-ASSIGNED.
Uttarakhand UbseTextbookSubjective· 4mImportance★★★★★
48% · 14/29 Questions
🔒 Locked · start free trial →

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 No appears to be the primary key (unique identifier for each student)
  • Registration_ID is a unique identifier (each student has exactly one; it links to PROJECT_ASSIGNED)

PROJECT table:

  • ProjectNo is the primary key (unique identifier for each project)

PROJECT_ASSIGNED table:

  • This is a junction/linking table connecting students to projects
  • Registration_ID is a foreign key referencing STUDENT
  • ProjectNo is 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:

  1. Uniqueness — no two rows can have the same value
  2. 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
Watch out

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
Note

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.