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. 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). Note that your view should not repeat the same pair of people in different order (e. g., (Alice, Bob) and (Bob, Alice)); your view should only keep the pair, such that the name with the lowest pid appears first.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:30
Selective incapacitation is a strategy to reduce prison population
Answers: 3
question
Computers and Technology, 24.06.2019 08:20
Evaluate the scenario below and indicate how to handle the matter appropriately. situation: michael received an e-mail from what he thought was his doctor’s office, requesting his social security number. since he had just been in to see his doctor last week, he replied to the e-mail with his social security number.
Answers: 2
question
Computers and Technology, 24.06.2019 17:30
Match the following. 1. formatting that is applied when cell data meets certain criteria 2. borders with formats not found on the border tool 3. a shortcut bar that contains tools for commonly used formats 4. formats that can be applied to numbers conditional formatting custom borders format bar number formats
Answers: 3
question
Computers and Technology, 25.06.2019 01:30
If the average computer chip had 1,200 transistors per square inch in 1970, approximately how many transistors per square inch would one have in 1976? use moore's law to calculate your answer
Answers: 1
You know the right answer?
Consider a social network database about people and their relationships. The database has two relati...
Questions
Questions on the website: 13722362