- 1
Why my query dosen't work (create table task) practice 23.2 vidoe game score
REATE TABLE leaderboard ( place int nickname varchar (100) rating int (3000) ); INSERT into leaderboard VALUES (1, Predator, 9500) INSERT into leaderboard VALUES (2, JohnWar, 9300) INSERT into leaderboard VALUES (3, NightWarrior, 8900) SELECT * leaderboard
7 Respostas
+ 3
אלה נוסבאום
Table creation script is wrong. It should be like this:
CREATE TABLE leaderboard (
place INT,
nickname VARCHAR,
rating INT
);
And also while inserting data put string data inside single quotes like:
INSERT INTO leaderboard VALUES (1, 'Predator', 9500)
+ 2
CREATE TABLE leaderboard (
place INT NOT null,
nickname VARCHAR (30) NOT null,
rating INT NOT null,
PRIMARY KEY (nickname)
);
INSERT INTO leaderboard
(place,nickname,rating)
VALUES
(1,'Predator',9500),
(2,'JohnWar',9300),
(3,'NightWarrior',8900);
select * from leaderboard;
0
Thank you. It still not working
The error says ;realtion "leaderboard" dose not exist; on all the insert commands
0
And error in the rating line.. did anyone do this practice?
0
create table leaderboard
(
place int,
nickname varchar,
rating int
);
insert into leaderboard (place, nickname, rating)
values (1, 'Predator', 9500), (2, 'JohnWar', 9300), (3, 'NightWarrior', 8900);
select * from leaderboard;
- 1
אלה נוסבאום
CREATE TABLE leaderboard
(
place integer,
nickname varchar (100),
rating integer (3000)
);
INSERT into leaderboard
VALUES (1, Predator, 9500);
INSERT into leaderboard
VALUES (2, JohnWar, 9300);
INSERT into leaderboard
VALUES (3, NightWarrior, 8900);
SELECT * FROM leaderboard;
- 1
CREATE TABLE leaderboard
(
place int,
nickname varchar (128),
rating int);
INSERT into leaderboard (Place, NickName, Rating)
VALUES
(1, 'Predator', 9500),
(2, 'JohnWar', 9300),
(3, 'NightWarrior', 8900);
SELECT * FROM leaderboard;