Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider again the enterprise database. Select all the safe datalog queries that accurately represent the following task: Two employees are indirect colleagues' if they worked
Consider again the enterprise database. Select all the safe datalog queries that accurately represent the following task: Two employees are indirect colleagues' if they worked on the same project, or if they are both 'indirect colleagues' to the same employee. Retrieve all pairs of employees names of those employees who are 'indirect colleagues'. indirectColleagues(e1, e2) :- worksOn(e1, pID), worksOn(e2, pID) indirectColleagueNames(eName1, eName2):- indirectColleagues(e1, e2), employee(e1, eName1, a1), employee(e2, eName2, a2) ?indirectColleagueNames(eName1, eName2) indirectColleagues(e1, e2) :- worksOn(e1, pID), worksOn(e2, pID) indirectColleagues(e1, e2) :- indirectColleagues(e1, e3), indirectColleagues(e3, e2) ?indirectColleagues(e1, e2) indirectColleagues(e1, e2) :- worksFor(e1, ID), worksFor(e2, ID) indirectColleagues(e1,e2) :- indirectColleagues(e1, e3), indirectColleagues(e3, e2) indirectColleagueNames(eName1, eName2) :- indirectColleagues(e1, e2), employeele1, eName1, a1), employeele2, eName2, a2) ?indirectColleagueNames(eName1, eName2) indirectColleagues(e1, e2) :- worksOn(e1, pID), worksOn(e2, pID) indirectColleagues(e1,e2):- indirectColleagues(e1, e3), indirectColleagues(e3, e2) indirectColleagueNames(eName1, eName2) :- indirectColleagues(e1, e2), employee(e1, eName1, a1), employee(e2, eName2, a2) ?indirectColleagueNames(eName1, eName2)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started