The code for adding and deleting massive amounts of data to and from a mysql data table needs to be tested today. However, the data source in the data table has become a major problem, and the same problem occurs when you search online.
Recommended methods include:
1. add in excel and import it to the data table (feasible but troublesome)
2. manually add one by yourself (cannot stand it, drive people crazy)
3. use a program to add data cyclically (very convenient and practical)
The following is a brief introduction to the third scenario:
Let's just give a chestnut,
Drop procedure if exists km; // The km method needs to be deleted each time. Otherwise, the program cannot execute create procedure km () for the second time. // create a km method begin declare I int; set I = 0; while I <= 1000 do insert into de_grade ('atient _ id', 'case _ name', 'User _ name', 'case _ level ', 'grade _ type', 'grade ') values (1006, 'heart', 'jungl', 9, 2, 84.48); set I = I + 1; end while; end; call km (); // CALL method execution
Similarly, you can delete multiple objects in a loop (delete them by id)
Drop procedure if exists km; create procedure km () begin declare I int; set I = 100; while I <= 200 do delete from de_grade where grade_id = I; set I = I + 1; end while; end; CALL KM ();