“Chaves estrangeiras” Respostas de código

Chaves estrangeiras

CREATE TABLE Employee(
    EmployeeID int NOT NULL,
    LastName varchar(50) NOT NULL,
    FirstName varchar(20) NOT NULL,
    Age int,
    DeptNo int,
    PRIMARY KEY (EmployeeID),
    FOREIGN KEY (DeptNo) REFERENCES Department(DeptNo)
);
Misty Mongoose

Chave estrangeira

USE Organization
CREATE TABLE Employee_Office
(
Id INT PRIMARY KEY IDENTITY(1,1),
Emp_Id int FOREIGN KEY REFERENCES Employee(Id),
Office_Id int FOREIGN KEY REFERENCES Office(Id)
)
Adorable Armadillo

Chave estrangeira

USE Organization
CREATE TABLE Employee
(
Id INT PRIMARY KEY IDENTITY(1,1),
Name VARCHAR (50) NOT NULL,
Age INT,
Gender VARCHAR (50),
Dep_Id int FOREIGN KEY REFERENCES Department(Id),
Insur_Id int FOREIGN KEY REFERENCES Insurance(Id)
)
Adorable Armadillo

Chave estrangeira

ALTER TABLE your_table ADD FOREIGN KEY (your_column) REFERENCES other_table(other_column);
Healthy Hare

Respostas semelhantes a “Chaves estrangeiras”

Perguntas semelhantes a “Chaves estrangeiras”

Procure respostas de código populares por idioma

Procurar outros idiomas de código