Exercise: Schema and Object Management
Practice and test your understanding of schema and object management.
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).
-- Create GlobalApp with specified character set and collation
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 ProductReviews
to store customer reviews for products. It should include:
ReviewID
(INT, ...