English

A school has a rule that each student must participate in a sports activity. So each one should give only one preference for sports activity. Suppose there are five students in a class

Advertisements
Advertisements

Question

A school has a rule that each student must participate in a sports activity. So each one should give only one preference for sports activity. Suppose there are five students in a class, each having a unique roll number. The class representative has prepared a list of sports preferences as shown below. Answer the following:

Sports Preferences
Roll_no Preference
9 Cricket
13 Football
17 Badminton
17 Football
21 Hockey
24 NULL
NULL Kabaddi
  1. Roll no 24 may not be interested in sports. Can a NULL value be assigned to that student’s preference field?
  2. Roll no 17 has given two preference sports. Which property of relational DBMC is violated here? Can we use any constraint or key in the relational DBMS to check against such violations, if any?
  3. Kabaddi was not chosen by any student. Is it possible to have this tuple in the Sports Preferences relation?
Short/Brief Note
Advertisements

Solution

  1. Yes, a NULL value can be assigned to that student's preference field.
  2. Property 2 is violated here because each row in a relation is distinct. The primary key can use to identify each row/record in a database table.
  3. No, it is not possible to have this tuple in the sports preferences relation because Roll_no is the primary key and the primary key does not allow NULL values.
shaalaa.com
Keys in a Relational Database
  Is there an error in this question or solution?
Chapter 8: Database Concepts - Exercise [Page 127]

APPEARS IN

NCERT Computer Science [English] Class 12
Chapter 8 Database Concepts
Exercise | Q 6. | Page 127
NCERT Informatics Practices [English] Class 11
Chapter 7 Database Concepts
Exercise | Q 6. | Page 139
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×