Exercise: Schema and Object Management
Practice essential schema and object management tasks using MySQL. Learn to create databases with specific character sets, design tables with keys and constraints, write stored procedures, and query for insights. This lesson deepens your ability to manage database structure and enforce data integrity through hands-on exercises.
We'll cover the following...
Now, let’s get some hands-on practice.
Question 1
Write an SQL command to create a database named GlobalApp specifically using the utf8mb4 character set and the utf8mb4_0900_ai_ci collation (a common modern default that is accent-insensitive and case-insensitive).
If you’re stuck, click the “Show Solution” button.
Question 2
Given the following structure of the Customers table:
Field | Type |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Where CustomerID is the primary key and ReferralID is self-referencing to CustomerID. The table contains information about customers.
Also, we have the following structure of the Products table:
Field | Type |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Where ProductID is the primary key and CategoryID is the foreign key from the Categories table. The table contains information about products.
Create a table named ...