-1
Guys I’m having a really hard time with this question Can someone help me?
Tables :
CREATE TABLE Funcionario
(
Cod_Func int Identity not null,
Nome_Func varchar(100) not null,
Data_CadFunc smalldatetime not null Default
Getdate(),
Sexo_Func char(01) not null Default
'F',
Sal_Func decimal(10,2) not null Default 200,
End_Func varchar(100) not null,
Constraint PK_Func Primary Key(Cod_Func),
Constraint CH_Func1 Check(Data_CadFunc>=Getdate()),
Constraint CH_Func2 Check(Sexo_Func IN
('F','M')),
Constraint CH_Func3 Check(Sal_Func >=0)
)
CREATE TABLE Dependente
(
Cod_Dep int identity not null,
Cod_Func int not null,
Nome_Dep varchar(100) not null,
Data_NascDep smalldatetime not null,
Sexo_Dep char(01) not null Default
'F',
Constraint PK_Dep Primary Key(Cod_Dep),
Constraint FK_Dep Foreign
Key(Cod_Func)References Funcionario(Cod_Func),
Constraint CH_Dep Check(Sexo_Dep IN ('F','M'))
)
This "tutorial" video shows how to do this and even with the same example, speaking of employee and dependent/manager and employee https://www.youtube.com/watch?v=jl24CvKkOyw
– Giovane
What part do you have problems with? Any mistakes with the code you have? Can you explain what you want to do? (so the question becomes clearer)
– Sergio