Which datatype would you use to store the following information? Give reason for your decision.
1. Product-title like trousers up to 50 characters:
2. Product-description up to 255 characters:
3. Stock amount:
4. Price of each piece:
FLOAT(6,2) or DECIMAL(6,2)
Prices have floating point
The length of (6,2) should be sufficient enough as trousers are usually within a price ranger of 0.99 to 9999.99.
5. Order date:
DATE or DATETIME
The type depends on whether we want to safe only the date, but also the time.
Usually in such cases to store only the order-date is enough.
6. Date of delivery:
7. organic or not:
8. Usage category with only one character:
CHAR
As long as there is only one character to be stored the CHAR-type will work.
Technically the CHAR-types allows all letters, digits (as letters) and special characters.