Reputation: 57
I am getting the error code 1054 Unknown column 'interlake' in 'field list'
drop table if exists `Boats`;
create table `Boats` (
`bid` int(11) not null,
`bname` varchar(45) default null,
`color` varchar(15) default null,
primary key (`bid`)
) engine=InnoDB default charset=latin1;
alter table `Boats` disable keys;
insert into `Boats` values
(101,`Interlake`,`blue`),(102,`Interlake`,`red`),(103,`Clipper`,`green`),(104,`Marine`,`red`);
alter table `Boats` enable keys;
Upvotes: 1
Views: 463
Reputation: 771
You are missing "values" and use quotes('' or "") instead of back ticks(``).
Try this
drop table if exists `Boats`;
create table `Boats` (
`bid` int(11) not null,
`bname` varchar(45) default null,
`color` varchar(15) default null,
primary key (`bid`)
) engine=InnoDB default charset=latin1;
ALTER TABLE `Boats` disable KEYS ;
INSERT INTO Boats
( bid, bname, color)
VALUES
( 101, 'Interlake', 'blue'),
( 102, 'Interlake', 'blue'),
( 103, 'Interlake', 'blue');
ALTER TABLE `Boats` enable KEYS ;
Upvotes: 0
Reputation: 878
Did you try removing back-ticks and using apostrophe ??
insert into `Boats` values
(101, 'Interlake', 'blue'),(102, 'Interlake', 'red'),(103, 'Clipper', 'green'),(104, 'Marine', 'red');
Upvotes: 0
Reputation: 839
Use quotes instead of back ticks
INSERT INTO `Boats`
(`bid`, `bname`, `color`)
VALUES
(101,"Interlake","blue"),
(102,"Interlake","red"),
(103,"Clipper","green"),
(104,"Marine","red");
Upvotes: 2