0
0
MySQLquery~10 mins

String types (VARCHAR, CHAR, TEXT) in MySQL - Interactive Code Practice

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

Complete the code to create a column that stores variable-length strings up to 100 characters.

MySQL
CREATE TABLE users (username [1](100));
Drag options to blanks, or click blank then click option'
ATEXT
BINT
CCHAR
DVARCHAR
Attempts:
3 left
💡 Hint
Common Mistakes
Using TEXT for short strings wastes space.
Using INT for string data causes errors.
2fill in blank
medium

Complete the code to create a fixed-length string column of 10 characters.

MySQL
CREATE TABLE products (code [1](10));
Drag options to blanks, or click blank then click option'
ABLOB
BVARCHAR
CCHAR
DTEXT
Attempts:
3 left
💡 Hint
Common Mistakes
Using VARCHAR when fixed length is needed wastes space.
Using BLOB for text data is incorrect.
3fill in blank
hard

Fix the error in the code to create a column for long text data.

MySQL
CREATE TABLE articles (content [1]);
Drag options to blanks, or click blank then click option'
ACHAR
BTEXT
CVARCHAR
DINT
Attempts:
3 left
💡 Hint
Common Mistakes
Using VARCHAR for long text data.
Using INT for text data is invalid.
4fill in blank
hard

Fill both blanks to create a table with a fixed-length code and a variable-length description.

MySQL
CREATE TABLE items (code [1](5), description [2](255));
Drag options to blanks, or click blank then click option'
ACHAR
BTEXT
CVARCHAR
DINT
Attempts:
3 left
💡 Hint
Common Mistakes
Using TEXT for code wastes space.
Using INT for text columns is wrong.
5fill in blank
hard

Fill all three blanks to create a table with a variable-length name, fixed-length code, and a long text notes column.

MySQL
CREATE TABLE records (name [1](100), code [2](8), notes [3]);
Drag options to blanks, or click blank then click option'
AVARCHAR
BCHAR
CTEXT
DINT
Attempts:
3 left
💡 Hint
Common Mistakes
Using INT for text columns.
Using CHAR or VARCHAR for long notes.