Northwind › SQL Console
SQL Console
Type a SELECT and run it against the Northwind database. This is SQLite 3.45, so SQLite's own functions, window functions, recursive CTEs, EXPLAIN QUERY PLAN and PRAGMA table_info(…) all work. Table names that contain a space need double quotes: "Order Details".
Result
| ShipName | ShipAddress | ShipCity | ShipRegion | ShipPostalCode | ShipCountry | CustomerID | CustomerName | Address | City | Region | PostalCode | Country | Salesperson | OrderID | OrderDate | RequiredDate | ShippedDate | ShipperName | ProductID | ProductName | UnitPrice | Quantity | Discount | ExtendedPrice | Freight |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Alfreds Futterkiste | Obere Str. 57 | Berlin | NULL | 12209 | Germany | ALFKI | Alfreds Futterkiste | Obere Str. 57 | Berlin | NULL | 12209 | Germany | Michael Suyama | 10643 | 1997-08-25 | 1997-09-22 | 1997-09-02 | Speedy Express | 28 | Rössle Sauerkraut | 45.6 | 15 | 0.25 | 513.0 | 29.46 |
| Alfreds Futterkiste | Obere Str. 57 | Berlin | NULL | 12209 | Germany | ALFKI | Alfreds Futterkiste | Obere Str. 57 | Berlin | NULL | 12209 | Germany | Michael Suyama | 10643 | 1997-08-25 | 1997-09-22 | 1997-09-02 | Speedy Express | 39 | Chartreuse verte | 18.0 | 21 | 0.25 | 283.5 | 29.46 |
| Alfreds Futterkiste | Obere Str. 57 | Berlin | NULL | 12209 | Germany | ALFKI | Alfreds Futterkiste | Obere Str. 57 | Berlin | NULL | 12209 | Germany | Michael Suyama | 10643 | 1997-08-25 | 1997-09-22 | 1997-09-02 | Speedy Express | 46 | Spegesild | 12.0 | 2 | 0.25 | 18.0 | 29.46 |
| Alfred's Futterkiste | Obere Str. 57 | Berlin | NULL | 12209 | Germany | ALFKI | Alfreds Futterkiste | Obere Str. 57 | Berlin | NULL | 12209 | Germany | Margaret Peacock | 10692 | 1997-10-03 | 1997-10-31 | 1997-10-13 | United Package | 63 | Vegie-spread | 43.9 | 20 | 0.0 | 878.0 | 61.02 |
| Alfred's Futterkiste | Obere Str. 57 | Berlin | NULL | 12209 | Germany | ALFKI | Alfreds Futterkiste | Obere Str. 57 | Berlin | NULL | 12209 | Germany | Margaret Peacock | 10702 | 1997-10-13 | 1997-11-24 | 1997-10-21 | Speedy Express | 3 | Aniseed Syrup | 10.0 | 6 | 0.0 | 60.0 | 23.94 |
| Alfred's Futterkiste | Obere Str. 57 | Berlin | NULL | 12209 | Germany | ALFKI | Alfreds Futterkiste | Obere Str. 57 | Berlin | NULL | 12209 | Germany | Margaret Peacock | 10702 | 1997-10-13 | 1997-11-24 | 1997-10-21 | Speedy Express | 76 | Lakkalikööri | 18.0 | 15 | 0.0 | 270.0 | 23.94 |
| Alfred's Futterkiste | Obere Str. 57 | Berlin | NULL | 12209 | Germany | ALFKI | Alfreds Futterkiste | Obere Str. 57 | Berlin | NULL | 12209 | Germany | Nancy Davolio | 10835 | 1998-01-15 | 1998-02-12 | 1998-01-21 | Federal Shipping | 59 | Raclette Courdavault | 55.0 | 15 | 0.0 | 825.0 | 69.53 |
| Alfred's Futterkiste | Obere Str. 57 | Berlin | NULL | 12209 | Germany | ALFKI | Alfreds Futterkiste | Obere Str. 57 | Berlin | NULL | 12209 | Germany | Nancy Davolio | 10835 | 1998-01-15 | 1998-02-12 | 1998-01-21 | Federal Shipping | 77 | Original Frankfurter grüne Soße | 13.0 | 2 | 0.2 | 20.8 | 69.53 |
| Alfred's Futterkiste | Obere Str. 57 | Berlin | NULL | 12209 | Germany | ALFKI | Alfreds Futterkiste | Obere Str. 57 | Berlin | NULL | 12209 | Germany | Nancy Davolio | 10952 | 1998-03-16 | 1998-04-27 | 1998-03-24 | Speedy Express | 6 | Grandma's Boysenberry Spread | 25.0 | 16 | 0.05 | 380.0 | 40.42 |
| Alfred's Futterkiste | Obere Str. 57 | Berlin | NULL | 12209 | Germany | ALFKI | Alfreds Futterkiste | Obere Str. 57 | Berlin | NULL | 12209 | Germany | Nancy Davolio | 10952 | 1998-03-16 | 1998-04-27 | 1998-03-24 | Speedy Express | 28 | Rössle Sauerkraut | 45.6 | 2 | 0.0 | 91.2 | 40.42 |
| Alfred's Futterkiste | Obere Str. 57 | Berlin | NULL | 12209 | Germany | ALFKI | Alfreds Futterkiste | Obere Str. 57 | Berlin | NULL | 12209 | Germany | Janet Leverling | 11011 | 1998-04-09 | 1998-05-07 | 1998-04-13 | Speedy Express | 58 | Escargots de Bourgogne | 13.25 | 40 | 0.05 | 503.5 | 1.21 |
| Alfred's Futterkiste | Obere Str. 57 | Berlin | NULL | 12209 | Germany | ALFKI | Alfreds Futterkiste | Obere Str. 57 | Berlin | NULL | 12209 | Germany | Janet Leverling | 11011 | 1998-04-09 | 1998-05-07 | 1998-04-13 | Speedy Express | 71 | Flotemysost | 21.5 | 20 | 0.0 | 430.0 | 1.21 |
| Ana Trujillo Emparedados y helados | Avda. de la Constitución 2222 | México D.F. | NULL | 05021 | Mexico | ANATR | Ana Trujillo Emparedados y helados | Avda. de la Constitución 2222 | México D.F. | NULL | 05021 | Mexico | Robert King | 10308 | 1996-09-18 | 1996-10-16 | 1996-09-24 | Federal Shipping | 69 | Gudbrandsdalsost | 28.8 | 1 | 0.0 | 28.8 | 1.61 |
| Ana Trujillo Emparedados y helados | Avda. de la Constitución 2222 | México D.F. | NULL | 05021 | Mexico | ANATR | Ana Trujillo Emparedados y helados | Avda. de la Constitución 2222 | México D.F. | NULL | 05021 | Mexico | Robert King | 10308 | 1996-09-18 | 1996-10-16 | 1996-09-24 | Federal Shipping | 70 | Outback Lager | 12.0 | 5 | 0.0 | 60.0 | 1.61 |
| Ana Trujillo Emparedados y helados | Avda. de la Constitución 2222 | México D.F. | NULL | 05021 | Mexico | ANATR | Ana Trujillo Emparedados y helados | Avda. de la Constitución 2222 | México D.F. | NULL | 05021 | Mexico | Janet Leverling | 10625 | 1997-08-08 | 1997-09-05 | 1997-08-14 | Speedy Express | 14 | Tofu | 23.25 | 3 | 0.0 | 69.75 | 43.9 |
| Ana Trujillo Emparedados y helados | Avda. de la Constitución 2222 | México D.F. | NULL | 05021 | Mexico | ANATR | Ana Trujillo Emparedados y helados | Avda. de la Constitución 2222 | México D.F. | NULL | 05021 | Mexico | Janet Leverling | 10625 | 1997-08-08 | 1997-09-05 | 1997-08-14 | Speedy Express | 42 | Singaporean Hokkien Fried Mee | 14.0 | 5 | 0.0 | 70.0 | 43.9 |
| Ana Trujillo Emparedados y helados | Avda. de la Constitución 2222 | México D.F. | NULL | 05021 | Mexico | ANATR | Ana Trujillo Emparedados y helados | Avda. de la Constitución 2222 | México D.F. | NULL | 05021 | Mexico | Janet Leverling | 10625 | 1997-08-08 | 1997-09-05 | 1997-08-14 | Speedy Express | 60 | Camembert Pierrot | 34.0 | 10 | 0.0 | 340.0 | 43.9 |
| Ana Trujillo Emparedados y helados | Avda. de la Constitución 2222 | México D.F. | NULL | 05021 | Mexico | ANATR | Ana Trujillo Emparedados y helados | Avda. de la Constitución 2222 | México D.F. | NULL | 05021 | Mexico | Janet Leverling | 10759 | 1997-11-28 | 1997-12-26 | 1997-12-12 | Federal Shipping | 32 | Mascarpone Fabioli | 32.0 | 10 | 0.0 | 320.0 | 11.99 |
| Ana Trujillo Emparedados y helados | Avda. de la Constitución 2222 | México D.F. | NULL | 05021 | Mexico | ANATR | Ana Trujillo Emparedados y helados | Avda. de la Constitución 2222 | México D.F. | NULL | 05021 | Mexico | Margaret Peacock | 10926 | 1998-03-04 | 1998-04-01 | 1998-03-11 | Federal Shipping | 11 | Queso Cabrales | 21.0 | 2 | 0.0 | 42.0 | 39.92 |
| Ana Trujillo Emparedados y helados | Avda. de la Constitución 2222 | México D.F. | NULL | 05021 | Mexico | ANATR | Ana Trujillo Emparedados y helados | Avda. de la Constitución 2222 | México D.F. | NULL | 05021 | Mexico | Margaret Peacock | 10926 | 1998-03-04 | 1998-04-01 | 1998-03-11 | Federal Shipping | 13 | Konbu | 6.0 | 10 | 0.0 | 60.0 | 39.92 |
| Ana Trujillo Emparedados y helados | Avda. de la Constitución 2222 | México D.F. | NULL | 05021 | Mexico | ANATR | Ana Trujillo Emparedados y helados | Avda. de la Constitución 2222 | México D.F. | NULL | 05021 | Mexico | Margaret Peacock | 10926 | 1998-03-04 | 1998-04-01 | 1998-03-11 | Federal Shipping | 19 | Teatime Chocolate Biscuits | 9.2 | 7 | 0.0 | 64.4 | 39.92 |
| Ana Trujillo Emparedados y helados | Avda. de la Constitución 2222 | México D.F. | NULL | 05021 | Mexico | ANATR | Ana Trujillo Emparedados y helados | Avda. de la Constitución 2222 | México D.F. | NULL | 05021 | Mexico | Margaret Peacock | 10926 | 1998-03-04 | 1998-04-01 | 1998-03-11 | Federal Shipping | 72 | Mozzarella di Giovanni | 34.8 | 10 | 0.0 | 348.0 | 39.92 |
| Antonio Moreno Taquería | Mataderos 2312 | México D.F. | NULL | 05023 | Mexico | ANTON | Antonio Moreno Taquería | Mataderos 2312 | México D.F. | NULL | 05023 | Mexico | Janet Leverling | 10365 | 1996-11-27 | 1996-12-25 | 1996-12-02 | United Package | 11 | Queso Cabrales | 16.8 | 24 | 0.0 | 403.2 | 22.0 |
| Antonio Moreno Taquería | Mataderos 2312 | México D.F. | NULL | 05023 | Mexico | ANTON | Antonio Moreno Taquería | Mataderos 2312 | México D.F. | NULL | 05023 | Mexico | Robert King | 10507 | 1997-04-15 | 1997-05-13 | 1997-04-22 | Speedy Express | 43 | Ipoh Coffee | 46.0 | 15 | 0.15 | 586.5 | 47.45 |
| Antonio Moreno Taquería | Mataderos 2312 | México D.F. | NULL | 05023 | Mexico | ANTON | Antonio Moreno Taquería | Mataderos 2312 | México D.F. | NULL | 05023 | Mexico | Robert King | 10507 | 1997-04-15 | 1997-05-13 | 1997-04-22 | Speedy Express | 48 | Chocolade | 12.75 | 15 | 0.15 | 162.56 | 47.45 |
Example queries
Row countsUNION ALL stacks five counts into one result.
Order Details columnspragma_table_info shows the two-column primary key.
Territories per employeeFour tables joined through a junction table.
Uncovered territoriesLEFT JOIN + IS NULL finds rows with no match.
Org chart (recursive)A recursive CTE walks the ReportsTo tree.
Price history of Queso CabralesOrder lines keep the price charged on the day.
IS NULLThe only reliable test for a missing value.
count(*) vs count(column)Why counting after a LEFT JOIN goes wrong.
Revenue by categoryGROUP BY with a derived revenue column.
Shipper performancejulianday() differences give days to ship.
Sales by quarterstrftime() and integer division make quarters.
Priciest product per categoryA correlated subquery, run per row.
Lost customersEXISTS and NOT EXISTS together.
Category Sales for 1997A view built on a view built on a view.
+ versus ||Why T-SQL string joins return 0 in SQLite.
Ten Most Expensive ProductsMicrosoft's procedure, as ORDER BY + LIMIT.
Rank within countryrank() OVER (PARTITION BY ...).
Running total by monthsum() OVER and lag() for month-on-month.
Top two products per categoryrow_number() for a top-N per group.
Plan: indexed lookupEXPLAIN QUERY PLAN: SEARCH via an index.
Plan: a joinA join that uses a covering index.
BLOB sizestypeof() and length() on stored pictures.
What you can't do here, and why
INSERT, UPDATE, DELETE, CREATE, DROP, ATTACH, BEGIN and any PRAGMA that changes a setting are all refused, because this is a shared demonstration. On your own copy everything works: download northwind.db and run sqlite3 northwind.db. Try DELETE FROM Orders; here to see the refusal.