Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider ResearchBook, an online social network for researchers, which also helps one find possible collaborators. We are given a simple table with schema: ResInt (pid,
Consider ResearchBook, an online social network for researchers, which also helps one find possible collaborators. We are given a simple table with schema: ResInt (pid, topic) Person with pid has topic as a research interest Clearly a person can have multiple research interests (like 'Databases' and 'Artificial Intelligence'-so there may be multiple tuples for each pid in the relation. The goal of this question is to write a SQL query that gives us pairs of researchers with exactly the same research interests (as we can recommend them as collaborators). This query is trickyso let's try to solve it by the following steps. 4 Q4.1. (5 points) Write a SQL query to find all person-person-interest triplets (pidl, pid2, topic) such that person pidl has topic as a research interest, but person pid2 doesn't. Call this the PPT view Q4.2. (5 points) Given the earlier view PPT and the original table ResInt, write the full SQL query to find all pairs of people with the exact same set of research interests. Remove mirror pairs and self-pairs
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