You are on page 1of 2

Database Systems

Social Network Website Database


Project 15%
A social network website allows different users to interact, share certain information with each
other and post to general audience.
The two basic features or modules in the social network website are the profile management and
friends organization.
Each user can create a profile the profile must include his name, contact information, date created,
login details, profile picture and other features.
A user can follow other users and can be followed by them or not.
A user can send messages to other users and the messages must be stored and contain the date and
time sent.
The user can post small text posts.
The other users can see the posts if they follow the post owner. The viewed times is also stored for
each post. The other users can also agree or disagree (like or dislike) the post and add comments on
it.
The user can create or join a group. The group must have a name, category and an administrator.
Each user can join many groups.

Steps to be done
Step 1: Data Modeling - Create an ER diagram,
Step 2: Map ER diagram into a relational model,
Step 3: Put the tables which you have mapped in the 3rd normal form,
Step 4: Create the tables and fill them with few records,
Step 5: SQLQueries

Database Systems

SQL Queries
1. List the posts added by a certain user in a certain year.
2. List all the comment(s) on a certain post.
3. Give the number of views of a certain post.
4. Give the number of agrees and disagrees of a certain post.
5. Give the number of followers and followed users of a certain user.
6. List the names of followers of a certain user.
7. List the names of followed users of a certain user.
8. List the last ten messages.
9. For two certain users List all the messages history.
10. For each user list the name of joined groups ordered by date joined.
11. For each group list the name of all its members.
Write 5 additional queries that you find useful for this application. The queries should be
complex queries easy (include union, intersection, difference)

You might also like