本次作业是来自英国的关于一个Mango & Neo4J相关的数据库代写assignment
Created in 2008, Stack Overflow is a website for questions and answers relating to programming and other computer science questions. (https://stackoverflow.com/)
Users are required to create an account to ask or answer questions. These accounts include a chosen screen name and any details that a user wants to share, such as experience,website, and favoured programming languages. To incentivise participation, users are awarded with points and badges when asking interesting questions or providing useful answers. “Upvotes” and “downvotes” can be provided to questions and answers alike to indicate usefulness. The person who posts a question is also able to select a single answer as their accepted answer. These metrics are combined and referred to as the user’s reputation.
You will have access to a sample data set from Stack Overflow. This is publicly available data that has been collected from 2008. The sample contains 200 users selected at random, as well as questions, answers, badges, and comments associated with the selected users. Note that the data is not complete, for example not all questions will have answers and vice versa, unless they were posted by one of the users selected for this sample.
A more detailed explanation of the data set is given as an appendix to this document.
Question 1: (25 marks)
In the appendix, you will find instructions to import the dataset provided and to create a mongo database, called, “database_A”. The database you create can be considered as normalised, as each of the entities are stored in a separate collection. Please follow the instructions to create this database.
1. Design an alternative “embedded” data model for this dataset and create a new database (database_B) that implements this data model and stores all the data provided.
In the report describe the designed data model and include the queries you used to create it and samples from the database to illustrate the created structures.
2. Write the following queries once against database_A and again against database_B.
In the report, include the query you used, the number of results you obtained and a sample data set (e.g. limit 20 records) to illustrate the execution of the query.
i. Find all users who achieved the “Fanatic” badge.
(Project the user id, user display name, the badge name, and the date the badge was awarded.)
(1.5 mark for database_A and 1.5 mark for database_B)
ii. For all those users who achieved the “Nice Question” badge after 1st January 2020, find the “Questions” they posted.
(Project the user id, user display name, the badge name and the date the badge was awarded, question id and question title).
(2 marks for database_A and 2 marks for database_B)
iii. For the same users in part ii, find the “Comments” related to the “Questions” they posted.
(Project the user id, user display name, the badge name and the date the badge was awarded, question id, question title and comment id).
(2.5 marks for database A and 2.5 marks for database_B)