0
0
MySQLquery~30 mins

String types (VARCHAR, CHAR, TEXT) in MySQL - Mini Project: Build & Apply

Choose your learning style9 modes available
Create a Customer Feedback Table Using String Types
📖 Scenario: You work for a company that collects customer feedback. You need to create a database table to store customer names, their email addresses, and their feedback messages.
🎯 Goal: Build a MySQL table named customer_feedback using appropriate string types: VARCHAR for names and emails, and TEXT for feedback messages.
📋 What You'll Learn
Create a table named customer_feedback
Add a name column with type VARCHAR(50)
Add an email column with type VARCHAR(100)
Add a feedback column with type TEXT
Use CHAR(2) for a rating column to store short codes
💡 Why This Matters
🌍 Real World
Companies often store customer feedback in databases using appropriate string types to save space and improve performance.
💼 Career
Knowing how to choose and use string types in SQL is essential for database design and management roles.
Progress0 / 4 steps
1
Create the customer_feedback table with name and email columns
Write a SQL statement to create a table called customer_feedback with two columns: name as VARCHAR(50) and email as VARCHAR(100).
MySQL
Need a hint?

Use CREATE TABLE followed by the table name and define columns with their types inside parentheses.

2
Add a feedback column with type TEXT
Add a new column called feedback of type TEXT to the existing customer_feedback table creation statement.
MySQL
Need a hint?

The TEXT type is used for longer text data like messages or comments.

3
Add a rating column with type CHAR(2)
Add a column called rating with type CHAR(2) to store short rating codes in the customer_feedback table.
MySQL
Need a hint?

Use CHAR(2) for fixed-length short strings like rating codes.

4
Complete the table creation with all columns
Ensure the customer_feedback table creation statement includes all four columns: name VARCHAR(50), email VARCHAR(100), feedback TEXT, and rating CHAR(2).
MySQL
Need a hint?

Double-check all columns and types are included in the final statement.