0
0
SQLquery~10 mins

Column data types (INT, VARCHAR, DATE, DECIMAL) in SQL - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define an integer column named 'age'.

SQL
CREATE TABLE people (age [1]);
Drag options to blanks, or click blank then click option'
AVARCHAR(100)
BINT
CDATE
DDECIMAL(5,2)
Attempts:
3 left
💡 Hint
Common Mistakes
Using VARCHAR for numeric data.
Using DATE for age.
2fill in blank
medium

Complete the code to define a column 'name' that stores text up to 50 characters.

SQL
CREATE TABLE users (name [1]);
Drag options to blanks, or click blank then click option'
AINT
BDATE
CVARCHAR(50)
DDECIMAL(10,2)
Attempts:
3 left
💡 Hint
Common Mistakes
Using INT for text data.
Using DATE for names.
3fill in blank
hard

Fix the error in the code to define a 'birthdate' column storing dates.

SQL
CREATE TABLE employees (birthdate [1]);
Drag options to blanks, or click blank then click option'
ADATE
BINT
CDECIMAL(8,2)
DVARCHAR(10)
Attempts:
3 left
💡 Hint
Common Mistakes
Using VARCHAR for dates.
Using INT for dates.
4fill in blank
hard

Fill both blanks to define a 'price' column with decimal numbers having 7 digits total and 2 after the decimal point.

SQL
CREATE TABLE products (price [1]([2], 2));
Drag options to blanks, or click blank then click option'
ADECIMAL
B50
C7
DINT
Attempts:
3 left
💡 Hint
Common Mistakes
Using INT for price.
Using wrong precision number.
5fill in blank
hard

Fill all three blanks to create a table 'orders' with columns: 'order_id' as integer, 'customer_name' as text up to 100 chars, and 'order_date' as date.

SQL
CREATE TABLE orders (order_id [1], customer_name [2]([3]), order_date DATE);
Drag options to blanks, or click blank then click option'
AINT
BVARCHAR
C100
DDECIMAL
Attempts:
3 left
💡 Hint
Common Mistakes
Using DECIMAL for order_id.
Using INT for customer_name.