doc3
doc3
Syntax:
sql
Copy code
CREATE INDEX index_name
ON table_name (column_name);
Example:
sql
Copy code
CREATE INDEX idx_lastname
ON Employees (LastName);
sql
Copy code
CREATE TABLE Orders (
OrderID INT PRIMARY KEY,
CustomerID INT,
OrderDate DATE,
Amount DECIMAL(10, 2),
CONSTRAINT FK_Customer FOREIGN KEY (CustomerID)
REFERENCES Customers(CustomerID),
CHECK (Amount > 0)
);
This manual provides you with a strong foundation in SQL’s DDL and DML commands.
Practicing these commands will help you better understand relational database design and
management.