Question

Consider the SOCIAL NETWORK relational database schema description provided below which is used to manage a...

Consider the SOCIAL NETWORK relational database schema description provided below which is used to manage a social network, where:

- Persons are the users -

They can have friends (a friend relation is symmetric meaning that if person1 is friend of person2, the person2 is automatically friend of person1)

- They can post multiple posts on his wall or in other friend’s wall

- They can like posts with different types of likes: like, love, fun, wow, sad or angry. Only one like per post and user. (no need to be friend to like a post). Note: LikeType is a numeric ID and the LikeName is “like” or “wow” or “fun”...

- Then can comment posts, they can comment more than one time in the same post. (no need to be friend to comment a post)

- They can send multiple private messages to other people, that will be marked as read when the receiver opens the message.

- Note, datetime is stored in milliseconds, so it is not possible to post 2 or more posts , make 2 or more comments or send 2 or more private messages in the same exact time by the same user.

The relations are: ● PERSON (NickName, FullName, BirthDate) ● POST (PostID, PersonNick, WallPersonNick, Datetime, Content) ● FRIENDS (PersonNick1, PersonNick2) ● LIKE (PostID, PersonNick, Datetime, Type) ● LIKETYPE(LikeType, LikeName) ● COMMENT (CommentID, PostID, PersonNick, Datetime, Text) ● PRIVATE_MESSAGE (MessageID, PersonNick1, PersonNick2, Datetime, Text, Read)

Write the following queries in relational algebra using the schema provided above

(e) Retrieve the names of all the Persons who have at least a post without likes and without

comments.

(f) Find all persons that liked any post created by “Mike_34” but none of the posts created

by anyone named “Margaret Lind”.

(g) Find the nicknames that have all the different types of likes on their posts

0 0
Add a comment Improve this question Transcribed image text
Answer #1

(e)

\piFullName ( PERSON \Join NickName = PersonNick POST \Join PostID != PostID LIKE \Join PostID != PostID COMMENT)

(f)

\piFullName ( POST.PersonNick = 'Mike_34' and POST.PersonNick != 'Margaret Lind' (PERSON \Join NickName = PersonNick LIKE \Join PostID = PostIDPOST )

(g)

\piNickName ( LikeName = 'like' and LikeName = 'love' and LikeName =' fun' and LikeName ='wow' and LikeName ='sad' and LikeName = 'angry' (PERSON \Join NickName = PersonNick POST \Join PostID != PostID LIKE \Join Type = LikeType LIKETYPE)

Do ask if any doubt. Pleas eupvote.

Add a comment
Know the answer?
Add Answer to:
Consider the SOCIAL NETWORK relational database schema description provided below which is used to manage a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Project Description In this project, you will design and implement a database for keeping track of...

    Project Description In this project, you will design and implement a database for keeping track of information for an online “SOCIAL NETWORK” system (e.g. a simplified version of Facebook!). You will first design an EER schema diagram for this database application. Then, you will map the EER schema into a relational database schema and implement it on ORACLE or MySQL or some other relational DBMS. Finally, you will load some data into your database (via user Interface) and create some...

  • Putting Your Best Cyberface Forward By STEPHANIE ROSENBLOOMJAN. 3, 2008 your nails? Have you pierced your...

    Putting Your Best Cyberface Forward By STEPHANIE ROSENBLOOMJAN. 3, 2008 your nails? Have you pierced your tongue? Is your tote bag emblazoned with the words "I'm not a plastic bag"? at the way they do for reasons too numerous to fit into any therapist's notebook. Yet we commonly shape People look and act the way they do for reasons too ir behavior or tweak our appearance in an attempt to control how others perceive us i m mon sense. Social...

  • Please see the articles below… 1.  What is your opinion on the subject? 2.  Which ethical views (i.e.,...

    Please see the articles below… 1.  What is your opinion on the subject? 2.  Which ethical views (i.e., utilitarian view, moral rights view, justice view, practical view) you feel are being used by both sides of the argument (i.e., for and against downloading) to justify their positions? High Court Enters File-Sharing Spat; Justices Must Determine Software Providers' Liability For Copyright Violations by Anne Marie Squeo. Wall Street Journal. (Eastern edition). New York, N.Y.: Mar 30, 2005. pg. A.2 WASHINGTON -- The Supreme...

  • And there was a buy-sell arrangement which laid out the conditions under which either shareholder could...

    And there was a buy-sell arrangement which laid out the conditions under which either shareholder could buy out the other. Paul knew that this offer would strengthen his financial picture…but did he really want a partner?It was going to be a long night. read the case study above and answer this question what would you do if you were Paul with regards to financing, and why? ntroductloh Paul McTaggart sat at his desk. Behind him, the computer screen flickered with...

  • Identify 8 issues in regards to Recruitment and Selection, 3 issues for Labour Relation in the...

    Identify 8 issues in regards to Recruitment and Selection, 3 issues for Labour Relation in the following case study : You have recently been hired as an HR Consultant in the new HR Department of Outrage Video Games. Outrage is a five year old, upstart company, run by two very bright young men - Will Bates – President, and his best friend Steve Cobbs, Vice President. This is a very exciting change for you because Outrage, which literally started in...

  • Develop a case study analysis in the following format Relevance of the case study to my...

    Develop a case study analysis in the following format Relevance of the case study to my work environment - application - learning impact CASE 4-1 Tambrands Overcoming Cultural Resistance Tampax, Tambrands's only product, is the best-selling tampon in their virginity if they use a tampon. When they go to the beach in the world, with 44 pencent of the global market North America and tiny bikinis, tampons arent their choike. Instead, hordes of women Europe account for 90 percent of...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT