Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Join Tables and Return Matches

EasySQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is Join Tables and Return Matches. Start with the requirements and the one table on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

Microsoft wants a clean list of Surface products currently available for sale. Write a PostgreSQL query that returns the product records matching the required product line and availability criteria.

Requirements

  1. Return products where product_line is Surface and availability is Available.
  2. Return the product ID, name, product line, availability, and list price, sorted alphabetically by product name.

Schema

surface_products
ColumnTypeDescription
product_idPKINTEGERUnique product identifier
product_nameVARCHAR(100)Product display name
product_lineVARCHAR(50)Microsoft product family
availabilityVARCHAR(30)Current sales availability
list_priceNUMERIC(10,2)Product price in US dollars
Tablessurface_products
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results