Simple Subquery

Easy
5
80.0% Acceptance

Welcome to this SQL lab, designed to test your querying skills using the Chinook database. The lab uses SQLite, and you will work with tables from the Chinook dataset, including "Invoice", "Artist", "Album", among others. Below are the challenges you need to complete.

Instructions

  • Your task is to write SQL queries to solve the challenges. Make sure to read each challenge carefully.
  • Please make sure to use exact table and column names as defined in the Chinook database schema.
  • Always include "ORDER BY" clauses when instructed, to ensure the output matches the expected results.
  • Use double quotes around column and table names for clarity.

Challenge

Table Used: Invoice
Task: Find all invoices where the 'Total' amount is greater than the average 'Total' across all invoices.
Final Columns to Display: InvoiceId, Total
Ordering: The results should be ordered by InvoiceId. To ensure that your query matches the expected output, please name all the columns explicitly in your SELECT statement and use the ORDER BY clause to sort the results by InvoiceId.

To ensure your solutions match the expected output, be very cautious about naming and the use of quotes, especially for column names and table names.