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

  1. Navigate to the "Create Manual Table" screen in the tool.

  2. You'll see a form with the following fields:

    • Table Name*

    • Table Description

    • Column Names*

  3. 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:

id, first_name, last_name, email, created_at
  • 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.

  1. After filling in all the required information, click the "Finish" button to create your table.

Best Practices for Manual Table Creation

  1. Naming Conventions: Use consistent naming conventions across all your tables and columns.

  2. Primary Keys: Always include a primary key, typically named 'id' or 'table_name_id'.

  3. Data Types: Although not specified in this interface, consider the appropriate data types for each column when you're designing your schema.

  4. Relationships: Think about how this table might relate to others in your schema.

  5. Normalization: Ensure your table design follows database normalization principles to avoid data redundancy.

  6. Timestamps: Consider adding 'created_at' and 'updated_at' columns for tracking record changes.

  7. 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