Hi there,
I have a problem when i want to create tables, I want to create three tables Company, Employee and department.
department table has two foreign key the employee_Id and the company_Id but there is a syntax error can you please fix it.
here is the code:-
I have a problem when i want to create tables, I want to create three tables Company, Employee and department.
department table has two foreign key the employee_Id and the company_Id but there is a syntax error can you please fix it.
here is the code:-
Code:
CREATE TABLE Company ( Company_Id int primary key not null, Company_Name varchar(255), ) CREATE TABLE Dept ( Dept_Id int not null, DeptName varchar(255), Company_Id int, Employee_Id int, Primary key (Dept_Id), CONSTRAINT fk_Company_Id FOREIGN KEY (Company_Id) REFERENCES Company(Company_Id) CONSTRAINT fk_Employee_Id FOREIGN KEY (Employee_Id) REFERENCES Employee(Employee_Id) ) CREATE TABLE Employee ( Employee_Id int not null, EmployeeName varchar (255) )
Comment