DEV Community

David Kanekanian
David Kanekanian

Posted on

E2 - Create Database from MySQL Console

Open phpMyAdmin (see Entering SQL commands) and enter these commands:

1. Delete the database from the previous example.

DROP DATABASE NeatTreats;
Enter fullscreen mode Exit fullscreen mode

2. Create the new Neat Treats database.

CREATE DATABASE NeatTreats;
Enter fullscreen mode Exit fullscreen mode

3. Make sure you edit this database going forward.

USE NeatTreats;
Enter fullscreen mode Exit fullscreen mode

4. Create the customer table in the new database. Don't worry about adding too many columns yet. We aren’t going to have preloaded records like the previous example. Instead the records will be inserted whenever a customer registers from the web form.

CREATE TABLE Customer (
    CustomerID INT,
    FirstName VARCHAR(125),
    LastName VARCHAR(125)
);
Enter fullscreen mode Exit fullscreen mode

Parent topic: Example 2

Top comments (0)