Database Concepts
Class 12 · Computer Science · 12 Questions
Give the terms for each of the following:
Why foreign keys are allowed to have NULL values? Explain with an example.
Compared to a file system, how does a database management system avoid redundancy in data through a database?
What are the limitations of file system that can be overcome by a relational DBMS?
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:
Table: Sports Preferences
| Roll_no | Preference |
|---|---|
| 9 | Cricket |
| 13 | Football |
| 17 | Badminton |
| 17 | Football |
| 21 | Hockey |
| 24 | NULL |
| NULL | Kabaddi |
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) Table: Sports Preferences
| Roll_no | Sports |
|---|---|
| 9 | Cricket |
| 13 | Football |
| 17 | Badminton |
| 21 | Hockey |
| 24 | Cricket |
Sports preference of section 2 (arranged on 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 the relations equivalent? Justify.
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:
An organisation wants to create a database EMP-DEPENDENT to maintain following details about its employees and their dependent.
EMPLOYEE(AadharNumber, Name, Address, Department, EmployeeID) DEPENDENT(EmployeeID, DependentName, Relationship)
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.
School Uniform Database Attributes and Constraints UNIFORM: UCode (Primary Key), UName (Not Null), UColor COST: UCode (Composite Primary Key), Size (Composite Primary Key), Price (>0)
Table: UNIFORM
| UCode | UName | UColor |
|---|---|---|
| 1 | Shirt | White |
| 2 | Pant | Grey |
| 3 | Skirt | Grey |
| 4 | Tie | Blue |
| 5 | Socks | Blue |
| 6 | Belt | Blue |
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)
For the above given database STUDENT-PROJECT, answer the following:
Student Project Database Table: STUDENT
| Roll No | Name | Class | Section | Registration_ID |
|---|---|---|---|---|
| 11 | Mohan | XI | 1 | IP-101-15 |
| 12 | Sohan | XI | 2 | IP-104-15 |
| 21 | John | XII | 1 | CS-103-14 |
| 22 | Meena | XII | 2 | CS-101-14 |
| 23 | Juhi | XII | 2 | CS-101-10 |
Table: PROJECT
| ProjectNo | PName | SubmissionDate |
|---|---|---|
| 101 | Airline Database | 12/01/2018 |
| 102 | Library Database | 12/01/2018 |
| 103 | Employee Database | 15/01/2018 |
| 104 | Student Database | 12/01/2018 |
| 105 | Inventory Database | 15/01/2018 |
| 106 | Railway Database | 15/01/2018 |
For the above given database STUDENT-PROJECT, can we perform the following operations?