Reputation: 13
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
);
Upvotes: 1
Views: 1200
Reputation: 8973
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`) );
Upvotes: 1