0
0
SQLquery~5 mins

Column data types (INT, VARCHAR, DATE, DECIMAL) in SQL - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the INT data type represent in SQL?
INT is used to store whole numbers without decimals, like 1, 100, or -50.
Click to reveal answer
intermediate
How is VARCHAR different from CHAR in SQL?
VARCHAR stores variable-length text, saving space by only using what is needed, while CHAR always uses fixed length, padding with spaces if needed.
Click to reveal answer
beginner
What kind of data does the DATE type store?
DATE stores calendar dates in the format YYYY-MM-DD, like 2024-06-01.
Click to reveal answer
intermediate
Explain the DECIMAL data type and when to use it.
DECIMAL stores numbers with exact precision and scale, useful for money or measurements where decimals matter, like 10.99 or 123.456.
Click to reveal answer
intermediate
Why choose VARCHAR(50) instead of VARCHAR(255)?
Choosing VARCHAR(50) limits text to 50 characters, saving storage and improving speed if you know data won't be longer than 50 characters.
Click to reveal answer
Which data type should you use to store a person's age?
AINT
BVARCHAR
CDATE
DDECIMAL
What is the maximum length of text stored in VARCHAR(100)?
A255 characters
BUnlimited characters
C100 characters
D10 characters
Which data type is best for storing a birthdate?
AINT
BDATE
CDECIMAL
DVARCHAR
If you need to store a price like 19.99, which data type is best?
AINT
BVARCHAR
CDATE
DDECIMAL
What happens if you store text longer than VARCHAR(50) in a VARCHAR(50) column?
AError or rejection depending on SQL settings
BText is stored fully
CText is truncated to 50 characters
DText is padded with spaces
Describe the main differences and uses of INT, VARCHAR, DATE, and DECIMAL data types in SQL.
Think about what kind of data each type holds and why.
You got /4 concepts.
    Explain why choosing the right column data type matters when designing a database.
    Consider how data type affects space and correctness.
    You got /4 concepts.