Using the Online SQL Editor, answer the following questions with screenshots. Link: https://www.programiz.com/sql/online-compiler/  Customers customer_id first_name last_name age country 1 John Doe 31 USA 2 Robert Luna 22 USA 3 David Robinson 22 UK 4 John Reinhardt 25 UK 5 Betty Doe 28 UAE Orders order_id item amount customer_id 1 Keyboard 400 4 2 Mouse 300 4 3 Monitor 12000 3 4 Keyboard 400 1 5 Mousepad 250 2 Shippings shipping_id status customer 1 Pending 2 2 Pending 4 3 Delivered 3 4 Pending 5 5 Delivered 1 1. Join the Customer and Order Tables by presenting the last names and first names of customers while at the same  time showing the number of orders (count) each person had; Rename the number of orders (count) column as order_count; then, group the results via last name. Answer(screenshot of code & output from SQL Editor) 2. Show country column as well as the number of times (count) each country has appeared in the Customers table; Rename the “number of times each country has appeared” (count) column as Country_count. Answer(screenshot of code & output from SQL Editor) 3. Join the Customer and Order Tables by showing all customers who have made orders in the Orders table; Present the customer ID, Last name, and first name columns in the result. Answer(screenshot of code & output from SQL Editor) 4. Show all the distinct countries (from Customers table) as well as all distinct amounts (from Orders table) in one column; rename column as country_amount. Answer(screenshot of code & output from SQL Editor)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Using the Online SQL Editor, answer the following questions with screenshots.

Link: https://www.programiz.com/sql/online-compiler/ 

Customers

customer_id first_name last_name age country
1 John Doe 31 USA
2 Robert Luna 22 USA
3 David Robinson 22 UK
4 John Reinhardt 25 UK
5 Betty Doe 28 UAE

Orders

order_id item amount customer_id
1 Keyboard 400 4
2 Mouse 300 4
3 Monitor 12000 3
4 Keyboard 400 1
5 Mousepad 250 2

Shippings

shipping_id status customer
1 Pending 2
2 Pending 4
3 Delivered 3
4 Pending 5
5 Delivered 1

1. Join the Customer and Order Tables by presenting the last names and first names of customers while at the same  time showing the number of orders (count) each person had; Rename the number of orders (count) column as order_count; then, group the results via last name. Answer(screenshot of code & output from SQL Editor)

2. Show country column as well as the number of times (count) each country has appeared in the Customers table; Rename the “number of times each country has appeared” (count) column as Country_count. Answer(screenshot of code & output from SQL Editor)

3. Join the Customer and Order Tables by showing all customers who have made orders in the Orders table; Present the customer ID, Last name, and first name columns in the result. Answer(screenshot of code & output from SQL Editor)

4. Show all the distinct countries (from Customers table) as well as all distinct amounts (from Orders table) in one column; rename column as country_amount. Answer(screenshot of code & output from SQL Editor)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 7 steps with 5 images

Blurred answer
Knowledge Booster
Intermediate SQL concepts
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education