Advertisements
Advertisements
प्रश्न
| An electronic gadget shop keeps records of its electronic products, such as mobile phones, laptops, etc., in a table named Gadgets, which has columns for ItemID (Primary key), ItemType (mobile, iPad, Laptop), Size, Quantity, Price and Supplier. It also stores the billing data in another table named Bill, which has columns as BillNo (Primary key), ItemID, Price, CustName and CustPhoneNo. |
Based on the above, answer the following questions:
- Name any two columns of the Gadgets table where duplicate values are allowed.
- Assume that the table Gadgets already contains a product having value of ItemID as I001. Can we enter a new record with value of ItemID as I001? Justify.
- Is it possible to store photos of the products in a new column of the table, Gadgets? If yes, then suggest a suitable data type to store images.
- Briefly explain the principle of referential integrity with respect to the tables, Gadgets and Bill.
सविस्तर उत्तर
Advertisements
उत्तर
- Any two columns except the Primary Key (
ItemID) can have duplicates.
Example:ItemTypeandSupplier -
No, Justification:
ItemIDis the Primary Key of theGadgetstable. Primary keys must contain unique values to uniquely identify each record; duplicate values are strictly prohibited. - Yes, Suitable Data Type:
BLOB(Binary Large Object) orLONGBLOB. -
Referential integrity ensures consistency between the two tables using the Foreign Key (
ItemIDin theBilltable). It ensures that:- A
Billcannot be created for anItemIDthat does not exist in theGadgetstable. - An
ItemIDcannot be deleted from theGadgetstable if it is linked to records in theBilltable.
- A
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
