The Prompt Library
CodingSQL

Create a Table Schema

Define a SQL table schema with columns, types, and constraints.

Select Model:

Prompt:

I'm designing a SQL table and need your help creating a well-structured schema. Please provide a complete table definition with appropriate columns, data types, and constraints. TABLE INFORMATION: - Table name: [TABLE_NAME] - Purpose: [DESCRIBE PURPOSE] - Database system: [SPECIFY DATABASE SYSTEM IF RELEVANT] REQUIREMENTS: - Information to store: [DESCRIBE ENTITY ATTRIBUTES] - Key information: [DESCRIBE KEY REQUIREMENTS] - Relationships to other tables: [DESCRIBE RELATED TABLES IF ANY] - Business rules: [DESCRIBE ANY SPECIFIC CONSTRAINTS] - Usage patterns: [DESCRIBE HOW THE TABLE WILL BE USED] Please provide: 1. A complete CREATE TABLE statement including: - Properly named columns following naming conventions - Appropriate data types for each column - Primary key definition - Foreign key constraints (if applicable) - Unique constraints - Not null constraints - Check constraints for data validation - Default values where appropriate - Indexes for performance optimization - Comments explaining column purposes 2. Brief explanation of key design decisions: - Choice of primary key - Data type selections - Constraint implementations - Normalization level - Index strategy 3. Any additional recommendations regarding: - Schema optimization - Query performance - Data integrity - Scalability considerations Please format the SQL with clear indentation and syntax appropriate for the specified database system.

Related Prompts

Other prompts you might find useful

CodingSQL

Write a SQL Query

Generate a SELECT query with filters, joins, and sorting.

6 models availableView details
CodingSQL

Explain a SQL Query

Break down what a SQL query does, step-by-step.

6 models availableView details
CodingSQL

Create a Table Schema

Define a SQL table schema with columns, types, and constraints.

6 models availableView details
CodingSQL

Optimize a SQL Query

Refactor a SQL query for performance, indexing, or simplicity.

6 models availableView details