SQL Test Data Generator
Support MySQL, PostgreSQL, SQL Server, Oracle, SQLite databases
Table Structure Input
Tables Detected
Configuration
Foreign Key Configuration
Specify available values for foreign key fields (comma separated). If left empty for tables defined in the input, foreign key values will be automatically populated from generated parent table IDs.
Generated SQL Statements
Documentation
What is SQL Test Data Generator?
SQL Test Data Generator is a multi-database tool that automatically generates random test data from table structures. Supports MySQL, PostgreSQL, SQL Server, Oracle, and SQLite syntax. It parses DDL statements or JSON format table definitions, identifies primary keys, foreign keys and data types, then generates INSERT statements with database-specific syntax.
How to Use
- 1. Enter table DDL statement or JSON format table structure
- 2. Click "Parse Structure" button to analyze table structure
- 3. Select target database type (MySQL/PostgreSQL/SQL Server/Oracle/SQLite)
- 4. If there are foreign keys, configure available value sets
- 5. Set row count, start ID and other options
- 6. Click "Generate Data" button to generate INSERT statements
- 7. Copy or download the generated SQL statements
Key Features
Related Terms
DDL (Data Definition Language): SQL statements used to define database structure, such as CREATE, ALTER, DROP, etc.
Primary Key: A column or set of columns that uniquely identifies each row in a table, duplicates and NULL values are not allowed.
Foreign Key: A column that references the primary key of another table, used to establish relationships between tables.
Auto Increment: Database automatically generates incrementing unique values for new rows.
Best Practices
- 1. Define parent and child tables together - the tool automatically handles dependencies
- 2. Parent table IDs are automatically passed to child tables for foreign key values
- 3. For foreign keys referencing tables not in input, manually specify available values
- 4. Check if generated data conforms to business rules
- 5. Generate multiple times to get different random data
Related Tools
SQL Formatter
Online SQL code beautifier and formatter with support for multiple database dialects
MyBatis Generator
Generate MyBatis configuration files from table structure, including XML Mapper, Entity and Mapper interface
JSON Formatter
Format and validate JSON data for improved readability and debugging