'Mysql creating table issue

I started learning SQL but just in my first query, failed, i was doing exactly the same as the mentor explaining in the course but somehow his code worked mine not. I also tried this query on PopSql it also did not work. What is wrong here?enter image description here



Solution 1:[1]

You need to tell MySQL which database to use:

USE database_name;

before you create a table.

In case the database does not exist, you need to create it as:

CREATE DATABASE database_name;

followed by:

USE database_name;

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1