हिंदी

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

प्रश्न

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?
टिप्पणी लिखिए
Advertisements

उत्तर

  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
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 8: Database Concepts - Exercise [पृष्ठ १२७]

APPEARS IN

एनसीईआरटी Computer Science [English] Class 12
अध्याय 8 Database Concepts
Exercise | Q 6. | पृष्ठ १२७
एनसीईआरटी Informatics Practices [English] Class 11
अध्याय 7 Database Concepts
Exercise | Q 6. | पृष्ठ १३९
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×