views:

77

answers:

4

What is your way of creating and populating test tables in MySQL when looking into SO questions where tables (but not CREATEs) and test data (but not INSERTs) are provided?

And what client do you use?

EDIT: Here's a simply example of what I mean on SO.

A: 

Bulk Inserts should be a useful term for you to search on.

DanDan
+1  A: 

I would suggest using phpMyAdmin. It provides a fairly easy-to-use interface for inserting multiple rows at once.

Jordan Ryan Moore
+1  A: 

Now that I understand the question, I can answer... I'd either do a bulk import of CSV/TSV, or (more likely for smaller data sets), load the example from the question into Vim and regex it into insert statements. I'd write the table create statements by hand. This all of course assumes that I need to create the tables at all, since in general I answer from experience and don't need any actual tables to play with (as @gahooa said in his/her comment).

rmeador
+2  A: 

You can have this done for you at http://www.generatedata.com/#generator Simply specify the column names & datatypes, and how you want the data to be output (SQL statements, HTML,Excel,XML,CSV) .

Mohsin Sheikh Khalid