Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment 2 Relational Algebra Points: 50 Instructions: For this assignment you must submit a document file (in pdf or doc format) with answers to the

image text in transcribed

Assignment 2 Relational Algebra Points: 50 Instructions: For this assignment you must submit a document file (in pdf or doc format) with answers to the following questions. PART 1 (15 points): Consider the SOCIAL NETWORK relational database schema description provided below which is used to manage a social network, where: Persons are the users of the social network They can have friends (a friend relation is symmetric meaning that if person 1 is friend of person2, the person is automatically friend of person1) They can post multiple posts on his wall or in any other friend's wall The Posts have a PostID. It will be a numeric value that will start from 1 for EACH person, (the first post that a person posts will have always postid = 1) and will be incremented by one for each new post of that person. That means that two posts from different persons can have the same PostID They can like posts with different types of likes: like, love, fun, wow, sad or angry. Only one "like" per post and user. Note: Like Type is a numeric ID and the LikeName is "like" or "wow" or "fun"... They can comment on the posts, they can comment more than one time in the same 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 (PersonNick, FullName, BirthDate) POST (PostID, PostPersonNick, WallPersonNick, Datetime, Content) FRIENDS (PersonNick 1, PersonNick2) LIKE (PostID, PostPersonNick, LikePersonNick, Datetime, Type) LIKETYPE(Like Type, LikeName) COMMENT (CommentID, PostID, PostPersonNick, Comment PersonNick Datetime, Text) PRIVATE MESSAGE (MessageID, SenderPersonNick, ReceiverPersonNick, Datetime, Text, Read) (a) (5 points) Give a primary key for each relation. Are there any relations for which there is an altemate candidate key that you have not chosen as the primary key? If yes, mention the relations, candidate keys and the reason (if any) for your choice of the primary key (b) (2.5 points) How would you change the previous answer (candidate keys and primary keys) if the datetime attribute, instead store the exact instant with milliseconds... only stored the day month and year (allowing a user to have more than one post in the same day, or comments etc...). Explain your answer. (c) (7.5 points) State all referential integrity constraints that should hold on these relations

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M. Ricardo

1st Edition

0763733148, 978-0763733148

More Books

Students also viewed these Databases questions

Question

What are the benefits of the new IT architecture?

Answered: 1 week ago

Question

What is process enactment?

Answered: 1 week ago

Question

Define promotion.

Answered: 1 week ago

Question

Write a note on transfer policy.

Answered: 1 week ago

Question

Discuss about training and development in India?

Answered: 1 week ago

Question

Explain the various techniques of training and development.

Answered: 1 week ago

Question

How would you typify the trends of trade unionism internationally?

Answered: 1 week ago