Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Fundamentals Study Guide

Authors: Dr. Sergio Pisano

1st Edition

B09K1WW84J, 979-8985115307

More Books

Students also viewed these Databases questions

Question

What is the purpose of completing a competitive analysis grid?

Answered: 1 week ago

Question

Determine the amplitude and period of each function.

Answered: 1 week ago