English

The school has asked their estate manager Mr Rahul to maintain the data of all the labs in a table LAB. Rahul has created a table and entered data from 5 labs.

Advertisements
Advertisements

Question

The school has asked their estate manager Mr Rahul to maintain the data of all the labs in a table LAB. Rahul has created a table and entered data from 5 labs.

LAB NO LAB_NAME INCNCHARGE CAPACITY FLOOR
L001 CHEMISTRY Daisy 20 I
L002 BIOLOGY Venky 20 II
L003 MATH Preeti 15 I
L004 LANGUAGE Daisy 36 III
L005 COMPUTER Mary 37 II

Based on the data given above answer the following questions:

(i) Identify the columns which can be considered as Candidate keys.

(ii) Write the degree and cardinality of the table.

(iii) Write the statements to:

      (a) Insert a new row with appropriate data.

      (b) Increase the capacity of all the labs by 10 students which are on
           the 'I' Floor.

                                     OR

(iii) Write the statements to:

        (a) Add a constraints PRIMARY KEY to the column LABNO in the table.

        (b) Delete the table LAB.

Short Answer
Advertisements

Solution

(i) Candidate key: LABNO

(ii) Degree: 5, Cardinality: 5

(iii)

  1. Insert into LAB values("L006", "Physics", "John", 40, "III");
  2. Update LAB set capacity = capacity + 10 where Floor = "I";

                          OR
(iii)

  1. Alter table LAB ADD Primary Key(LABNO);
  2. Drop table LAB;
shaalaa.com
Keys in a Relational Database
  Is there an error in this question or solution?
2022-2023 (March) Set 4
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×