By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,600 Members | 1,214 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,600 IT Pros & Developers. It's quick & easy.

I tried to run this create query but fail each time.

P: 18
I get these error each time I write the syntax in quotes. Please can someone help me?
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'book(
saleID int not null,isbn varchar(20) not null,quantity int not null,salePri' at
line 1

[create table sale(saleID int not null auto_increment primary key,custID int(5) not null,saleDate,shipmentAddress varchar(50) not null,invoiceID int(10) not null)engine=innodb;
create table sale book(saleID int not null,isbn varchar(20) not null,quantity int not null,salePrice dec(7,2) not null)engine=innodb;
create table book(isbn int not null,suppID int not null auto increment primary key,title varchar(20) not null,author varchar(50) not null,publisher varchar (15) not null,price dec(7,2) not null)engine=innodb;
create table supplier(suppID int(5) not null auto_increment primary key,suppCompany varchar(15),suppAddress varchar(50) not null,suppPhone varchar(15),suppEmail varchar(60))engine=innodb;]
Jun 25 '15 #1
Share this Question
Share on Google+
3 Replies

P: 278
Try running these as separate create queries.
Jun 25 '15 #2

Expert Mod 100+
P: 589
Besides needing to run them as separate statements, I see an error in your first create statement near the middle.
Expand|Select|Wrap|Line Numbers
  1. ,saleDate,
You forgot to specify the datatype for that field.
Jun 25 '15 #3

P: 278
Good catch Ron!

Jun 26 '15 #4

Post your reply

Sign in to post your reply or Sign up for a free account.