Skip to content

DATABASE

CREATE DATABASE MyDatabase;
USE MyDatabase;
CREATE TABLE MyTable(ID int, Name varchar(255));
INSERT INTO MyTable VALUES (1, 'Name1');
SELECT * FROM MyTable;
+----+-------+
| ID | Name |
+----+-------+
| 1 | Name1 |
+----+-------+

The example demonstrates the procedure of creating a database, using that database, and creating a table inside the database in MySQL. An entry is also inserted into the table and then the contents of the table are displayed.