Write relational schema for the diagram.

Write relational schema for the diagram

SUMMARY

The relational schema for the diagram includes 10 relational tables for the given 10 entities and there are no extra tables needed for any relation. Adding attributes to any relational table for the relations is not needed since the foreign keys are already included in the given ER diagram to relate each table with the other.

 

EXPLANATION

relational schema for the diagram:

User(User_ID , FirstName , LastName , School , Address , email , PhoneNo. , Location , DateOfBirth , Gender)

Friends(Friends_ID , User_ID)

Pages(Page_ID , PageName , PageComntent)

PageLines(User_ID , Page_ID)

Posts(Post_ID , User_ID , PostContent , PostData)

PostLikes(Post_ID , User_ID)

Photos(PhotO_ID , Post_ID , ImageContent)

Shares(Post_ID , User_ID)

Comments(Comment_ID , Post_ID , CommentDate , User_ID, CommentContent)

CommentLikes(Comment_ID , User_ID)

 

a) The ER diagram will have a relational schema consisting of 10 relational tables. 

b) There is a many-to-many relationship between User and Friends and User and Pages. There is also a relation between Friend_ID and User_ID in the Friends table itself. The same is with the Pages table and PageLikes table.

c) A one-to-many relationship between Pages and PageLikes exists and the primary key of the Pages table (PageID) is present in the PageLikes table.

d) The required foreign key to supporting all the relationships is already present in all the entities and therefore no changes are made. 

 

Also, read which command will you use to call a function?

 

Share this post

Leave a Reply

Your email address will not be published. Required fields are marked *