Creating a SQL script to insert data into a table (MySQL)

I sincerely apologize if this sounds like the most ridiculous newbie, but I'm just starting to deal with SQL. This is more necessary than learning from scratch. Thanks for any help though, I sincerely appreciate it!

I am trying to create a script to insert data into the following table:

playercreateinfo_item.sql - github link to sql table copy

Fields / columns are race, class, itemid, quantity.

How can I create a script for this? Based on my basic understanding, it will be something like this:

INSERT INTO playercreateinfo_item (race,class,itemid,amount) VALUES (1,1,1,1); 

But what else do I need? How is the header or footer? I honestly don’t even know what the full script will look like for this! I also have to insert hundreds of different pieces of data, I'm not sure if there is an easy way to do this, or if I just need to do it manually. I'm sorry if this is a terribly basic question, I just lost my attempt to learn. Thanks so much for any help! You guys are fantastic.

+4
source share
1 answer

SQL script is just a text file with SQL commands. Typically, queries are separated by a semicolon.

No header or footer.

Edit:

In the case of inserting multiple tuples, you can do a batch insert with INSERT like this

 INSERT INTO playercreateinfo_item (race,class,itemid,amount) VALUES (1,1,1,1), (2,2,2,2), (3,3,3,3); 
0
source

Source: https://habr.com/ru/post/1487782/


All Articles