Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Populate tables with test data whilst maintaining relational integrity [closed]

I have a MySQL database with InnoDB tables, many of which have foreign keys.

I was going to write a script to populate the tables with test data (10-20k rows or more) but I thought I ought to ask if there's something already out there that can generate test data based on the field types but ensure relational integrity at the same time?

I've seen and have downloaded the script at generatedata.com but as far as I can see it's clever but it won't read the tables within your db and generate data based on what it finds- you have to do it all manually.

like image 611
bcmcfc Avatar asked Dec 21 '10 21:12

bcmcfc


People also ask

What is referential integrity in database?

It’s a characteristic of relational systems, which store data in tables that may be linked and used in various ways. The term “referential integrity” refers to a set of procedures that ensure that data is saved and used consistently.

Should I cite this essay on data integrity in relational databases?

This essay on Data Integrity in Relational Databases was written and submitted by your fellow student. You are free to use it for research and reference purposes in order to write your own paper; however, you must cite it accordingly . If you are the copyright owner of this paper and no longer wish to have your work published on IvyPanda.

How to create large tables of random data for performance testing?

In this tip we will see how to create large tables of random data that can be used for performance testing. The solution is to this problem is to write a script that can add large amount of random data into the SQL Server database so that queries can be evaluated for performance and execution.

Why is relational integrity so interesting?

Not to fearit's a good deal less interesting than that, unless you're a database designer, in which case it's endlessly fascinating. Relational integrity, also known as referential integrity, speaks to the notion that a database structure, as expressed in an ERD, also implies certain rules about what can and cannot happen in a database.


1 Answers

This one is as easy as:

call procedurename('DATABASE','TABLE',1000,''); 

will fill 1000 random rows and will populate records as per your needs.

like image 121
user1235000 Avatar answered Sep 29 '22 14:09

user1235000