Page 301 - Information_Practice_Fliipbook_Class11
P. 301
c. Kabaddi was not chosen by any student. Is it possible to have this tuple in the Sports Preferences relation?
Ans. a. It cannot be assigned a NULL value because, according to school rules, every student is required to participate in a sports activity.
b. Because it violates the primary key constraint. Roll no. 17 cannot give two preferences. Every student has a unique roll number. We
can use the primary key constraint to check for such violations.
c. This is not possible because the roll number field cannot be NULL.
6. What are the limitations of file system that can be overcome by a relational DBMS?
Ans. Difficulty in Access
a. Data Redundancy
b. Data Inconsistency
c. Data Isolation
d. Data Dependence
e. Controlled Data Sharing
7. In another class having two sections, the two respective class representatives have prepared two separate Sports Preferences tables, as
shown below:
Sports preference of section 1 (arranged in the roll number column)
Table: Sports Preferences
Roll_no Sports
9 Cricket
13 Football
17 Badminton
21 Hockey
24 Cricket
Sports preference of section 2 (arranged in Sports name column, and column order is also different)
Table: Sports Preferences
Sports Roll_no
Badminton 17
Cricket 9
Cricket 24
Football 13
Hockey 21
Are the states of both tables equivalent? Justify.
Ans. The states of both tables are equivalent despite the differences in their organization. In the relational model, the order of rows
and columns does not affect the equivalence of tables. What matters is the content of the tables and whether they represent the
same information. Despite the differences in column order and row arrangement, the information represented in both tables is
the same—each table conveys the sports preferences of students in their respective sections. Therefore, the states of both tables
are equivalent.
8. The school canteen wants to maintain records of items available in the school canteen and generate bills when students purchase any
item from the canteen. The school wants to create a canteen database to keep track of items in the canteen and the items purchased by
students. Design a database by answering the following questions:
a. To store each item name along with its price, what relation should be used? Decide on appropriate attribute names along with their
data type. Each item and its price should be stored only once. What restriction should be used while defining the relation?
b. In order to generate the bill, we should know the quantity of an item purchased. Should this information be in a new relation or a part
of the previous relation? If a new relation is required, decide the appropriate name and data type for attributes. Also, identify the
appropriate primary key and foreign key so that the following two restrictions are satisfied:
i. The same bill cannot be generated for different orders.
ii. Bills can be generated only for available items in the canteen.
c. The school wants to find out how many calories students consume when they order an item. In which relation should the attribute
‘calories’ be stored?
Ans. a. Item relation, which stores information about the food item’s name and price.
Item (ItemId, ItemName, Price)
Database Concepts and the Structured Query Language 287

