Experiment 03
Aim
To study and implement various data types in SQL
Theory
Different datatypes
note
Write the following from W3Schools:
- Numeric Data Types
- INT
- DECIMAL
- FLOAT
- BOOL
- String Data Types
- CHAR
- VARCHAR
- TEXT
- BLOB
- LONGBLOB
- ENUM
- Date and Time Data Types
- DATE
- TIME
- YEAR
Commands
CREATE TABLE ProductInventory (
ProductID INT,
Price DECIMAL(10, 2),
Weight FLOAT,
ProductCode CHAR(5),
ProductName VARCHAR(100),
Description TEXT,
ProductImage BLOB,
LargeImage LONGBLOB,
Category ENUM('Electronics', 'Clothing', 'Furniture'),
MfgDate DATE,
MfgTime TIME,
MfgYear YEAR
);
DESCRIBE ProductInventory;
Table
Draw the table that the following script will give as output!
DESCRIBE ProductInventory;
Conclusion
Successfully studied and implemented various SQL data types