Professional Documents
Culture Documents
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)