Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Question 18 8 Points The marketing department has requested your help to create a report that returns the average age of users by their country

image text in transcribedimage text in transcribed
Question 18 8 Points The marketing department has requested your help to create a report that returns the average age of users by their country of origin from the LSI Social Media database; see the diagram below. Post User Pid INT Comment P id INT text VARCHAR(280) ? id INT name VARCHAR(128) H creation_date DATETIME # text VARCHAR(280) likes INT creation_date DATETIME email VARCHAR(320) author_id INT likes INT username VARCHAR(128) Indexes post_id INT password VARCHAR(32) author_id INT city VARCHAR(45) Indexes country VARCHAR(45) Community time_zone VARCHAR(45) id INT ip_address VARCHAR(45) name VARCHAR(32) date_of_birth DATE #followers INT job VARCHAR(45) description VARCHAR(128) phone_number VARCHAR(45) creation_date DATETIME Indexes Indexes Friendship Community_has_User friend_a_id INT Community_id INT 1 friend_b_id INT User_id INT creation_date DATETIME Indexes Indexes Your job is to create a report that returns the information as described in the screen capture below. Note that the complete result returns information for all 122 countries without listing 'country' in alphabetical order; hence your SQL statement should not include ORDER BY.returns information for all 122 countries without listing 'country' in alphabetical order; hence your SQL statement should not include ORDER BY. A B 1 country avg(2022-year(date_of_birth)) AF 11 3 AM 32 AO 67.4 5 AR 47.4167 6 AT 48 7 AU 56.4545 8 AZ 106.5 9 BA 101.5 10 39.8 11 BE 64.5 12 BG 44.6667 13 BO 87 14 BR 55.8462 BY 69.8 16 CA 55.3333 17 CD 64.6667 Complete the below SQL statement to obtain the desired report. Important note: follow recommended letter casing (e.g., uppercase) to receive credit SELECT Blank 1, Blank 2(2022-YEAR(date_of_birth)) FROM Blank 3 Blank 4 BY Blank 5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Cornerstones of Financial Accounting

Authors: Jay Rich, Jeff Jones

4th edition

978-1337690898

Students also viewed these General Management questions