'SQL doesn't display new changes from query
So I have this query which is written in MySQL on Visual Studio Code text editor
CREATE TABLE largest_number (
n INT NOT NULL,
);
INSERT INTO largest_number(n)
VALUES
(1),
(40),
(300),
(600),
(10);
SELECT MAX(n) AS Largest_Number FROM largest_number;
and I decided to add a new column called 'username':
CREATE TABLE largest_number (
n INT NOT NULL,
username VARCHAR(25)
);
INSERT INTO largest_number(n,username)
VALUES
(1,"Dan"),
(400,"Daniel"),
(300,"Joseph"),
(600,"Adam"),
(10,"Adamza");
SELECT MAX(n) AS Largest_Number FROM largest_number;
When I executes the code it throws:
FAIL:
INSERT INTO largest_number(n,username) VALUES (1,"Dan"), (400,"Daniel"), (300,"Joseph"), (600,"Adam"), (10,"Adamza")
Message :
Unknown column 'username' in 'field list'
My main is problem is when I change the
INSERT INTO largest_number(n)
VALUES
(1),
(40),
(300),
(600),
(10);
to:
INSERT INTO largest_number(n)
VALUES
(15),
(140),
(1300),
(1600),
(110);
The output doesn't display the new changes and displays the old values, I have been stressing over this for days why is this happening?. Googling doesn't help too.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
