Last answered:

22 Aug 2022

Posted on:

25 May 2022

1

I GOT AN ERROR IN RUNNING CODE. I COULDN'T FIX IT

Hello,
    Please I have three concerns.
1. I tried creating database... its showing me an error
       CREATE DATABASE IF NOT EXISTS Sales;

2. I tried creating the table for the assignment, its showing me error also

CREATE TABLE Customers (
customer_id INT,
    first_name VARCHAR (255),
    last_name VARCHAR (255),
    email_address VARCHAR (255),
    number_of_complaints INT
);

3. The error place in mine is too small, as shown in my screenshot. How can I make it big. I can’t see the details of the error messages.

Thank you for your time and knowledge sharing.image

4 answers ( 0 marked as helpful)
Posted on:

25 May 2022

0

I have same problem

Posted on:

26 May 2022

0

Nobody has answered us?

Instructor
Posted on:

13 Jun 2022

0

Hi Olayemi and Anura!
Thanks for reaching out.

I tested the code and it works.
Error 1046 - this means you have not selected a default database to work with
Error 1064 - this is not a correct syntax according to the official MySQL documentation

Hope this helps.
Best,
Tsvetelin

Posted on:

22 Aug 2022

1

Hello Olayemi,

For Error 1046, I think there is no problem with creating the database Sales, but you need to add the code USE Sales; before creating the table customers.

For Error 1064, it must be the VARCHAR (255) that made the syntax error. You must remove the whitespace before (255) - VARCHAR(255) - for the code to work.

Submit an answer