-1

I am not sure what is wrong here, I have column 6 "Location varchar(50)" and as you can see in the VanWinkles table, column 6 is 'London', so why am I getting this error?

CREATE TABLE VanWinkleEmployee
(EmployeeID int,
Reservation varchar(50),
Checkin int,
Checkout int,
TotalDays int,
Location varchar(50),
Deposit int,
Rate int,
Discount int,
ExtraCharges int,
Reimbursement int

INSERT INTO VanWinkleEmployee VALUES
(104, null, null, null, 4, ‘London’, 20, 35, 15, null, null ),
(105, null, null, null, null, ‘London’, null, null, null, null, null )
ScaisEdge
  • 131,976
  • 10
  • 91
  • 107
Steve Wong
  • 15
  • 3
  • Your create statement is missing a closing parenthesis and terminator and LONDON has some weird (invalid) quotes around it - otherwise fine see https://dbfiddle.uk/?rdbms=mysql_8.0&fiddle=01f113b79bdc868cd6daee5a4b27af99 – P.Salmon Nov 28 '21 at 08:26

1 Answers1

0

You should close the first statement with ) and ;

CREATE TABLE VanWinkleEmployee
    (EmployeeID int,
    Reservation varchar(50),
    Checkin int,
    Checkout int,
    TotalDays int,
    Location varchar(50),
    Deposit int,
    Rate int,
    Discount int,
    ExtraCharges int,
    Reimbursement int
);

And you need proper quote around you string values don'use ‘’ instead you should use single quote ''

INSERT INTO VanWinkleEmployee VALUES 
(104, null, null, null, 4,'London', 20, 35, 15, null, null),
(105, null, null, null, null,'London', null, null, null, null, null); 

if you don'use the proper quote char the values is assumed as column name

ScaisEdge
  • 131,976
  • 10
  • 91
  • 107