Table
Employee (ssn, name,deptname, city, current salary, last_promotion_id)
Dept(deptname, description)
Dependents(dependent ssn, employee_ssn, dependent name )
Promotion(promotion_id, ssn, promotitle,promodate)
Claims(claim_no, dependentssn)
Firstcolumn in every table is primary key
Employee my have 0..* Dependents
Dependents may have 0..* claims
Employee may have 1..* promotions
Given the above what I want in my DTO given one employee ssn is a query that returns EmployeeDTO with the following
Employee.SSN
Employee.name
Employee.Deptname
Promotion.promotitle (joined employee.last_promotion_id = promotion_id)
The second part of my question is I still need EmployeeDTD but my search criteria is claim_no.. like the sql below
select .Employee.SSN,Employee.Deptname,Promotion.promotitle
where ...
and exists ( select .. from claim , dependents
where emp.ssn= dependends.employee_ssn
and dependends.employee_ssn= claim.dependentssn)
|