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. Q1: 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. Submit your statement in file Q1.sql.
Q2: Create a user called matchmaker, and give this user read access to your mutual view from Q1
*only looking for answer to Q2, included Q1 for context*

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 19:30
Which of the following are types of formatting you can apply to a spreadsheet? choose all that apply.
Answers: 3
question
Computers and Technology, 21.06.2019 20:20
Wireless communications is likely to be viewed as an essential part of an enterprise network infrastructure when: select one: a. mobile communication is needed b. communication facilities must be installed at low initial cost c. communication must take place in a hostile or difficult terrain that makes wired communication difficult or impossible d. the same information must be broadcast to many locations
Answers: 1
question
Computers and Technology, 23.06.2019 00:20
The open systems interconnection (osi) reference model: defines standards for many aspects of computing and communications within a network. is a generic description for how computers use multiple layers of protocol rules to communicate across a network. defines standards for wireless local area network (wlan) communication protocols. details the advantages and disadvantages of various basic network cabling options.
Answers: 1
question
Computers and Technology, 23.06.2019 08:30
Helen's credit card has an apr of 15.32% and a grace period of 17 days and helen pays her balance in the full every month. if her last billing cycle ended on september 26, 2009, and she made her payment on october 11, 2009, did she owe any interest on her last statement's balance?
Answers: 3
You know the right answer?
Consider a social network database about people and their relationships. The database has two relati...
Questions
question
Mathematics, 17.01.2022 14:00
question
Mathematics, 17.01.2022 14:00
question
Health, 17.01.2022 14:00
question
Mathematics, 17.01.2022 14:00
question
Mathematics, 17.01.2022 14:00
Questions on the website: 13722359