Simple database
✓ Published0🌍 Public
Aabonello
Last edited Mar 14, 2026
Created on Mar 14, 2026
This example shows how to create a simple relational database with two tables, Customers and Orders, using raw SQL. It demonstrates the use of IDENTITY columns for auto-generated primary keys and FOREIGN KEY constraints to enforce referential integrity between the tables. The code also includes a JOIN query that combines customer names with their corresponding order details, illustrating basic data retrieval without an ORM. The example relies on standard SQL Server syntax and T-SQL commands, including CREATE TABLE, CONSTRAINT, and SELECT with JOIN.
AI-generated description