Write sql queries that allow the app to work

Assignment Help Database Management System
Reference no: EM132293131

Assignment: SQL

PROJECT

Case

You are the SQL programmer for a mental wellbeing app, which allows users to do two types of things. The first is to participate in a Twitter-style social network. The second is to do online units called Steps, which are interactive therapy modules designed to exercise and develop a range of psychological skills. Your job is to write SQL queries that allow the app to work.

The data model is as follows:

The Questions

1. List the full names (e.g. Alice Smith), as one column, of the users who have not taken any Steps yet.

2. List all of the IDs and titles of Steps that contain the substring ‘mindful' in their title.

3. Provide a list of the titles of all Steps completed by user with id = 17. Do not show duplicates (list each title only once).

4. Provide a list of the titles of all Steps that have been taken more than two times along with a count of how many times.

5. Which Step(s), listed with columns id, title and the count of times taken, have been taken the greatest number of times?

6. List each Step with the title column, along with a count of how many times that Step has been taken and the average rating received by the Step (formatted to 2 decimal places). Order the result by the average rating as a number in descending order.

7. Provide a list of the titles of all Steps that have been taken by both Alice (id = 1) and Bob (id == 2), along with the combined number of times they have taken the Step.

8. List users older than or equal to 21 years of age, along with a count of how many other users they are following and a count of how many other users are following them. List the user's id, first name, last name, age, following count and followed count, and order the results by first name ascending, then last name ascending.

9. For each (user, theme) pair such that user has taken some steps under the theme, provide a count of how many times a user has taken a step that is categorised under the theme. The output should consist of user ID, user first name, user last name, theme name and the count of steps taken.

For question 10, you can attempt one and only one of 10A or 10B:

10.

A) Provide a complete list of all user ID pairs such that the two users follow each other and share at least one interest. (Hint: MySQL has a CROSS JOIN operator, which returns the Cartesian product of rows from the joined tables)

B) A query that returns a row for each instance in which two users, x and y, share an interest z. The result should consist of user x ID, user x first name, user y ID, user y first name and the interest name. The returned results should be such that only one of (x, y) or (y, x) is returned; for example, if row [1, Alice, 2, Bob, Tennis] is in the result set, then [2, Bob, 1, Alice, Tennis] should not be.

Attachment:- Database Systems and Information Modelling.rar

Reference no: EM132293131

Questions Cloud

Million shares of stock outstanding : A firm currently has 8 million shares of stock outstanding that have a current market price of $18. If all else remains constant
How many shares will the company repurchase : How many shares will the company repurchase as a result of the debt issue? How many shares of common stock will remain after the repurchase?
Compute the? bond yield to maturity : a. Compute the? bond's yield to maturity. b. Determine the value of the bond to you given the? market's required yield to maturity on a? comparable-risk bond.
What is the yield to maturity on bond : a. What is the yield to maturity on this? bond? b. Should you purchase the bond if the yield to maturity on a? comparable-risk bond is 5 percent?
Write sql queries that allow the app to work : INFO90002 Database Systems and Information Modelling - The University of Melbourne - Your job is to write SQL queries that allow the app to work
Can financing decisions create value : Describe what it means to have strong, semistrong and weak efficiency in providing financial information to investors.
Calculate mean-mode and standard deviation of two options : Calculate the mean, mode, and standard deviation of the two options. Offer an analysis of the two options. Which do you recommend and why?
Find wacc and use as the discount rate : Find WACC and use as the discount rate to find the NPV. You have the following information regarding the firms' sources of financing:
Analyze the buyers-suppliers-substitutes and rivals : Identify and analyze the buyers, suppliers, substitutes, rivals, and potential entrants for the carbonated soft drink industry.

Reviews

len2293131

4/25/2019 3:07:58 AM

Submit a single PDF showing your ten answers to LMS by 6 pm on the due date of Friday 3rd, at the end of week 8. Ensure that you place your student number at the top of every page of your submission. For each question, present an answer in the following format: • Show the question number and question in black text. • Show your answer (the SQL statement) in blue text (not a screen shot) • Show a screenshot from Workbench showing output of 10 or fewer lines. • Show how many rows were returned, in red text

Write a Review

Database Management System Questions & Answers

  Knowledge and data warehousing

Design a dimensional model for analysing Purchases for Adventure Works Cycles and implement it as cubes using SQL Server Analysis Services. The AdventureWorks OLTP sample database is the data source for you BI analysis.

  Design a database schema

Design a Database schema

  Entity-relationship diagram

Create an entity-relationship diagram and design accompanying table layout using sound relational modeling practices and concepts.

  Implement a database of courses and students for a school

Implement a database of courses and students for a school.

  Prepare the e-r diagram for the movie database

Energy in the home, personal energy use and home energy efficiency and Efficient use of ‘waste' heat and renewable heat sources

  Design relation schemas for the entire database

Design relation schemas for the entire database.

  Prepare the relational schema for database

Prepare the relational schema for database

  Data modeling and normalization

Data Modeling and Normalization

  Use cases perform a requirements analysis for the case study

Use Cases Perform a requirements analysis for the Case Study

  Knowledge and data warehousing

Knowledge and Data Warehousing

  Stack and queue data structure

Identify and explain the differences between a stack and a queue data structure

  Practice on topic of normalization

Practice on topic of Normalization

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd