3.2. Manually adding tables
Creating Tables Manually
Our SQL generator tool allows you to create tables manually, giving you full control over your schema design. This feature is useful when you're starting from scratch or want to add new tables to an existing schema.
How to Create a Manual Table
Navigate to the "Create Manual Table" screen in the tool.
You'll see a form with the following fields:
Table Name*
Table Description
Column Names*
Fill in the fields as follows:
Table Name*
Enter a unique name for your table. For example: "customers_XXX"
Use lowercase letters, numbers, and underscores.
Avoid spaces and special characters.
The name should be descriptive and reflect the table's purpose.
Table Description
Provide a brief description of what the table will store. For example: "store information about customers"
This helps document your schema for future reference.
Keep it concise but informative.
Column Names*
List the names of the columns for your table. For example:
Separate column names with commas.
Use lowercase letters, numbers, and underscores.
Avoid spaces and special characters.
List columns in a logical order, typically starting with the primary key.
After filling in all the required information, click the "Finish" button to create your table.
Best Practices for Manual Table Creation
Naming Conventions: Use consistent naming conventions across all your tables and columns.
Primary Keys: Always include a primary key, typically named 'id' or 'table_name_id'.
Data Types: Although not specified in this interface, consider the appropriate data types for each column when you're designing your schema.
Relationships: Think about how this table might relate to others in your schema.
Normalization: Ensure your table design follows database normalization principles to avoid data redundancy.
Timestamps: Consider adding 'created_at' and 'updated_at' columns for tracking record changes.
Indexing: While not part of this initial creation step, plan which columns might need indexing for query performance.
Next Steps
After creating your table manually, you can:
Add more tables to complete your schema
Modify the table structure if needed
Generate SQL scripts for your database system
Visualize your schema to see table relationships
If you need to make changes or if you've made a mistake, you can edit or delete the table using our other tools.
Remember, designing a good database schema is crucial for your application's performance and maintainability. Take your time to plan your table structures carefully.
Last updated