Design a database for a Social Media Website. • You only need to design the part of the database which manages Users, Friend Requests, and Stories. A user can send friend requests to other users. Once accepted, they become friends. The system should keep track of all current friend relationships (meaning, the system knows which two users are friends as of now). • A user can see all the current/historical friend requests he/she ever sent or received. The user can either accept or reject requests he/she received. The system should store when a friend request was created / accepted or rejected. • A user can post any text as Stories. To make it simple, assume: o A Story only contains a piece of text. o Users can only post Stories on their own homepage. The posted Story can then be seen by anyone who visits the user's homepage. A user can like any Story posted by any user (including Stories posted by himself/herself). Draw a conceptual schema by finishing the following design (you don't need to add any more Entities besides the three given Entities): ?22 Please design the relationship(s) between User and FriendRequest s a friend of User FriendRequest post Story Convert the schema you designed in (1) to a relational schema.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Need help drawing a conceptual schema and a relational schema (Data bases) 

**Designing a Database for a Social Media Website**

This guide focuses on designing a database segment that handles *Users*, *Friend Requests*, and *Stories*. Below are the key elements to consider:

### Key Points:
- **Users** can send and accept friend requests from other users.
- Once a friend request is accepted, the system recognizes them as friends.
- The database should track all current and historical friend relationships and requests, including when requests are created, accepted, or rejected.

### Features:
- **Post Stories**: 
  - Stories are text-only posts.
  - Users can only post stories on their own homepage.
  - Stories are visible to anyone visiting the user's homepage.
- **Like Stories**: 
  - Users can like any story posted by any user, including their own.

### Conceptual Schema Design
You need to complete the schema by defining relationships within this structure. Here’s the starting design:

- **Entities**:
  - **User**
  - **FriendRequest**
  - **Story**

- **Relationships**:
  - Between **User** and **FriendRequest**: Design how users send, accept, reject, and receive friend requests.
  - Between **User** and **Story**: Users post stories, and this relation should reflect that capability.

### Graph Explanation:
The diagram shows three main entities: 

1. **User**: 
   - Interacts with itself through friend relationships.
   - Posts stories and interacts with stories.
   
2. **FriendRequest**: 
   - Requires defining its relationship with Users for sending and managing requests.

3. **Story**: 
   - Is posted by Users and can record interactions like likes.

### Relational Schema Conversion
Translate the conceptual schema you've crafted into a relational schema for implementation. Define tables, columns, and their relationships suited for database architecture.

Considerations include:
- Primary keys for each entity.
- Foreign keys for establishing relationships.
- Attributes to store additional details like timestamps for friend requests and story interactions. 

This structured approach creates a robust, scalable foundation for the social media platform, focusing on user interaction, content sharing, and connection management.
Transcribed Image Text:**Designing a Database for a Social Media Website** This guide focuses on designing a database segment that handles *Users*, *Friend Requests*, and *Stories*. Below are the key elements to consider: ### Key Points: - **Users** can send and accept friend requests from other users. - Once a friend request is accepted, the system recognizes them as friends. - The database should track all current and historical friend relationships and requests, including when requests are created, accepted, or rejected. ### Features: - **Post Stories**: - Stories are text-only posts. - Users can only post stories on their own homepage. - Stories are visible to anyone visiting the user's homepage. - **Like Stories**: - Users can like any story posted by any user, including their own. ### Conceptual Schema Design You need to complete the schema by defining relationships within this structure. Here’s the starting design: - **Entities**: - **User** - **FriendRequest** - **Story** - **Relationships**: - Between **User** and **FriendRequest**: Design how users send, accept, reject, and receive friend requests. - Between **User** and **Story**: Users post stories, and this relation should reflect that capability. ### Graph Explanation: The diagram shows three main entities: 1. **User**: - Interacts with itself through friend relationships. - Posts stories and interacts with stories. 2. **FriendRequest**: - Requires defining its relationship with Users for sending and managing requests. 3. **Story**: - Is posted by Users and can record interactions like likes. ### Relational Schema Conversion Translate the conceptual schema you've crafted into a relational schema for implementation. Define tables, columns, and their relationships suited for database architecture. Considerations include: - Primary keys for each entity. - Foreign keys for establishing relationships. - Attributes to store additional details like timestamps for friend requests and story interactions. This structured approach creates a robust, scalable foundation for the social media platform, focusing on user interaction, content sharing, and connection management.
Expert Solution
Step 1

We were given to design a database for social media website.Some of the conditions to represent relationships between user and FriendRequest .A user and is a friend of has one-to-one relationship.For user,post and story the relation is one-to-N.The empty condition for the right side of user is "can like".The relation for user,can like and story is N-to-N relation.

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY