Schema creation

If you decide to create a new database on the SQL server, then there are two ways to do this:

  • Workbench GUI
  • Write custom SQL query

But since we are currently studying Workbench, we will create the database using it:

Workbench Schema creation

You can always use the top menu or the buttons on the top bar. Let's click on the "Create a new scheme" button, you will see the following panel:

Workbench Schema creation 2

Here you can set the name of the new scheme. Ready.

Default encoding

Important! Never choose the default encoding. Then it turns out that this is some kind of windows 1251, which does not want to work normally with Cyrillic. You don't need it to search or filter.

Moreover, the transfer of data between different SQL servers is often done in text form. The data is saved to a file as SQL queries and then simply executed on another server as a large SQL file.

And a situation can easily arise when you have different default encoding on different SQL servers. We've had a hard time with this :)

So let's get used to choosing it explicitly:

  • utf8
  • utf8_general_ci
Workbench Schema creation 3

If you want your database to be able to store text with emoticons that have just been added to Unicode, then you need to choose utf8mb4.

But for now, we will specify the encoding exactly utf8, and in the future we will work out with changing the encoding for storing texts with emoticons.

We finish creating the scheme

Click Apply and see the following window:

Workbench Schema creation 4

Yes, for each of your actions in Workbench, it will simply generate SQL queries .

Just click Apply and wait for the schema creation request to complete. You should end up with something like this Workbench state:

Workbench Schema creation 5