Computers and Technology

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*

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 02:00, ahmedislife
Alocal reaction will occur at the site of the exposure such as irritation or damage to the skin eye or local reaction will occur at the site of the exposure such as irritation or damage to the skin ireland lounges
Answers: 3
image
Computers and Technology, 23.06.2019 06:30, Knownothing
When early motion pictures played in movie theaters, they were often accompanied by live organ or piano music. which of the following are the most likely reasons that this happened? (select all that apply). the music was provided to distract audience members from the loud sounds made when filmstrips were changed. the music accompanied the movies because the movies were silent and audiences were used to hearing music during plays in theaters. the music usually was played before, and sometimes after the movie, as an alternative form of entertainment. the music viewers to interpret the dramatic action in the films.
Answers: 2
image
Computers and Technology, 24.06.2019 02:40, homework1911
Has anyone seen my grandma shes been gone for 4 years already
Answers: 1
image
Computers and Technology, 24.06.2019 04:10, kris1920
Write a program that reads a set of floating-point values. ask the user to enter the values, then print • the average of the values. • the smallest of the values. • the largest of the values. • the range, that is the difference between the smallest and largest. of course, you may only prompt for the values once.
Answers: 3
Do you know the correct answer?
Consider a social network database about people and their relationships. The database has two relati...

Questions in other subjects:

Konu
Mathematics, 04.02.2020 09:55