Jul 11, 2024
टेबल बनाना:
CREATE TABLE Employees (
EmployeeID int NOT NULL,
FirstName varchar(255) NOT NULL,
LastName varchar(255) NOT NULL,
Age int,
PRIMARY KEY (EmployeeID)
);
DEFAULT Value सेट करना:
CREATE TABLE Players (
PlayerID int NOT NULL,
PlayerName varchar(255) DEFAULT 'Unknown'
);
UNIQUE Constraint:
CREATE TABLE Students (
StudentID int NOT NULL,
Email varchar(255) UNIQUE
);
CHECK Constraint:
CREATE TABLE Orders (
OrderID int NOT NULL,
Quantity int,
CHECK (Quantity > 0)
);
CREATE INDEX idx_employee_firstname
ON Employees (FirstName);