
@allow <>
% base de données question 6
@let EMPLOYE = @relation [NrEmp, Dept, Pourcent] {
< E1, Info, 40 >
< E1, Bio , 60 >
< E2, Eco , 100 >
< E3, Bio , 50 >
< E3, Eco , 50 >
< E4, Eco , 100 >
< E5, Eco , 50 >
< E5, Bio , 25 >
< E5, Info, 25 >
}
@let DEPARTEMENT = @relation [NomDept, Budget, Chef] {
< Info, 5000, E1 >
< Bio , 3500, E1 >
< Eco , 4000, E5 >
}
@let EMPLOYE2 = @rename{Dept: Dept2, Pourcent: Pourcent2}(EMPLOYE)
@let result = @project {NrEmp}(@select{Dept<>Dept2}@select{Pourcent="50"}@select{Pourcent2="50"}(EMPLOYE @join EMPLOYE2))
@print result