subject

Consider a social network database about people and their relationships. The database has two relations: Person ( pid, name ) Relationship ( pid1, rel, pid2 ) The key fields are underlined: Person. pid is the key for Person, and Relationship. pid1 and Relationship. pid2 are foreign keys to Person. rel is a string representing the relationship type, and it can only be ’friend’ or ’enemy’. So, a tuple (1,’friend’,2), means that the person with id 1 considers the person with id 2 a friend. Note that the relationship is not symmetric: if Alice is friend with Bob, it does not imply that Bob is friend with Alice. Required:
Create a view called mutual that contains pairs of people who share mutual feelings for each other (i. e., they consider each other friends or enemies). The schema of your view should be mutual(name1,name2).

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 23:40
Which slide should you change so it reflects om all sides of your presentation
Answers: 1
question
Computers and Technology, 25.06.2019 07:20
Acompany's intranet is set up on this type of server. application communication print web
Answers: 1
question
Computers and Technology, 25.06.2019 16:00
Cylinder heads with four valves flow more air than those with two valves because they
Answers: 1
question
Computers and Technology, 25.06.2019 20:30
Marco wants to create a heading that is bold and italic to make it really stand out on his webpage. he's typed in the code
Answers: 1
You know the right answer?
Consider a social network database about people and their relationships. The database has two relati...
Questions
question
History, 24.09.2019 19:00
Questions on the website: 13722360