fbpx

Practice SQL SELECT Queries | ACDB

This page provides exercises and solutions to help you practice SQL SELECT queries. These exercises are based on the ACDB database, and may be performed online or by running the sample schema scripts on your local database server. For additional exercises in other subjects, use this link.
 

Simple SQL SELECT Queries – Practice

  1. Create a query to display all the data from the Customers table.
  2. The following SELECT statement executes successfully (True / False)
FROM Customers 
SELECT last_name , first_name
  1. Create a query to display the internet package number, internet speed and monthly payment (Packages table).
  2. The following SELECT statement executes successfully (True / False)
SELECT strt_date, monthly_payment
FROM   packages 
  1. The following SELECT statement executes successfully (True / False)
SeleCT        last_NAME , fiRST_NamE , FROM customers
  1. Create a query to display the customer number, first name, last name, primary phone number, secondary phone number and package number (Customers table).
  2. Create a query to display first name, last name, join date, monthly discount, monthly discount after an addition of 20% and monthly discount after a reduction of 20%  (Customers table).
  3. Create a query to display the package number, speed, strt_date (the date when the package became available), monthly payment, and monthly payment * 12, name the last column “YearlyPayment” (Packages table).
  4. Create a query to display the last name concatenated with the first name, separated by space, and main phone number concatenated with secondary phone number, separated by comma and space. Name the column heading FULL_NAME and CONTACT_DETAILS respectively. (Customers table)
  5. Create a query to display unique cities from the Customers table.
  6. Create a query to display unique states from the Customers table.
  7. Create a query to display unique combination of cities and states from Customers table.
  8. Create a query to display the last name concatenated with the state, separated by space. Name this column CUSTOMER_AND_STATE (Customers table)
  9. Create a query to display the first name, last name, monthly discount and city concatenated with street, separated by space.  Name the column headings: FN, LN, DC and FULL_ADDRESS respectively (Customers table).
  10. Create a query to display unique monthly discounts in Customers table.
  11. Create a query to display unique packages (package_id) in Customers table.

 

UpScale Analytics is one of the largest platforms in the world for learning SQL by doing, consisting over 300 SQL exercises at different levels (including solutions), by topics, across over 100 different datasets. More…