Question

3. Activity to Create a Product Table in MySQL with Data Types

Write the SQL to create a Product table with the following columns:

• ID - Integer with range 0 to 65,535

• Name - Variable-length string with maximum 40 characters

ProductType - Fixed-length string with 3 characters

OriginDateTime - Year, month, day, and time

•

• Weight - Decimal number with variable precision and 4 bytes of storage

Place your CREATE TABLE statement before the INSERT and SELECT statements. Run

your solution and verify the result table contains the three inserted rows.

Write your CREATE TABLE statement here:

INSERT INTO Product (ID, Name, Product Type, OriginDateTime, Weight)

--

VALUES

(100, 'Tricorder', 'COM', '2020-08-11 11:30:00', 2.4172),

(200, 'Food replicator', 'FOD', '2020-09-21 14:00:00', 54.02),

(300, 'Cloaking device', 'SPA', '2019-02-04 07:35:00', 19257.9);

Generate a result table and check that your efforts were correct

Question image 1