Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Given the three tables, write out what you think the output would be if the SQL code were executed. User ID 1 2 3 email
Given the three tables, write out what you think the output would be if the SQL code were executed.
User ID 1 2 3 email john@gmail.com tom@gmail.com sarah@gmail.com nicole@gmail.com tim@gmail.com name john tom sarah nicole time 4 5 Devices ID 1 2 3 4 5 User_id 3 3 1 desc mobile macbook mobile pc mobile active yes yes no 4 no 4 yes File ID 1 2 3 4 5 User_id 3 3 3 4 4 File_type photo doc Mp3 photo photo File_name Selfie.jpg Todo.docx Song 1.mp3 Vacation 1.jpg Vacation2.jpg Given the data in the tables and the SQL query below, what would the output look like? 1. SELECT File_type Count(file_name) as count_of_files FROM files f JOIN user u on u.id = f.user_id WHERE u.id = 3 GROUP BY file_type 2. SELECT desc, count(ID) as ID_count FROM Devices Group by desc Order by ID_count DESC User ID 1 2 3 email john@gmail.com tom@gmail.com sarah@gmail.com nicole@gmail.com tim@gmail.com name john tom sarah nicole time 4 5 Devices ID 1 2 3 4 5 User_id 3 3 1 desc mobile macbook mobile pc mobile active yes yes no 4 no 4 yes File ID 1 2 3 4 5 User_id 3 3 3 4 4 File_type photo doc Mp3 photo photo File_name Selfie.jpg Todo.docx Song 1.mp3 Vacation 1.jpg Vacation2.jpg Given the data in the tables and the SQL query below, what would the output look like? 1. SELECT File_type Count(file_name) as count_of_files FROM files f JOIN user u on u.id = f.user_id WHERE u.id = 3 GROUP BY file_type 2. SELECT desc, count(ID) as ID_count FROM Devices Group by desc Order by ID_count DESCStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started