Skip to content

Generate random test data for MySQL using routines

Notifications You must be signed in to change notification settings

guitar15/dummy-data-sql

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Generate random test data for MySQL using routines

Files

  1. Download the sql code: populate_dummy_data.sql.
  2. Download sql for generating random data for foreign-key dependent child tables: populate_fk.sql

Install

mysql -uUSER -pPASSWORD DATABASE_NAME < populate_dummy_data.sql
mysql -uUSER -pPASSWORD DATABASE_NAME < populate_fk.sql

Usage

  • Run this SQL query
call populate('DATABASE-NAME','TABLE-NAME',NUMBER-OF-ROWS,DEBUG-MODE);
  • DEBUG-MODE ('Y','N') will print an SQL that's executed and iterated.

Example

To generate test data of 1000 rows for sakila.film table execute following sql command:

call populate('sakila','film',1000,'N');

Author

About

Generate random test data for MySQL using routines

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • SQLPL 100.0%