(a) To determine the degree and cardinality of the table PHARMA, we need to understand these concepts:
Degree refers to the number of attributes (columns) in a table. In this case, the table PHARMA has 5 columns: MID, MNAME, PRICE, UNITS, and EXPIRY. Therefore, the degree of the table is 5.
Cardinality refers to the number of rows (records) in the table. Looking at the provided table, there are 6 medicines listed, so the cardinality is 6.
(b) The attribute best suitable to be declared as a primary key is MID. A primary key uniquely identifies each record in a table. MID is unique for each medicine, hence it can serve as an appropriate primary key.
(c) To add a new medicine into the PHARMA table without a value for UNITS, we should use the following SQL command:
INSERT INTO PHARMA (MID, MNAME, PRICE, EXPIRY) VALUES ('M7', 'SUCRALFATE', 17, '2022-03-20');
This command inserts a new row with the given MID, MNAME, PRICE, and EXPIRY, omitting the UNITS column.
(d) To change the name of the attribute UNITS to QUANTITY, Anmol will use the ALTER TABLE command. The correct choice is:
(iv) ALTER TABLE
(e) To increase the PRICE of all medicines by 5, Anmol will use the UPDATE command. The correct command and choice is:
(i) UPDATE SET
The SQL command would be:
UPDATE PHARMA SET PRICE = PRICE + 5;
This command updates the table PHARMA by increasing the PRICE of each medicine by 5.