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](https://cdn.codegym.cc/images/article/74b2c523-e098-4af7-a935-3c620009956e/1024.jpeg)
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](https://cdn.codegym.cc/images/article/076a2aa0-dcb5-4e2e-aaf1-269f60e1878e/1024.jpeg)
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](https://cdn.codegym.cc/images/article/39fcd2f5-4757-48ee-be55-393e76d1bbc7/1024.jpeg)
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](https://cdn.codegym.cc/images/article/69c311d5-71ad-48d1-9c12-a56a186b4d5b/800.jpeg)
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](https://cdn.codegym.cc/images/article/ebb65912-150b-4743-acf5-d4d71119298c/1024.jpeg)
GO TO FULL VERSION