-
Notifications
You must be signed in to change notification settings - Fork 690
Foreign Key
Andrey Gershun edited this page May 25, 2015
·
5 revisions
AlaSQL supports FOREIGN KEY concept.
In this example field Orders.fruitid reference to Fruits table:
CREATE DATABASE Fruits;
USE DATABASE Fruits;
CREATE TABLE Fruits (
fruitid INT PRIMARY KEY,
fruitname NVARCHAR(MAX),
price MONEY
);
CREATE TABLE Orders (
orderid INT PRIMARY KEY IDENTITY,
fruitid INT REFERENCES Fruits(fruitid),
qty FLOAT
);© 2014-2026, Andrey Gershun & Mathias Rangel Wulff
Please help improve the documentation by opening a PR on the wiki repo