Chapter 7: Database Concept Solution

1. Give the terms for each of the following:
a) Collection of logically related records.
b) DBMS creates a file that contains description about the data stored in the database.
c) Attribute that can uniquely identify tuples in a relation
d) Special value that is stored when actual data value is unknown for an attribute.
e) An attribute which can uniquely identify tuples of the table but is not defined as primary key of the table.
f) Software that is used to create, manipulate and maintain a relational database.

2. Why foreign keys are allowed to have NULL values? Explain with an example.

3. Differentiate between:
(i) Database state and database schema
(ii) Primary key and foreign key
(iii) Degree and cardinality of a relation

4. Compared a file system, how does a database management system avoid redundancy in data through a database?

5. What are the limitations of file system that can be overcome by a relational DBMS?

6. A school has a rule that each student must participate in a sports activity. So each one should give only one performance for sport 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:

a) Roll no 24 may not be interested in sports. Can a NULL value be assigned to that student’s preferences field?
b) Roll no 17 has given two preferences sports. Which property of relational DBMS is violated here? Can we use any constraint or key in the relational DBMS to check against such violation, if any?
c) Kabaddi was not chosen by any student. Is it possible to have this tuple in the Sports Preferences relation?

7. In another class having 2 sections, the two respective class representatives have prepared 2 separate Sports Preferences tables, as shown below:
Sports preference of section 1 (arranged on roll number column)

Sports preference of section 2 (arranged on Sports name column, and column order is also different)

Are the states of both the relations equivalent?

Yes, the states of both the relations are equivalent because current state of both the relations is 5 and structure of both the relations is also same.

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 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 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 appropriate name and data type for attributes. Also, identify appropriate primary key and foreign key so that the following two restrictions are satisfied:     
(i) Bill can be generated only for available items in the canteen.
(ii) The same bill cannot be generated for different orders.

c) The school wants to find out how many calories students intake when they order an item. In which relation should the attribute ‘calories’ be stored?

9. An organization wants to create a database EMPDEPENDENT to maintain following details about its employees and their dependent.
EMPLOYEE (AadharNumber, Name, Address, Department, EmployeeID)
DEPENDENT (EmployeeID, DependentName, Relationship)

a) Name the attributes of EMPLOYEE, which can be used as candidate keys.
b) The company wants to retrieve details of dependent of a particular employee. Name the tables and the key which are required to retrieve this detail.
c) What is the degree of EMPLOYEE and DEPENDENT relation?

10. School uniform is available at M/s Sheetal Private Limited. They have maintained SCHOOL_UNIFORM Database with two relations viz. UNIFORM and COST. The following figure shows database schema and its state.

(a) Can they insert the following tuples to the UNIFORM Relation? Give reasons in support of your answer.
(i) 7, Handkerchief, NULL
(ii) 4, Ribbon, Red
(iii) 8, NULL, White
(b) Can they insert the following tuples to the COST Relation? Give reasons in support of your answer.
(i) 7, S, 0
(ii) 9, XL, 100

11. In a multiplex, movies are screened in different auditoriums. One movie can be shown in more than one auditorium. In order to maintain the record of movies, the multiplex maintains a relational database consisting of two relations viz. MOVIE and AUDI respectively as shown below:
Movie(Movie_ID, MovieName, ReleaseDate)
Audi(AudiNo, Movie_ID, Seats, ScreenType, TicketPrice)

a) Is it correct to assign Movie_ID as the primary key in the MOVIE relation? If no, then suggest an appropriate primary key.
Ans: Yes
b) Is it correct to assign AudiNo as the primary key in the AUDI relation? If no, then suggest appropriate primary key.
Ans: Yes
c) Is there any foreign key in any of these relations?
Ans: Yes Movie_ID in Audi relation is Foreign key.

12. For the given database STUDENT-PROJECT, answer the following:

a) Name primary key of each table.
b) Find foreign key(s) in table PROJECT-ASSIGNED.
c) Is there any alternate key in table STUDENT? Give justification for your answer.
d) Can a user assign duplicate value to the field RollNo of STUDENT table? Justify.

(13) For the above given database STUDENT-PROJECT, can we perform the following operations?
(a) Insert a student record with missing roll number value.
Ans: Yes
(b) Insert a student record with missing registration number value.
Ans: No
(c) Insert a project detail without submission-date.
Ans: Yes
(d) Insert a record with registration ID IP-101-19 and ProjectNo 206 in table PROJECT-ASSIGNED.
Ans: No

Leave a Reply

Your email address will not be published. Required fields are marked *

error: Content is protected !!