0
There are new employees that need to be added to the Employees table. Here is their data: Firstname: Wang Lastname: Lee Sala
this my code INSERT INTO Employees(firstname, lastname, salary) VALUES ("Wang" , "Lee" , 1900), ("Greta" , "Wu" , 1200); SELECT id, firstname, lastname, salary FROM Employees ORDER BY id DESC but it shows this error ERROR: column "Wang" does not exist LINE 3: VALUES ("Wang" , "Lee" , 1900), ^
6 Respostas
+ 3
Nipun Deshappriya May be typo mistake as error show in line 3 check Wang check again.
+ 3
This code does produce result in a SQLite 3.37.0 environment:
CREATE TABLE Employees (
id INT PRIMARY KEY,
firstname VARCHAR,
lastname VARCHAR,
salary INT);
INSERT INTO Employees
(firstname, lastname, salary)
VALUES
("Wang", "Lee", 1900),
("Greta", "Wu", 1200);
SELECT id, firstname, lastname, salary
FROM Employees
ORDER BY id DESC;
+ 2
insert into Employees( firstname, lastname, salary)
values
('Wang', 'Lee', 1900),
('Greta', 'Wu', 1200);
select id, firstname, lastname, salary from Employees
order by id desc;
+ 1
insert into Employees( firstname, lastname, salary)
values
('Wang', 'Lee', 1900),
('Greta', 'Wu', 1200);
select id, firstname, lastname, salary from Employees
order by id desc;
0
no typing errors I double checked
0
You should put single quotation instead of double quotations.
INSERT INTO Employees(firstname, lastname, salary)
VALUES
('Wang', 'Lee', 1900),
('Greta', 'Wu', 1200);
SELECT id, firstname, lastname, salary
FROM Employees
ORDER BY id DESC;