1

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax

create table 'spring3'.'employee'(
    id int,
    firstname varchar (32),
    lastname varchar (32),
    email varchar (32),
    phonenumber varchar (32),
    hiredate date,
    salary int
);
create table 'spring4'.'product'(
    id int,
    name varchar (32),
    quantity int,
    price float,
    available boolean
);
sticky bit
  • 36,626
  • 12
  • 31
  • 42
Phyo Ko
  • 13
  • 2
  • Identifiers like database names, table names and column names should be wrapped in backticks, not apostrophes. – Tangentially Perpendicular Jul 27 '21 at 09:58
  • 2
    Does this answer your question? [When to use single quotes, double quotes, and backticks in MySQL](https://stackoverflow.com/questions/11321491/when-to-use-single-quotes-double-quotes-and-backticks-in-mysql) – sticky bit Jul 27 '21 at 10:21
  • What do you mean "Could you please answer me?", you ask like he owes you something, your very rude. The error clearly states that __You have an error in your SQL syntax__ if you don't know what that means then you didn't try researching the issue before asking about it, which Stack Overflow clearly asks you to do. – JΛYDΞV Jul 27 '21 at 11:56
  • my bad sir. Please understand me sir. I am trying to be a good writer in english. Thanks JAY-DEV. – Phyo Ko Jul 27 '21 at 12:54
  • Thank you sir. I didn't know the usage of backticks. – Phyo Ko Jul 27 '21 at 13:01

1 Answers1

1

I think your problem is in the quotes mark. Use:

create table `spring3`.`employee`(
id int ,
firstname varchar (32),
lastname varchar (32),
email varchar (32),
phonenumber varchar (32),
hiredate date,
salary int ); 

Keep in mind that your id should be, not null auto_increment and primary key. So your table would be:

create table `spring3`.`employee`(
id int not null auto_increment ,
firstname varchar (32),
lastname varchar (32),
email varchar (32),
phonenumber varchar (32),
hiredate date,
salary int,
Primary key id(`id`) ); 
Ergest Basha
  • 7,870
  • 4
  • 8
  • 28