3.1. Importing tables using DDL
Uploading SQL Schema Files
Our SQL generator tool allows you to import your existing SQL schema files, such as DDL (Data Definition Language) scripts. This feature enables you to quickly integrate your database structure into the tool for further manipulation or analysis.
How to Upload a SQL Schema File
Navigate to the "Upload SQL Schema File" screen in the tool.
You'll see a form with the following elements:
A text input field labeled "File Name*"
An upload area with the message "Click to upload a SQL file."
A "Finish" button at the bottom
Enter a name for your file in the "File Name" field. This doesn't have to match the actual filename, but should be descriptive. For example, you might enter "customers" for a schema related to customer data.
Click on the upload area. This will open a file browser on your computer.
Select the SQL file you wish to upload. The tool accepts SQL files containing schema definitions, typically with extensions like .sql, .ddl, or .txt.
Once your file is selected, it will appear in the upload area.
Click the "Finish" button to complete the upload process.

Important Notes
Ensure your SQL file contains valid DDL statements.
The tool currently supports [list supported SQL dialects, e.g., MySQL, PostgreSQL, etc.].
There may be a file size limit. If you encounter issues with large files, consider splitting them into smaller schema files.
After upload, you can [describe next steps, e.g., "view your schema in the tool", "modify the schema using our visual editor", etc.].
Data Privacy and Schema-Only Uploads
Important: When uploading your SQL schema file, please ensure it contains only the structure of your database (tables, columns, relationships, etc.) and not any actual data. The tool is designed to work with database schemas, not with the data itself. This approach helps maintain data privacy and security.
Include only CREATE TABLE, ALTER TABLE, and other structural SQL statements.
Omit any INSERT, UPDATE, or other data manipulation statements.
Remove any sensitive information such as user credentials or connection strings that might be present in comments.
By uploading only the schema, you can safely use the tool without risking exposure of sensitive or personal data.
If you encounter any issues during the upload process, please check our troubleshooting guide or contact our support team.
Sample DDL Format
To help you understand what your SQL schema file should look like, here's a sample DDL format:
-- Create Customers table
CREATE TABLE Customers (
CustomerID INT PRIMARY KEY,
FirstName VARCHAR(50),
LastName VARCHAR(50),
Email VARCHAR(100) UNIQUE,
PhoneNumber VARCHAR(20)
);
-- Create Orders table
CREATE TABLE Orders (
OrderID INT PRIMARY KEY,
CustomerID INT,
OrderDate DATE,
TotalAmount DECIMAL(10, 2),
FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID)
);
-- Create Products table
CREATE TABLE Products (
ProductID INT PRIMARY KEY,
ProductName VARCHAR(100),
Price DECIMAL(8, 2),
StockQuantity INT
);
-- Create OrderDetails table
CREATE TABLE OrderDetails (
OrderDetailID INT PRIMARY KEY,
OrderID INT,
ProductID INT,
Quantity INT,
UnitPrice DECIMAL(8, 2),
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
FOREIGN KEY (ProductID) REFERENCES Products(ProductID)
);
-- Add an index
CREATE INDEX idx_customer_email ON Customers(Email);
Last updated