Categories

Get Started Now

How to Generate Dummy Data for Your Database

Hi everyone. This tip is focused squarely at my DBA students, regardless of whether your platform if SQL Server, Oracle, MySQL, or Access.

Here’s the situation: you are designing a database and need to perform tests in your development environment using live data. Well, where in the world are you going to get that live data? You can’t very well invest half a workday typing fictitious records, right? Using a copy of your organization’s production data is a possibility, but this isn’t always feasible due to legal and/or ethical considerations.

I found this awesome Web site called generatedata.com that totally solves this “dummy data” conundrum. The site owner, evidently out of the kindness of his or her heart, created a script (written in JavaScript, PHP, and MySQL) that enables folks like you and me to produce potentially large amounts of sample data.

Here’s how it works: Navigate to the Generator page, and select your output file format. You have a choice of HTML, native Microsoft Excel, XML, Comma-Separated Value (CSV), or native SQL.

Next, determine your target country for data fields such as addresses, and specify the number of results. Finally, fill in your column names and data types, being careful to mirror the schema of your development database tables. Click Generate to product the data set.

Caption: Specifying dummy data parameters

Caption: The resultant dummy data

Isn’t that awesome! This Web site has saved my bacon quite a bit over the past several months, let me tell you. Some final points: the site owner offers the generatedata.com source code for free download, bound only by the GNU license. Also, site users who donate $20 or more to the site are given a user account at generatedata.com and are allowed to run much larger record batches than the non-paying public (the free online tool can generate only up to 200 records at a time).

I hope that you found this tip helpful. Happy studying!

 

Not a CBT Nuggets subscriber? Start your free week now.

CBT Nuggets has everything you need to learn new IT skills and advance your career — unlimited video training and Practice Exams, Virtual Labs, validated learning with in-video Quizzes, Accountability Coaching, and access to our exclusive community of IT professionals.

Learn more about the CBT Nuggets Learning Experience.

 

Comments are closed.