Last answered:

13 Dec 2023

Posted on:

13 Nov 2023

2

If anyone getting error 1046 this is because you haven't created a database to start with. Solution>

CREATE DATABASE sales;
USE sales;
CREATE TABLE sales 
(
purchase_number INT NOT NULL PRIMARY KEY auto_increment,
date_of_purchase DATE NOT NULL,
customer_id INT,
item_code varchar(10) NOT NULL
);


REFRESH SCHEMA TO SEE THE NEW DATABASE 'SALES'.

2 answers ( 0 marked as helpful)
Instructor
Posted on:

13 Nov 2023

1

Hi Durinder!
Thanks for reaching out.


Thanks for sharing this piece of information with the Community!


Best,
Tsvetelin

Posted on:

13 Dec 2023

0

Thank You!!

Submit an answer

  • Javascript
  • Python
  • Ruby
  • PHP
  • Java
  • C
  • C#
  • C++
  • HTML
  • SQL
  • R
  • Shell