+ 1

Help me : SQL

Sure, I was stuck on this code Coach for a long time can't figure out the mistake Code : Insert into garage (ID ,Make,Model,ProdYear) Values (6,'Mercedes-Benz','G 63', 2020), (7,'Porche', 'panamera', 2020); Select * from Garage

26th Jun 2022, 3:42 PM
Hrithika Reddy
Hrithika Reddy - avatar
9 ответов
+ 3
I have just tried it and this works (last line is not necessary): INSERT INTO Garage (id, Make, model, prodyear) VALUES (6, 'Mercedes-Benz', 'G 63', 2020), (7, 'Porsche', 'Panamera', 2020 ); SELECT * from Garage ORDER BY id;
26th Jun 2022, 4:14 PM
Paul
Paul - avatar
+ 4
Thanks paul Jayakrishna DaGD bot and Ipang ! Ive got it ! Thx so much. Make sure to read my codes
26th Jun 2022, 4:18 PM
Hrithika Reddy
Hrithika Reddy - avatar
0
Use insert for single colomn entry.. Separate that into two instructions for clarity..
26th Jun 2022, 3:54 PM
Jayakrishna 🇮🇳
0
What does that mean?
26th Jun 2022, 3:57 PM
Hrithika Reddy
Hrithika Reddy - avatar
0
Can u type that code and give me
26th Jun 2022, 3:57 PM
Hrithika Reddy
Hrithika Reddy - avatar
0
insert into garage (ID ,Make,Model,ProdYear) Values(6,'Mercedes-Benz','G 63', 2020); insert into garage values (7,'Porche', 'panamera', 2020) ; select * from garage ; edit: Hrithika Reddy make sure your column names correct... if it is in orderly , and all values mentioned then don't need to specify column names.. as shown in second way.. actually what is error showing, can you mention?
26th Jun 2022, 4:03 PM
Jayakrishna 🇮🇳
0
Idk what language you're using but if you want to insert many it looks like this (Python btw) c.executemany(f"INSERT INTO {language} VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", data) The questions marks represent the items you want to insert, the data is a list of the items I wanna insert. I probably worded it wrong so I'll probably just send you a video link of how SQLITE3 works
26th Jun 2022, 4:04 PM
Da GD Bot
Da GD Bot - avatar
0
Check and recheck whether all the values you insert are exactly as shown in the task instruction. A small typo or different letter case matters.
26th Jun 2022, 4:15 PM
Ipang
0
R
27th Jun 2022, 7:35 PM
Rahmat Madad
Rahmat Madad - avatar