Professional Documents
Culture Documents
Assignment 04
Assignment 04
Data types
Instructions:
Please share your answers filled in line in the Word document. Submit code
separately wherever applicable.
1. Create a database with a sales table containing data types like int,
varchar, char ,date, time, timestamp, Boolean, decimal, text ?
2. Insert 10 random values in the table ?
3. Change the data type of the existing column from DECIMAL (10,2) to
FLOAT ?
4. Change the data type of the existing column from Text to Varchar?
5. What is “BLOB” Data Type in SQL, what are different types of BLOB?
6. Write different character data types and different numerical data types?
5.In SQL, BLOB stands for Binary Large Object, and it is a data type used to store binary
data, such as images, audio files, video files, and other types of large binary objects.
BLOB data types are particularly useful when you need to store and retrieve binary data
in a database.
The generic BLOB type can store any binary data, including images, audio, video, and
other large objects.
It is typically used when you need to store binary data without any specific format or
structure.
TINYBLOB:
TINYBLOB is a variation of BLOB that can store up to 255 bytes of binary data.
It is suitable for storing small binary objects such as icons or small images.
MEDIUMBLOB:
LONGBLOB is the largest variation of BLOB and can store up to 4 gigabytes (4GB) of
binary data.
It is suitable for storing large binary objects such as high-resolution images, videos, or
large documents.
BigINT: Integer data type with larger storage capacity than INT.
Typically 8 bytes in size and can store values ranging from -9,223,372,036,854,775,808
to 9,223,372,036,854,775,807.
DECIMAL(p, s) or NUMERIC(p, s):
Fixed-point numeric data type that stores exact numeric values with specified precision p
and scale s.
Precision (p) represents the total number of digits, and scale (s) represents the number
of digits to the right of the decimal point.