Salah satu tujuan utama perintah SQL adalah memberikan informasi berupa data dari tabel pada database. Informasi yang diberikan dapat berasal dari satu tabel. Informasi yang diberikan juga dapat difilter berdasarkan kriteria tertentu. Perintah SQL yang lebih rumit bahkan bisa memberikan informasi dari beberapa tabel sekaligus. Pada tutorial ini kita akan mempelajari berbagai cara menampilkan data dari satu tabel. Perintah SQL jenis ini juga biasa disebut dengan istilah Query. Query adalah perintah SQL yang bertujuan untuk menampilkan data tertentu dari tabel.
Data Awal Untuk Contoh Query #
Semua contoh query SQL pada artikel ini dijalankan kepada tabel Customers dan Products. Data tabel Customers dan Products terlampir di bawah ini.
Tabel Customers #
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
1 | Alfreds Futterkiste | Maria Anders | Obere Str. 57 | Berlin | 12209 | Germany |
2 | Ana Trujillo Emparedados y helados | Ana Trujillo | Avda. de la Constitución 2222 | México D.F. | 05021 | Mexico |
3 | Antonio Moreno Taquería | Antonio Moreno | Mataderos 2312 | México D.F. | 05023 | Mexico |
4 | Around the Horn | Thomas Hardy | 120 Hanover Sq. | London | WA1 1DP | UK |
5 | Berglunds snabbköp | Christina Berglund | Berguvsvägen 8 | Luleå | S-958 22 | Sweden |
6 | Blauer See Delikatessen | Hanna Moos | Forsterstr. 57 | Mannheim | 68306 | Germany |
7 | Blondel père et fils | Frédérique Citeaux | 24, place Kléber | Strasbourg | 67000 | France |
8 | Bólido Comidas preparadas | Martín Sommer | C/ Araquil, 67 | Madrid | 28023 | Spain |
9 | Bon app’ | Laurence Lebihans | 12, rue des Bouchers | Marseille | 13008 | France |
10 | Bottom-Dollar Marketse | Elizabeth Lincoln | 23 Tsawassen Blvd. | Tsawassen | T2F 8M4 | Canada |
11 | B’s Beverages | Victoria Ashworth | Fauntleroy Circus | London | EC2 5NT | UK |
12 | Cactus Comidas para llevar | Patricio Simpson | Cerrito 333 | Buenos Aires | 1010 | Argentina |
13 | Centro comercial Moctezuma | Francisco Chang | Sierras de Granada 9993 | México D.F. | 05022 | Mexico |
14 | Chop-suey Chinese | Yang Wang | Hauptstr. 29 | Bern | 3012 | Switzerland |
15 | Comércio Mineiro | Pedro Afonso | Av. dos Lusíadas, 23 | São Paulo | 05432-043 | Brazil |
16 | Consolidated Holdings | Elizabeth Brown | Berkeley Gardens 12 Brewery | London | WX1 6LT | UK |
17 | Drachenblut Delikatessend | Sven Ottlieb | Walserweg 21 | Aachen | 52066 | Germany |
18 | Du monde entier | Janine Labrune | 67, rue des Cinquante Otages | Nantes | 44000 | France |
19 | Eastern Connection | Ann Devon | 35 King George | London | WX3 6FW | UK |
20 | Ernst Handel | Roland Mendel | Kirchgasse 6 | Graz | 8010 | Austria |
21 | Familia Arquibaldo | Aria Cruz | Rua Orós, 92 | São Paulo | 05442-030 | Brazil |
22 | FISSA Fabrica Inter. Salchichas S.A. | Diego Roel | C/ Moralzarzal, 86 | Madrid | 28034 | Spain |
23 | Folies gourmandes | Martine Rancé | 184, chaussée de Tournai | Lille | 59000 | France |
24 | Folk och fä HB | Maria Larsson | Åkergatan 24 | Bräcke | S-844 67 | Sweden |
25 | Frankenversand | Peter Franken | Berliner Platz 43 | München | 80805 | Germany |
26 | France restauration | Carine Schmitt | 54, rue Royale | Nantes | 44000 | France |
27 | Franchi S.p.A. | Paolo Accorti | Via Monte Bianco 34 | Torino | 10100 | Italy |
28 | Furia Bacalhau e Frutos do Mar | Lino Rodriguez | Jardim das rosas n. 32 | Lisboa | 1675 | Portugal |
29 | Galería del gastrónomo | Eduardo Saavedra | Rambla de Cataluña, 23 | Barcelona | 08022 | Spain |
30 | Godos Cocina Típica | José Pedro Freyre | C/ Romero, 33 | Sevilla | 41101 | Spain |
31 | Gourmet Lanchonetes | André Fonseca | Av. Brasil, 442 | Campinas | 04876-786 | Brazil |
32 | Great Lakes Food Market | Howard Snyder | 2732 Baker Blvd. | Eugene | 97403 | USA |
33 | GROSELLA-Restaurante | Manuel Pereira | 5ª Ave. Los Palos Grandes | Caracas | 1081 | Venezuela |
34 | Hanari Carnes | Mario Pontes | Rua do Paço, 67 | Rio de Janeiro | 05454-876 | Brazil |
35 | HILARIÓN-Abastos | Carlos Hernández | Carrera 22 con Ave. Carlos Soublette #8-35 | San Cristóbal | 5022 | Venezuela |
36 | Hungry Coyote Import Store | Yoshi Latimer | City Center Plaza 516 Main St. | Elgin | 97827 | USA |
37 | Hungry Owl All-Night Grocers | Patricia McKenna | 8 Johnstown Road | Cork | Ireland | |
38 | Island Trading | Helen Bennett | Garden House Crowther Way | Cowes | PO31 7PJ | UK |
39 | Königlich Essen | Philip Cramer | Maubelstr. 90 | Brandenburg | 14776 | Germany |
40 | La corne d’abondance | Daniel Tonini | 67, avenue de l’Europe | Versailles | 78000 | France |
41 | La maison d’Asie | Annette Roulet | 1 rue Alsace-Lorraine | Toulouse | 31000 | France |
42 | Laughing Bacchus Wine Cellars | Yoshi Tannamuri | 1900 Oak St. | Vancouver | V3F 2K1 | Canada |
43 | Lazy K Kountry Store | John Steel | 12 Orchestra Terrace | Walla Walla | 99362 | USA |
44 | Lehmanns Marktstand | Renate Messner | Magazinweg 7 | Frankfurt a.M. | 60528 | Germany |
45 | Let’s Stop N Shop | Jaime Yorres | 87 Polk St. Suite 5 | San Francisco | 94117 | USA |
46 | LILA-Supermercado | Carlos González | Carrera 52 con Ave. Bolívar #65-98 Llano Largo | Barquisimeto | 3508 | Venezuela |
47 | LINO-Delicateses | Felipe Izquierdo | Ave. 5 de Mayo Porlamar | I. de Margarita | 4980 | Venezuela |
48 | Lonesome Pine Restaurant | Fran Wilson | 89 Chiaroscuro Rd. | Portland | 97219 | USA |
49 | Magazzini Alimentari Riuniti | Giovanni Rovelli | Via Ludovico il Moro 22 | Bergamo | 24100 | Italy |
50 | Maison Dewey | Catherine Dewey | Rue Joseph-Bens 532 | Bruxelles | B-1180 | Belgium |
51 | Mère Paillarde | Jean Fresnière | 43 rue St. Laurent | Montréal | H1J 1C3 | Canada |
52 | Morgenstern Gesundkost | Alexander Feuer | Heerstr. 22 | Leipzig | 04179 | Germany |
53 | North/South | Simon Crowther | South House 300 Queensbridge | London | SW7 1RZ | UK |
54 | Océano Atlántico Ltda. | Yvonne Moncada | Ing. Gustavo Moncada 8585 Piso 20-A | Buenos Aires | 1010 | Argentina |
55 | Old World Delicatessen | Rene Phillips | 2743 Bering St. | Anchorage | 99508 | USA |
56 | Ottilies Käseladen | Henriette Pfalzheim | Mehrheimerstr. 369 | Köln | 50739 | Germany |
57 | Paris spécialités | Marie Bertrand | 265, boulevard Charonne | Paris | 75012 | France |
58 | Pericles Comidas clásicas | Guillermo Fernández | Calle Dr. Jorge Cash 321 | México D.F. | 05033 | Mexico |
59 | Piccolo und mehr | Georg Pipps | Geislweg 14 | Salzburg | 5020 | Austria |
60 | Princesa Isabel Vinhoss | Isabel de Castro | Estrada da saúde n. 58 | Lisboa | 1756 | Portugal |
61 | Que Delícia | Bernardo Batista | Rua da Panificadora, 12 | Rio de Janeiro | 02389-673 | Brazil |
62 | Queen Cozinha | Lúcia Carvalho | Alameda dos Canàrios, 891 | São Paulo | 05487-020 | Brazil |
63 | QUICK-Stop | Horst Kloss | Taucherstraße 10 | Cunewalde | 01307 | Germany |
64 | Rancho grande | Sergio Gutiérrez | Av. del Libertador 900 | Buenos Aires | 1010 | Argentina |
65 | Rattlesnake Canyon Grocery | Paula Wilson | 2817 Milton Dr. | Albuquerque | 87110 | USA |
66 | Reggiani Caseifici | Maurizio Moroni | Strada Provinciale 124 | Reggio Emilia | 42100 | Italy |
67 | Ricardo Adocicados | Janete Limeira | Av. Copacabana, 267 | Rio de Janeiro | 02389-890 | Brazil |
68 | Richter Supermarkt | Michael Holz | Grenzacherweg 237 | Genève | 1203 | Switzerland |
69 | Romero y tomillo | Alejandra Camino | Gran Vía, 1 | Madrid | 28001 | Spain |
70 | Santé Gourmet | Jonas Bergulfsen | Erling Skakkes gate 78 | Stavern | 4110 | Norway |
71 | Save-a-lot Markets | Jose Pavarotti | 187 Suffolk Ln. | Boise | 83720 | USA |
72 | Seven Seas Imports | Hari Kumar | 90 Wadhurst Rd. | London | OX15 4NB | UK |
73 | Simons bistro | Jytte Petersen | Vinbæltet 34 | København | 1734 | Denmark |
74 | Spécialités du monde | Dominique Perrier | 25, rue Lauriston | Paris | 75016 | France |
75 | Split Rail Beer & Ale | Art Braunschweiger | P.O. Box 555 | Lander | 82520 | USA |
76 | Suprêmes délices | Pascale Cartrain | Boulevard Tirou, 255 | Charleroi | B-6000 | Belgium |
77 | The Big Cheese | Liz Nixon | 89 Jefferson Way Suite 2 | Portland | 97201 | USA |
78 | The Cracker Box | Liu Wong | 55 Grizzly Peak Rd. | Butte | 59801 | USA |
79 | Toms Spezialitäten | Karin Josephs | Luisenstr. 48 | Münster | 44087 | Germany |
80 | Tortuga Restaurante | Miguel Angel Paolino | Avda. Azteca 123 | México D.F. | 05033 | Mexico |
81 | Tradição Hipermercados | Anabela Domingues | Av. Inês de Castro, 414 | São Paulo | 05634-030 | Brazil |
82 | Trail’s Head Gourmet Provisioners | Helvetius Nagy | 722 DaVinci Blvd. | Kirkland | 98034 | USA |
83 | Vaffeljernet | Palle Ibsen | Smagsløget 45 | Århus | 8200 | Denmark |
84 | Victuailles en stock | Mary Saveley | 2, rue du Commerce | Lyon | 69004 | France |
85 | Vins et alcools Chevalier | Paul Henriot | 59 rue de l’Abbaye | Reims | 51100 | France |
86 | Die Wandernde Kuh | Rita Müller | Adenauerallee 900 | Stuttgart | 70563 | Germany |
87 | Wartian Herkku | Pirkko Koskitalo | Torikatu 38 | Oulu | 90110 | Finland |
88 | Wellington Importadora | Paula Parente | Rua do Mercado, 12 | Resende | 08737-363 | Brazil |
89 | White Clover Markets | Karl Jablonski | 305 – 14th Ave. S. Suite 3B | Seattle | 98128 | USA |
90 | Wilman Kala | Matti Karttunen | Keskuskatu 45 | Helsinki | 21240 | Finland |
91 | Wolski | Zbyszek | ul. Filtrowa 68 | Walla | 01-012 | Poland |
Tabel Products #
ProductID | ProductName | SupplierID | CategoryID | Unit | Price |
---|---|---|---|---|---|
1 | Chais | 1 | 1 | 10 boxes x 20 bags | 18 |
2 | Chang | 1 | 1 | 24 – 12 oz bottles | 19 |
3 | Aniseed Syrup | 1 | 2 | 12 – 550 ml bottles | 10 |
4 | Chef Anton’s Cajun Seasoning | 2 | 2 | 48 – 6 oz jars | 22 |
5 | Chef Anton’s Gumbo Mix | 2 | 2 | 36 boxes | 21.35 |
6 | Grandma’s Boysenberry Spread | 3 | 2 | 12 – 8 oz jars | 25 |
7 | Uncle Bob’s Organic Dried Pears | 3 | 7 | 12 – 1 lb pkgs. | 30 |
8 | Northwoods Cranberry Sauce | 3 | 2 | 12 – 12 oz jars | 40 |
9 | Mishi Kobe Niku | 4 | 6 | 18 – 500 g pkgs. | 97 |
10 | Ikura | 4 | 8 | 12 – 200 ml jars | 31 |
11 | Queso Cabrales | 5 | 4 | 1 kg pkg. | 21 |
12 | Queso Manchego La Pastora | 5 | 4 | 10 – 500 g pkgs. | 38 |
13 | Konbu | 6 | 8 | 2 kg box | 6 |
14 | Tofu | 6 | 7 | 40 – 100 g pkgs. | 23.25 |
15 | Genen Shouyu | 6 | 2 | 24 – 250 ml bottles | 15.5 |
16 | Pavlova | 7 | 3 | 32 – 500 g boxes | 17.45 |
17 | Alice Mutton | 7 | 6 | 20 – 1 kg tins | 39 |
18 | Carnarvon Tigers | 7 | 8 | 16 kg pkg. | 62.5 |
19 | Teatime Chocolate Biscuits | 8 | 3 | 10 boxes x 12 pieces | 9.2 |
20 | Sir Rodney’s Marmalade | 8 | 3 | 30 gift boxes | 81 |
21 | Sir Rodney’s Scones | 8 | 3 | 24 pkgs. x 4 pieces | 10 |
22 | Gustaf’s Knäckebröd | 9 | 5 | 24 – 500 g pkgs. | 21 |
23 | Tunnbröd | 9 | 5 | 12 – 250 g pkgs. | 9 |
24 | Guaraná Fantástica | 10 | 1 | 12 – 355 ml cans | 4.5 |
25 | NuNuCa Nuß-Nougat-Creme | 11 | 3 | 20 – 450 g glasses | 14 |
26 | Gumbär Gummibärchen | 11 | 3 | 100 – 250 g bags | 31.23 |
27 | Schoggi Schokolade | 11 | 3 | 100 – 100 g pieces | 43.9 |
28 | Rössle Sauerkraut | 12 | 7 | 25 – 825 g cans | 45.6 |
29 | Thüringer Rostbratwurst | 12 | 6 | 50 bags x 30 sausgs. | 123.79 |
30 | Nord-Ost Matjeshering | 13 | 8 | 10 – 200 g glasses | 25.89 |
31 | Gorgonzola Telino | 14 | 4 | 12 – 100 g pkgs | 12.5 |
32 | Mascarpone Fabioli | 14 | 4 | 24 – 200 g pkgs. | 32 |
33 | Geitost | 15 | 4 | 500 g | 2.5 |
34 | Sasquatch Ale | 16 | 1 | 24 – 12 oz bottles | 14 |
35 | Steeleye Stout | 16 | 1 | 24 – 12 oz bottles | 18 |
36 | Inlagd Sill | 17 | 8 | 24 – 250 g jars | 19 |
37 | Gravad lax | 17 | 8 | 12 – 500 g pkgs. | 26 |
38 | Côte de Blaye | 18 | 1 | 12 – 75 cl bottles | 263.5 |
39 | Chartreuse verte | 18 | 1 | 750 cc per bottle | 18 |
40 | Boston Crab Meat | 19 | 8 | 24 – 4 oz tins | 18.4 |
41 | Jack’s New England Clam Chowder | 19 | 8 | 12 – 12 oz cans | 9.65 |
42 | Singaporean Hokkien Fried Mee | 20 | 5 | 32 – 1 kg pkgs. | 14 |
43 | Ipoh Coffee | 20 | 1 | 16 – 500 g tins | 46 |
44 | Gula Malacca | 20 | 2 | 20 – 2 kg bags | 19.45 |
45 | Røgede sild | 21 | 8 | 1k pkg. | 9.5 |
46 | Spegesild | 21 | 8 | 4 – 450 g glasses | 12 |
47 | Zaanse koeken | 22 | 3 | 10 – 4 oz boxes | 9.5 |
48 | Chocolade | 22 | 3 | 10 pkgs. | 12.75 |
49 | Maxilaku | 23 | 3 | 24 – 50 g pkgs. | 20 |
50 | Valkoinen suklaa | 23 | 3 | 12 – 100 g bars | 16.25 |
51 | Manjimup Dried Apples | 24 | 7 | 50 – 300 g pkgs. | 53 |
52 | Filo Mix | 24 | 5 | 16 – 2 kg boxes | 7 |
53 | Perth Pasties | 24 | 6 | 48 pieces | 32.8 |
54 | Tourtière | 25 | 6 | 16 pies | 7.45 |
55 | Pâté chinois | 25 | 6 | 24 boxes x 2 pies | 24 |
56 | Gnocchi di nonna Alice | 26 | 5 | 24 – 250 g pkgs. | 38 |
57 | Ravioli Angelo | 26 | 5 | 24 – 250 g pkgs. | 19.5 |
58 | Escargots de Bourgogne | 27 | 8 | 24 pieces | 13.25 |
59 | Raclette Courdavault | 28 | 4 | 5 kg pkg. | 55 |
60 | Camembert Pierrot | 28 | 4 | 15 – 300 g rounds | 34 |
61 | Sirop d’érable | 29 | 2 | 24 – 500 ml bottles | 28.5 |
62 | Tarte au sucre | 29 | 3 | 48 pies | 49.3 |
63 | Vegie-spread | 7 | 2 | 15 – 625 g jars | 43.9 |
64 | Wimmers gute Semmelknödel | 12 | 5 | 20 bags x 4 pieces | 33.25 |
65 | Louisiana Fiery Hot Pepper Sauce | 2 | 2 | 32 – 8 oz bottles | 21.05 |
66 | Louisiana Hot Spiced Okra | 2 | 2 | 24 – 8 oz jars | 17 |
67 | Laughing Lumberjack Lager | 16 | 1 | 24 – 12 oz bottles | 14 |
68 | Scottish Longbreads | 8 | 3 | 10 boxes x 8 pieces | 12.5 |
69 | Gudbrandsdalsost | 15 | 4 | 10 kg pkg. | 36 |
70 | Outback Lager | 7 | 1 | 24 – 355 ml bottles | 15 |
71 | Fløtemysost | 15 | 4 | 10 – 500 g pkgs. | 21.5 |
72 | Mozzarella di Giovanni | 14 | 4 | 24 – 200 g pkgs. | 34.8 |
73 | Röd Kaviar | 17 | 8 | 24 – 150 g jars | 15 |
74 | Longlife Tofu | 4 | 7 | 5 kg pkg. | 10 |
75 | Rhönbräu Klosterbier | 12 | 1 | 24 – 0.5 l bottles | 7.75 |
76 | Lakkalikööri | 23 | 1 | 500 ml | 18 |
77 | Original Frankfurter grüne Soße | 12 | 2 | 12 boxes | 13 |
Semua artikel dalam seri tutorial belajar SQL ini menggunakan sampel database yang dapat didownload di sini. Silahkan import sampel database ke MySql untuk keperluan praktek perintah SQL.
Perintah SELECT #
Perintah atau query SELECT digunakan untuk menampilkan data dari tabel pada database. Di bawah ini adalah format sederhana dari perintah SELECT.
SELECT column1, column2, ...
FROM table_name;
Column1 dan column2 adalah kolom-kolom pada tabel yang ingin ditampilkan. Table_name adalah nama tabel sumber data. Gunakan tanda * (wildcard) untuk menampilkan semua kolom dari suatu tabel.
SELECT * FROM table_name;
Contoh SELECT Kolom Tertentu #
SELECT CustomerName, City FROM Customers;
CustomerName | City |
---|---|
Alfreds Futterkiste | Berlin |
Ana Trujillo Emparedados y helados | México D.F. |
Antonio Moreno Taquería | México D.F. |
Around the Horn | London |
Berglunds snabbköp | Luleå |
Blauer See Delikatessen | Mannheim |
Blondel père et fils | Strasbourg |
Bólido Comidas preparadas | Madrid |
Bon app’ | Marseille |
Bottom-Dollar Marketse | Tsawassen |
B’s Beverages | London |
Cactus Comidas para llevar | Buenos Aires |
Centro comercial Moctezuma | México D.F. |
Chop-suey Chinese | Bern |
Comércio Mineiro | São Paulo |
Consolidated Holdings | London |
Drachenblut Delikatessend | Aachen |
Du monde entier | Nantes |
Eastern Connection | London |
Ernst Handel | Graz |
Familia Arquibaldo | São Paulo |
FISSA Fabrica Inter. Salchichas S.A. | Madrid |
Folies gourmandes | Lille |
Folk och fä HB | Bräcke |
Frankenversand | München |
France restauration | Nantes |
Franchi S.p.A. | Torino |
Furia Bacalhau e Frutos do Mar | Lisboa |
Galería del gastrónomo | Barcelona |
Godos Cocina Típica | Sevilla |
Gourmet Lanchonetes | Campinas |
Great Lakes Food Market | Eugene |
GROSELLA-Restaurante | Caracas |
Hanari Carnes | Rio de Janeiro |
HILARIÓN-Abastos | San Cristóbal |
Hungry Coyote Import Store | Elgin |
Hungry Owl All-Night Grocers | Cork |
Island Trading | Cowes |
Königlich Essen | Brandenburg |
La corne d’abondance | Versailles |
La maison d’Asie | Toulouse |
Laughing Bacchus Wine Cellars | Vancouver |
Lazy K Kountry Store | Walla Walla |
Lehmanns Marktstand | Frankfurt a.M. |
Let’s Stop N Shop | San Francisco |
LILA-Supermercado | Barquisimeto |
LINO-Delicateses | I. de Margarita |
Lonesome Pine Restaurant | Portland |
Magazzini Alimentari Riuniti | Bergamo |
Maison Dewey | Bruxelles |
Mère Paillarde | Montréal |
Morgenstern Gesundkost | Leipzig |
North/South | London |
Océano Atlántico Ltda. | Buenos Aires |
Old World Delicatessen | Anchorage |
Ottilies Käseladen | Köln |
Paris spécialités | Paris |
Pericles Comidas clásicas | México D.F. |
Piccolo und mehr | Salzburg |
Princesa Isabel Vinhoss | Lisboa |
Que Delícia | Rio de Janeiro |
Queen Cozinha | São Paulo |
QUICK-Stop | Cunewalde |
Rancho grande | Buenos Aires |
Rattlesnake Canyon Grocery | Albuquerque |
Reggiani Caseifici | Reggio Emilia |
Ricardo Adocicados | Rio de Janeiro |
Richter Supermarkt | Genève |
Romero y tomillo | Madrid |
Santé Gourmet | Stavern |
Save-a-lot Markets | Boise |
Seven Seas Imports | London |
Simons bistro | København |
Spécialités du monde | Paris |
Split Rail Beer & Ale | Lander |
Suprêmes délices | Charleroi |
The Big Cheese | Portland |
The Cracker Box | Butte |
Toms Spezialitäten | Münster |
Tortuga Restaurante | México D.F. |
Tradição Hipermercados | São Paulo |
Trail’s Head Gourmet Provisioners | Kirkland |
Vaffeljernet | Århus |
Victuailles en stock | Lyon |
Vins et alcools Chevalier | Reims |
Die Wandernde Kuh | Stuttgart |
Wartian Herkku | Oulu |
Wellington Importadora | Resende |
White Clover Markets | Seattle |
Wilman Kala | Helsinki |
Wolski | Walla |
Contoh SELECT Semua Kolom #
SELECT * FROM Customers;
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
1 | Alfreds Futterkiste | Maria Anders | Obere Str. 57 | Berlin | 12209 | Germany |
2 | Ana Trujillo Emparedados y helados | Ana Trujillo | Avda. de la Constitución 2222 | México D.F. | 05021 | Mexico |
3 | Antonio Moreno Taquería | Antonio Moreno | Mataderos 2312 | México D.F. | 05023 | Mexico |
4 | Around the Horn | Thomas Hardy | 120 Hanover Sq. | London | WA1 1DP | UK |
5 | Berglunds snabbköp | Christina Berglund | Berguvsvägen 8 | Luleå | S-958 22 | Sweden |
6 | Blauer See Delikatessen | Hanna Moos | Forsterstr. 57 | Mannheim | 68306 | Germany |
7 | Blondel père et fils | Frédérique Citeaux | 24, place Kléber | Strasbourg | 67000 | France |
8 | Bólido Comidas preparadas | Martín Sommer | C/ Araquil, 67 | Madrid | 28023 | Spain |
9 | Bon app’ | Laurence Lebihans | 12, rue des Bouchers | Marseille | 13008 | France |
10 | Bottom-Dollar Marketse | Elizabeth Lincoln | 23 Tsawassen Blvd. | Tsawassen | T2F 8M4 | Canada |
11 | B’s Beverages | Victoria Ashworth | Fauntleroy Circus | London | EC2 5NT | UK |
12 | Cactus Comidas para llevar | Patricio Simpson | Cerrito 333 | Buenos Aires | 1010 | Argentina |
13 | Centro comercial Moctezuma | Francisco Chang | Sierras de Granada 9993 | México D.F. | 05022 | Mexico |
14 | Chop-suey Chinese | Yang Wang | Hauptstr. 29 | Bern | 3012 | Switzerland |
15 | Comércio Mineiro | Pedro Afonso | Av. dos Lusíadas, 23 | São Paulo | 05432-043 | Brazil |
16 | Consolidated Holdings | Elizabeth Brown | Berkeley Gardens 12 Brewery | London | WX1 6LT | UK |
17 | Drachenblut Delikatessend | Sven Ottlieb | Walserweg 21 | Aachen | 52066 | Germany |
18 | Du monde entier | Janine Labrune | 67, rue des Cinquante Otages | Nantes | 44000 | France |
19 | Eastern Connection | Ann Devon | 35 King George | London | WX3 6FW | UK |
20 | Ernst Handel | Roland Mendel | Kirchgasse 6 | Graz | 8010 | Austria |
21 | Familia Arquibaldo | Aria Cruz | Rua Orós, 92 | São Paulo | 05442-030 | Brazil |
22 | FISSA Fabrica Inter. Salchichas S.A. | Diego Roel | C/ Moralzarzal, 86 | Madrid | 28034 | Spain |
23 | Folies gourmandes | Martine Rancé | 184, chaussée de Tournai | Lille | 59000 | France |
24 | Folk och fä HB | Maria Larsson | Åkergatan 24 | Bräcke | S-844 67 | Sweden |
25 | Frankenversand | Peter Franken | Berliner Platz 43 | München | 80805 | Germany |
26 | France restauration | Carine Schmitt | 54, rue Royale | Nantes | 44000 | France |
27 | Franchi S.p.A. | Paolo Accorti | Via Monte Bianco 34 | Torino | 10100 | Italy |
28 | Furia Bacalhau e Frutos do Mar | Lino Rodriguez | Jardim das rosas n. 32 | Lisboa | 1675 | Portugal |
29 | Galería del gastrónomo | Eduardo Saavedra | Rambla de Cataluña, 23 | Barcelona | 08022 | Spain |
30 | Godos Cocina Típica | José Pedro Freyre | C/ Romero, 33 | Sevilla | 41101 | Spain |
31 | Gourmet Lanchonetes | André Fonseca | Av. Brasil, 442 | Campinas | 04876-786 | Brazil |
32 | Great Lakes Food Market | Howard Snyder | 2732 Baker Blvd. | Eugene | 97403 | USA |
33 | GROSELLA-Restaurante | Manuel Pereira | 5ª Ave. Los Palos Grandes | Caracas | 1081 | Venezuela |
34 | Hanari Carnes | Mario Pontes | Rua do Paço, 67 | Rio de Janeiro | 05454-876 | Brazil |
35 | HILARIÓN-Abastos | Carlos Hernández | Carrera 22 con Ave. Carlos Soublette #8-35 | San Cristóbal | 5022 | Venezuela |
36 | Hungry Coyote Import Store | Yoshi Latimer | City Center Plaza 516 Main St. | Elgin | 97827 | USA |
37 | Hungry Owl All-Night Grocers | Patricia McKenna | 8 Johnstown Road | Cork | Ireland | |
38 | Island Trading | Helen Bennett | Garden House Crowther Way | Cowes | PO31 7PJ | UK |
39 | Königlich Essen | Philip Cramer | Maubelstr. 90 | Brandenburg | 14776 | Germany |
40 | La corne d’abondance | Daniel Tonini | 67, avenue de l’Europe | Versailles | 78000 | France |
41 | La maison d’Asie | Annette Roulet | 1 rue Alsace-Lorraine | Toulouse | 31000 | France |
42 | Laughing Bacchus Wine Cellars | Yoshi Tannamuri | 1900 Oak St. | Vancouver | V3F 2K1 | Canada |
43 | Lazy K Kountry Store | John Steel | 12 Orchestra Terrace | Walla Walla | 99362 | USA |
44 | Lehmanns Marktstand | Renate Messner | Magazinweg 7 | Frankfurt a.M. | 60528 | Germany |
45 | Let’s Stop N Shop | Jaime Yorres | 87 Polk St. Suite 5 | San Francisco | 94117 | USA |
46 | LILA-Supermercado | Carlos González | Carrera 52 con Ave. Bolívar #65-98 Llano Largo | Barquisimeto | 3508 | Venezuela |
47 | LINO-Delicateses | Felipe Izquierdo | Ave. 5 de Mayo Porlamar | I. de Margarita | 4980 | Venezuela |
48 | Lonesome Pine Restaurant | Fran Wilson | 89 Chiaroscuro Rd. | Portland | 97219 | USA |
49 | Magazzini Alimentari Riuniti | Giovanni Rovelli | Via Ludovico il Moro 22 | Bergamo | 24100 | Italy |
50 | Maison Dewey | Catherine Dewey | Rue Joseph-Bens 532 | Bruxelles | B-1180 | Belgium |
51 | Mère Paillarde | Jean Fresnière | 43 rue St. Laurent | Montréal | H1J 1C3 | Canada |
52 | Morgenstern Gesundkost | Alexander Feuer | Heerstr. 22 | Leipzig | 04179 | Germany |
53 | North/South | Simon Crowther | South House 300 Queensbridge | London | SW7 1RZ | UK |
54 | Océano Atlántico Ltda. | Yvonne Moncada | Ing. Gustavo Moncada 8585 Piso 20-A | Buenos Aires | 1010 | Argentina |
55 | Old World Delicatessen | Rene Phillips | 2743 Bering St. | Anchorage | 99508 | USA |
56 | Ottilies Käseladen | Henriette Pfalzheim | Mehrheimerstr. 369 | Köln | 50739 | Germany |
57 | Paris spécialités | Marie Bertrand | 265, boulevard Charonne | Paris | 75012 | France |
58 | Pericles Comidas clásicas | Guillermo Fernández | Calle Dr. Jorge Cash 321 | México D.F. | 05033 | Mexico |
59 | Piccolo und mehr | Georg Pipps | Geislweg 14 | Salzburg | 5020 | Austria |
60 | Princesa Isabel Vinhoss | Isabel de Castro | Estrada da saúde n. 58 | Lisboa | 1756 | Portugal |
61 | Que Delícia | Bernardo Batista | Rua da Panificadora, 12 | Rio de Janeiro | 02389-673 | Brazil |
62 | Queen Cozinha | Lúcia Carvalho | Alameda dos Canàrios, 891 | São Paulo | 05487-020 | Brazil |
63 | QUICK-Stop | Horst Kloss | Taucherstraße 10 | Cunewalde | 01307 | Germany |
64 | Rancho grande | Sergio Gutiérrez | Av. del Libertador 900 | Buenos Aires | 1010 | Argentina |
65 | Rattlesnake Canyon Grocery | Paula Wilson | 2817 Milton Dr. | Albuquerque | 87110 | USA |
66 | Reggiani Caseifici | Maurizio Moroni | Strada Provinciale 124 | Reggio Emilia | 42100 | Italy |
67 | Ricardo Adocicados | Janete Limeira | Av. Copacabana, 267 | Rio de Janeiro | 02389-890 | Brazil |
68 | Richter Supermarkt | Michael Holz | Grenzacherweg 237 | Genève | 1203 | Switzerland |
69 | Romero y tomillo | Alejandra Camino | Gran Vía, 1 | Madrid | 28001 | Spain |
70 | Santé Gourmet | Jonas Bergulfsen | Erling Skakkes gate 78 | Stavern | 4110 | Norway |
71 | Save-a-lot Markets | Jose Pavarotti | 187 Suffolk Ln. | Boise | 83720 | USA |
72 | Seven Seas Imports | Hari Kumar | 90 Wadhurst Rd. | London | OX15 4NB | UK |
73 | Simons bistro | Jytte Petersen | Vinbæltet 34 | København | 1734 | Denmark |
74 | Spécialités du monde | Dominique Perrier | 25, rue Lauriston | Paris | 75016 | France |
75 | Split Rail Beer & Ale | Art Braunschweiger | P.O. Box 555 | Lander | 82520 | USA |
76 | Suprêmes délices | Pascale Cartrain | Boulevard Tirou, 255 | Charleroi | B-6000 | Belgium |
77 | The Big Cheese | Liz Nixon | 89 Jefferson Way Suite 2 | Portland | 97201 | USA |
78 | The Cracker Box | Liu Wong | 55 Grizzly Peak Rd. | Butte | 59801 | USA |
79 | Toms Spezialitäten | Karin Josephs | Luisenstr. 48 | Münster | 44087 | Germany |
80 | Tortuga Restaurante | Miguel Angel Paolino | Avda. Azteca 123 | México D.F. | 05033 | Mexico |
81 | Tradição Hipermercados | Anabela Domingues | Av. Inês de Castro, 414 | São Paulo | 05634-030 | Brazil |
82 | Trail’s Head Gourmet Provisioners | Helvetius Nagy | 722 DaVinci Blvd. | Kirkland | 98034 | USA |
83 | Vaffeljernet | Palle Ibsen | Smagsløget 45 | Århus | 8200 | Denmark |
84 | Victuailles en stock | Mary Saveley | 2, rue du Commerce | Lyon | 69004 | France |
85 | Vins et alcools Chevalier | Paul Henriot | 59 rue de l’Abbaye | Reims | 51100 | France |
86 | Die Wandernde Kuh | Rita Müller | Adenauerallee 900 | Stuttgart | 70563 | Germany |
87 | Wartian Herkku | Pirkko Koskitalo | Torikatu 38 | Oulu | 90110 | Finland |
88 | Wellington Importadora | Paula Parente | Rua do Mercado, 12 | Resende | 08737-363 | Brazil |
89 | White Clover Markets | Karl Jablonski | 305 – 14th Ave. S. Suite 3B | Seattle | 98128 | USA |
90 | Wilman Kala | Matti Karttunen | Keskuskatu 45 | Helsinki | 21240 | Finland |
91 | Wolski | Zbyszek | ul. Filtrowa 68 | Walla | 01-012 | Poland |
SELECT DISTINCT #
Perintah SELECT DISTINCT merupakan query SELECT yang berfungsi untuk menampilkan data tanpa adanya duplikasi atau baris data yang sama. Baris data yang sama akan dihapus dari hasil query. Format SELECT DISTINCT hampir sama dengan SELECT biasa, bedanya hanya ditambahkan kata DISTINCT di depan kata SELECT.
SELECT DISTINCT column1, column2, ...
FROM table_name;
Contoh SELECT Tanpa DISTINCT #
SELECT Country FROM Customers;
Country |
---|
Germany |
Mexico |
Mexico |
UK |
Sweden |
Germany |
France |
Spain |
France |
Canada |
UK |
Argentina |
Mexico |
Switzerland |
Brazil |
UK |
Germany |
France |
UK |
Austria |
Brazil |
Spain |
France |
Sweden |
Germany |
France |
Italy |
Portugal |
Spain |
Spain |
Brazil |
USA |
Venezuela |
Brazil |
Venezuela |
USA |
Ireland |
UK |
Germany |
France |
France |
Canada |
USA |
Germany |
USA |
Venezuela |
Venezuela |
USA |
Italy |
Belgium |
Canada |
Germany |
UK |
Argentina |
USA |
Germany |
France |
Mexico |
Austria |
Portugal |
Brazil |
Brazil |
Germany |
Argentina |
USA |
Italy |
Brazil |
Switzerland |
Spain |
Norway |
USA |
UK |
Denmark |
France |
USA |
Belgium |
USA |
USA |
Germany |
Mexico |
Brazil |
USA |
Denmark |
France |
France |
Germany |
Finland |
Brazil |
USA |
Finland |
Poland |
Contoh SELECT Dengan DISTINCT #
SELECT DISTINCT Country FROM Customers;
Country |
---|
Germany |
Mexico |
UK |
Sweden |
France |
Spain |
Canada |
Argentina |
Switzerland |
Brazil |
Austria |
Italy |
Portugal |
USA |
Venezuela |
Ireland |
Belgium |
Norway |
Denmark |
Finland |
Poland |
SELECT WHERE #
Perintah SELECT WHERE merupakan query SELECT yang berfungsi untuk menampilkan data dengan menambahkan filter berdasarkan kondisi tertentu. Data yang ditampilkan adalah data yang lolos dari proses filter berdasarkan kondisi tertentu.
Berikut adalah format SELECT WHERE dengan kondisi.
SELECT column1, column2, ...
FROM table_name
WHERE condition;
Contoh SELECT WHERE #
Contoh di bawah ini memperlihatkan query SELECT dengan kondisi nilai kolom Country sama dengan ‘Mexico’. Data yang ditampilkan hanya baris-baris data dengan kolom Country bernilai ‘Mexico’. Gunakan single quote untuk menuliskan nilai dengan tipe text pada perintah SQL.
SELECT * FROM Customers
WHERE Country='Mexico';
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
2 | Ana Trujillo Emparedados y helados | Ana Trujillo | Avda. de la Constitución 2222 | México D.F. | 05021 | Mexico |
3 | Antonio Moreno Taquería | Antonio Moreno | Mataderos 2312 | México D.F. | 05023 | Mexico |
13 | Centro comercial Moctezuma | Francisco Chang | Sierras de Granada 9993 | México D.F. | 05022 | Mexico |
58 | Pericles Comidas clásicas | Guillermo Fernández | Calle Dr. Jorge Cash 321 | México D.F. | 05033 | Mexico |
80 | Tortuga Restaurante | Miguel Angel Paolino | Avda. Azteca 123 | México D.F. | 05033 | Mexico |
Contoh Kondisi Kolom Tipe Angka #
Single quote tidak dipakai pada nilai dengan tipe angka.
SELECT * FROM Customers
WHERE CustomerID=1;
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
1 | Alfreds Futterkiste | Maria Anders | Obere Str. 57 | Berlin | 12209 | Germany |
Jenis Kondisi #
Terdapat berbagai jenis kondisi yang bisa dipakai pada SELECT WHERE.
Contoh Kondisi Sama Dengan #
Gunakan operator = untuk menuliskan kondisi sama dengan. Contoh di bawah ini hanya menampilkan data dengan kondisi nilai kolom Price sama dengan 18.
SELECT * FROM Products
WHERE Price = 18;
ProductID | ProductName | SupplierID | CategoryID | Unit | Price |
---|---|---|---|---|---|
1 | Chais | 1 | 1 | 10 boxes x 20 bags | 18 |
35 | Steeleye Stout | 16 | 1 | 24 – 12 oz bottles | 18 |
39 | Chartreuse verte | 18 | 1 | 750 cc per bottle | 18 |
76 | Lakkalikööri | 23 | 1 | 500 ml | 18 |
Contoh Kondisi Lebih Besar #
Gunakan operator > untuk menuliskan kondisi lebih besar. Contoh di bawah ini hanya menampilkan data dengan kondisi nilai kolom Price lebih besar dari 30.
SELECT * FROM Products
WHERE Price > 30;
ProductID | ProductName | SupplierID | CategoryID | Unit | Price |
---|---|---|---|---|---|
8 | Northwoods Cranberry Sauce | 3 | 2 | 12 – 12 oz jars | 40 |
9 | Mishi Kobe Niku | 4 | 6 | 18 – 500 g pkgs. | 97 |
10 | Ikura | 4 | 8 | 12 – 200 ml jars | 31 |
12 | Queso Manchego La Pastora | 5 | 4 | 10 – 500 g pkgs. | 38 |
17 | Alice Mutton | 7 | 6 | 20 – 1 kg tins | 39 |
18 | Carnarvon Tigers | 7 | 8 | 16 kg pkg. | 62.5 |
20 | Sir Rodney’s Marmalade | 8 | 3 | 30 gift boxes | 81 |
26 | Gumbär Gummibärchen | 11 | 3 | 100 – 250 g bags | 31.23 |
27 | Schoggi Schokolade | 11 | 3 | 100 – 100 g pieces | 43.9 |
28 | Rössle Sauerkraut | 12 | 7 | 25 – 825 g cans | 45.6 |
29 | Thüringer Rostbratwurst | 12 | 6 | 50 bags x 30 sausgs. | 123.79 |
32 | Mascarpone Fabioli | 14 | 4 | 24 – 200 g pkgs. | 32 |
38 | Côte de Blaye | 18 | 1 | 12 – 75 cl bottles | 263.5 |
43 | Ipoh Coffee | 20 | 1 | 16 – 500 g tins | 46 |
51 | Manjimup Dried Apples | 24 | 7 | 50 – 300 g pkgs. | 53 |
53 | Perth Pasties | 24 | 6 | 48 pieces | 32.8 |
56 | Gnocchi di nonna Alice | 26 | 5 | 24 – 250 g pkgs. | 38 |
59 | Raclette Courdavault | 28 | 4 | 5 kg pkg. | 55 |
60 | Camembert Pierrot | 28 | 4 | 15 – 300 g rounds | 34 |
62 | Tarte au sucre | 29 | 3 | 48 pies | 49.3 |
63 | Vegie-spread | 7 | 2 | 15 – 625 g jars | 43.9 |
64 | Wimmers gute Semmelknödel | 12 | 5 | 20 bags x 4 pieces | 33.25 |
69 | Gudbrandsdalsost | 15 | 4 | 10 kg pkg. | 36 |
72 | Mozzarella di Giovanni | 14 | 4 | 24 – 200 g pkgs. | 34.8 |
Contoh Kondisi Lebih Kecil #
Gunakan operator < untuk menuliskan kondisi lebih kecil. Contoh di bawah ini hanya menampilkan data dengan kondisi nilai kolom Price lebih kecil dari 30.
SELECT * FROM Products
WHERE Price < 30;
ProductID | ProductName | SupplierID | CategoryID | Unit | Price |
---|---|---|---|---|---|
1 | Chais | 1 | 1 | 10 boxes x 20 bags | 18 |
2 | Chang | 1 | 1 | 24 – 12 oz bottles | 19 |
3 | Aniseed Syrup | 1 | 2 | 12 – 550 ml bottles | 10 |
4 | Chef Anton’s Cajun Seasoning | 2 | 2 | 48 – 6 oz jars | 22 |
5 | Chef Anton’s Gumbo Mix | 2 | 2 | 36 boxes | 21.35 |
6 | Grandma’s Boysenberry Spread | 3 | 2 | 12 – 8 oz jars | 25 |
11 | Queso Cabrales | 5 | 4 | 1 kg pkg. | 21 |
13 | Konbu | 6 | 8 | 2 kg box | 6 |
14 | Tofu | 6 | 7 | 40 – 100 g pkgs. | 23.25 |
15 | Genen Shouyu | 6 | 2 | 24 – 250 ml bottles | 15.5 |
16 | Pavlova | 7 | 3 | 32 – 500 g boxes | 17.45 |
19 | Teatime Chocolate Biscuits | 8 | 3 | 10 boxes x 12 pieces | 9.2 |
21 | Sir Rodney’s Scones | 8 | 3 | 24 pkgs. x 4 pieces | 10 |
22 | Gustaf’s Knäckebröd | 9 | 5 | 24 – 500 g pkgs. | 21 |
23 | Tunnbröd | 9 | 5 | 12 – 250 g pkgs. | 9 |
24 | Guaraná Fantástica | 10 | 1 | 12 – 355 ml cans | 4.5 |
25 | NuNuCa Nuß-Nougat-Creme | 11 | 3 | 20 – 450 g glasses | 14 |
30 | Nord-Ost Matjeshering | 13 | 8 | 10 – 200 g glasses | 25.89 |
31 | Gorgonzola Telino | 14 | 4 | 12 – 100 g pkgs | 12.5 |
33 | Geitost | 15 | 4 | 500 g | 2.5 |
34 | Sasquatch Ale | 16 | 1 | 24 – 12 oz bottles | 14 |
35 | Steeleye Stout | 16 | 1 | 24 – 12 oz bottles | 18 |
36 | Inlagd Sill | 17 | 8 | 24 – 250 g jars | 19 |
37 | Gravad lax | 17 | 8 | 12 – 500 g pkgs. | 26 |
39 | Chartreuse verte | 18 | 1 | 750 cc per bottle | 18 |
40 | Boston Crab Meat | 19 | 8 | 24 – 4 oz tins | 18.4 |
41 | Jack’s New England Clam Chowder | 19 | 8 | 12 – 12 oz cans | 9.65 |
42 | Singaporean Hokkien Fried Mee | 20 | 5 | 32 – 1 kg pkgs. | 14 |
44 | Gula Malacca | 20 | 2 | 20 – 2 kg bags | 19.45 |
45 | Røgede sild | 21 | 8 | 1k pkg. | 9.5 |
46 | Spegesild | 21 | 8 | 4 – 450 g glasses | 12 |
47 | Zaanse koeken | 22 | 3 | 10 – 4 oz boxes | 9.5 |
48 | Chocolade | 22 | 3 | 10 pkgs. | 12.75 |
49 | Maxilaku | 23 | 3 | 24 – 50 g pkgs. | 20 |
50 | Valkoinen suklaa | 23 | 3 | 12 – 100 g bars | 16.25 |
52 | Filo Mix | 24 | 5 | 16 – 2 kg boxes | 7 |
54 | Tourtière | 25 | 6 | 16 pies | 7.45 |
55 | Pâté chinois | 25 | 6 | 24 boxes x 2 pies | 24 |
57 | Ravioli Angelo | 26 | 5 | 24 – 250 g pkgs. | 19.5 |
58 | Escargots de Bourgogne | 27 | 8 | 24 pieces | 13.25 |
61 | Sirop d’érable | 29 | 2 | 24 – 500 ml bottles | 28.5 |
65 | Louisiana Fiery Hot Pepper Sauce | 2 | 2 | 32 – 8 oz bottles | 21.05 |
66 | Louisiana Hot Spiced Okra | 2 | 2 | 24 – 8 oz jars | 17 |
67 | Laughing Lumberjack Lager | 16 | 1 | 24 – 12 oz bottles | 14 |
68 | Scottish Longbreads | 8 | 3 | 10 boxes x 8 pieces | 12.5 |
70 | Outback Lager | 7 | 1 | 24 – 355 ml bottles | 15 |
71 | Fløtemysost | 15 | 4 | 10 – 500 g pkgs. | 21.5 |
73 | Röd Kaviar | 17 | 8 | 24 – 150 g jars | 15 |
74 | Longlife Tofu | 4 | 7 | 5 kg pkg. | 10 |
75 | Rhönbräu Klosterbier | 12 | 1 | 24 – 0.5 l bottles | 7.75 |
76 | Lakkalikööri | 23 | 1 | 500 ml | 18 |
77 | Original Frankfurter grüne Soße | 12 | 2 | 12 boxes | 13 |
Contoh Kondisi Lebih Besar Sama Dengan #
Gunakan operator >= untuk menuliskan kondisi lebih besar atau sama dengan. Contoh di bawah ini hanya menampilkan data dengan kondisi nilai kolom Price lebih besar atau sama dengan 30.
SELECT * FROM Products
WHERE Price >= 30;
ProductID | ProductName | SupplierID | CategoryID | Unit | Price |
---|---|---|---|---|---|
7 | Uncle Bob’s Organic Dried Pears | 3 | 7 | 12 – 1 lb pkgs. | 30 |
8 | Northwoods Cranberry Sauce | 3 | 2 | 12 – 12 oz jars | 40 |
9 | Mishi Kobe Niku | 4 | 6 | 18 – 500 g pkgs. | 97 |
10 | Ikura | 4 | 8 | 12 – 200 ml jars | 31 |
12 | Queso Manchego La Pastora | 5 | 4 | 10 – 500 g pkgs. | 38 |
17 | Alice Mutton | 7 | 6 | 20 – 1 kg tins | 39 |
18 | Carnarvon Tigers | 7 | 8 | 16 kg pkg. | 62.5 |
20 | Sir Rodney’s Marmalade | 8 | 3 | 30 gift boxes | 81 |
26 | Gumbär Gummibärchen | 11 | 3 | 100 – 250 g bags | 31.23 |
27 | Schoggi Schokolade | 11 | 3 | 100 – 100 g pieces | 43.9 |
28 | Rössle Sauerkraut | 12 | 7 | 25 – 825 g cans | 45.6 |
29 | Thüringer Rostbratwurst | 12 | 6 | 50 bags x 30 sausgs. | 123.79 |
32 | Mascarpone Fabioli | 14 | 4 | 24 – 200 g pkgs. | 32 |
38 | Côte de Blaye | 18 | 1 | 12 – 75 cl bottles | 263.5 |
43 | Ipoh Coffee | 20 | 1 | 16 – 500 g tins | 46 |
51 | Manjimup Dried Apples | 24 | 7 | 50 – 300 g pkgs. | 53 |
53 | Perth Pasties | 24 | 6 | 48 pieces | 32.8 |
56 | Gnocchi di nonna Alice | 26 | 5 | 24 – 250 g pkgs. | 38 |
59 | Raclette Courdavault | 28 | 4 | 5 kg pkg. | 55 |
60 | Camembert Pierrot | 28 | 4 | 15 – 300 g rounds | 34 |
62 | Tarte au sucre | 29 | 3 | 48 pies | 49.3 |
63 | Vegie-spread | 7 | 2 | 15 – 625 g jars | 43.9 |
64 | Wimmers gute Semmelknödel | 12 | 5 | 20 bags x 4 pieces | 33.25 |
69 | Gudbrandsdalsost | 15 | 4 | 10 kg pkg. | 36 |
72 | Mozzarella di Giovanni | 14 | 4 | 24 – 200 g pkgs. | 34.8 |
Contoh Kondisi Lebih Kecil Sama Dengan #
Gunakan operator <= untuk menuliskan kondisi lebih kecil atau sama dengan. Contoh di bawah ini hanya menampilkan data dengan kondisi nilai kolom Price lebih kecil atau sama dengan 30.
SELECT * FROM Products
WHERE Price <= 30;
ProductID | ProductName | SupplierID | CategoryID | Unit | Price |
---|---|---|---|---|---|
1 | Chais | 1 | 1 | 10 boxes x 20 bags | 18 |
2 | Chang | 1 | 1 | 24 – 12 oz bottles | 19 |
3 | Aniseed Syrup | 1 | 2 | 12 – 550 ml bottles | 10 |
4 | Chef Anton’s Cajun Seasoning | 2 | 2 | 48 – 6 oz jars | 22 |
5 | Chef Anton’s Gumbo Mix | 2 | 2 | 36 boxes | 21.35 |
6 | Grandma’s Boysenberry Spread | 3 | 2 | 12 – 8 oz jars | 25 |
7 | Uncle Bob’s Organic Dried Pears | 3 | 7 | 12 – 1 lb pkgs. | 30 |
11 | Queso Cabrales | 5 | 4 | 1 kg pkg. | 21 |
13 | Konbu | 6 | 8 | 2 kg box | 6 |
14 | Tofu | 6 | 7 | 40 – 100 g pkgs. | 23.25 |
15 | Genen Shouyu | 6 | 2 | 24 – 250 ml bottles | 15.5 |
16 | Pavlova | 7 | 3 | 32 – 500 g boxes | 17.45 |
19 | Teatime Chocolate Biscuits | 8 | 3 | 10 boxes x 12 pieces | 9.2 |
21 | Sir Rodney’s Scones | 8 | 3 | 24 pkgs. x 4 pieces | 10 |
22 | Gustaf’s Knäckebröd | 9 | 5 | 24 – 500 g pkgs. | 21 |
23 | Tunnbröd | 9 | 5 | 12 – 250 g pkgs. | 9 |
24 | Guaraná Fantástica | 10 | 1 | 12 – 355 ml cans | 4.5 |
25 | NuNuCa Nuß-Nougat-Creme | 11 | 3 | 20 – 450 g glasses | 14 |
30 | Nord-Ost Matjeshering | 13 | 8 | 10 – 200 g glasses | 25.89 |
31 | Gorgonzola Telino | 14 | 4 | 12 – 100 g pkgs | 12.5 |
33 | Geitost | 15 | 4 | 500 g | 2.5 |
34 | Sasquatch Ale | 16 | 1 | 24 – 12 oz bottles | 14 |
35 | Steeleye Stout | 16 | 1 | 24 – 12 oz bottles | 18 |
36 | Inlagd Sill | 17 | 8 | 24 – 250 g jars | 19 |
37 | Gravad lax | 17 | 8 | 12 – 500 g pkgs. | 26 |
39 | Chartreuse verte | 18 | 1 | 750 cc per bottle | 18 |
40 | Boston Crab Meat | 19 | 8 | 24 – 4 oz tins | 18.4 |
41 | Jack’s New England Clam Chowder | 19 | 8 | 12 – 12 oz cans | 9.65 |
42 | Singaporean Hokkien Fried Mee | 20 | 5 | 32 – 1 kg pkgs. | 14 |
44 | Gula Malacca | 20 | 2 | 20 – 2 kg bags | 19.45 |
45 | Røgede sild | 21 | 8 | 1k pkg. | 9.5 |
46 | Spegesild | 21 | 8 | 4 – 450 g glasses | 12 |
47 | Zaanse koeken | 22 | 3 | 10 – 4 oz boxes | 9.5 |
48 | Chocolade | 22 | 3 | 10 pkgs. | 12.75 |
49 | Maxilaku | 23 | 3 | 24 – 50 g pkgs. | 20 |
50 | Valkoinen suklaa | 23 | 3 | 12 – 100 g bars | 16.25 |
52 | Filo Mix | 24 | 5 | 16 – 2 kg boxes | 7 |
54 | Tourtière | 25 | 6 | 16 pies | 7.45 |
55 | Pâté chinois | 25 | 6 | 24 boxes x 2 pies | 24 |
57 | Ravioli Angelo | 26 | 5 | 24 – 250 g pkgs. | 19.5 |
58 | Escargots de Bourgogne | 27 | 8 | 24 pieces | 13.25 |
61 | Sirop d’érable | 29 | 2 | 24 – 500 ml bottles | 28.5 |
65 | Louisiana Fiery Hot Pepper Sauce | 2 | 2 | 32 – 8 oz bottles | 21.05 |
66 | Louisiana Hot Spiced Okra | 2 | 2 | 24 – 8 oz jars | 17 |
67 | Laughing Lumberjack Lager | 16 | 1 | 24 – 12 oz bottles | 14 |
68 | Scottish Longbreads | 8 | 3 | 10 boxes x 8 pieces | 12.5 |
70 | Outback Lager | 7 | 1 | 24 – 355 ml bottles | 15 |
71 | Fløtemysost | 15 | 4 | 10 – 500 g pkgs. | 21.5 |
73 | Röd Kaviar | 17 | 8 | 24 – 150 g jars | 15 |
74 | Longlife Tofu | 4 | 7 | 5 kg pkg. | 10 |
75 | Rhönbräu Klosterbier | 12 | 1 | 24 – 0.5 l bottles | 7.75 |
76 | Lakkalikööri | 23 | 1 | 500 ml | 18 |
77 | Original Frankfurter grüne Soße | 12 | 2 | 12 boxes | 13 |
Contoh Kondisi Tidak Sama Dengan #
Gunakan operator <> untuk menuliskan kondisi tidak sama dengan. Contoh di bawah ini hanya menampilkan data dengan kondisi nilai kolom Price tidak sama dengan 18.
SELECT * FROM Products
WHERE Price <> 18;
ProductID | ProductName | SupplierID | CategoryID | Unit | Price |
---|---|---|---|---|---|
2 | Chang | 1 | 1 | 24 – 12 oz bottles | 19 |
3 | Aniseed Syrup | 1 | 2 | 12 – 550 ml bottles | 10 |
4 | Chef Anton’s Cajun Seasoning | 2 | 2 | 48 – 6 oz jars | 22 |
5 | Chef Anton’s Gumbo Mix | 2 | 2 | 36 boxes | 21.35 |
6 | Grandma’s Boysenberry Spread | 3 | 2 | 12 – 8 oz jars | 25 |
7 | Uncle Bob’s Organic Dried Pears | 3 | 7 | 12 – 1 lb pkgs. | 30 |
8 | Northwoods Cranberry Sauce | 3 | 2 | 12 – 12 oz jars | 40 |
9 | Mishi Kobe Niku | 4 | 6 | 18 – 500 g pkgs. | 97 |
10 | Ikura | 4 | 8 | 12 – 200 ml jars | 31 |
11 | Queso Cabrales | 5 | 4 | 1 kg pkg. | 21 |
12 | Queso Manchego La Pastora | 5 | 4 | 10 – 500 g pkgs. | 38 |
13 | Konbu | 6 | 8 | 2 kg box | 6 |
14 | Tofu | 6 | 7 | 40 – 100 g pkgs. | 23.25 |
15 | Genen Shouyu | 6 | 2 | 24 – 250 ml bottles | 15.5 |
16 | Pavlova | 7 | 3 | 32 – 500 g boxes | 17.45 |
17 | Alice Mutton | 7 | 6 | 20 – 1 kg tins | 39 |
18 | Carnarvon Tigers | 7 | 8 | 16 kg pkg. | 62.5 |
19 | Teatime Chocolate Biscuits | 8 | 3 | 10 boxes x 12 pieces | 9.2 |
20 | Sir Rodney’s Marmalade | 8 | 3 | 30 gift boxes | 81 |
21 | Sir Rodney’s Scones | 8 | 3 | 24 pkgs. x 4 pieces | 10 |
22 | Gustaf’s Knäckebröd | 9 | 5 | 24 – 500 g pkgs. | 21 |
23 | Tunnbröd | 9 | 5 | 12 – 250 g pkgs. | 9 |
24 | Guaraná Fantástica | 10 | 1 | 12 – 355 ml cans | 4.5 |
25 | NuNuCa Nuß-Nougat-Creme | 11 | 3 | 20 – 450 g glasses | 14 |
26 | Gumbär Gummibärchen | 11 | 3 | 100 – 250 g bags | 31.23 |
27 | Schoggi Schokolade | 11 | 3 | 100 – 100 g pieces | 43.9 |
28 | Rössle Sauerkraut | 12 | 7 | 25 – 825 g cans | 45.6 |
29 | Thüringer Rostbratwurst | 12 | 6 | 50 bags x 30 sausgs. | 123.79 |
30 | Nord-Ost Matjeshering | 13 | 8 | 10 – 200 g glasses | 25.89 |
31 | Gorgonzola Telino | 14 | 4 | 12 – 100 g pkgs | 12.5 |
32 | Mascarpone Fabioli | 14 | 4 | 24 – 200 g pkgs. | 32 |
33 | Geitost | 15 | 4 | 500 g | 2.5 |
34 | Sasquatch Ale | 16 | 1 | 24 – 12 oz bottles | 14 |
36 | Inlagd Sill | 17 | 8 | 24 – 250 g jars | 19 |
37 | Gravad lax | 17 | 8 | 12 – 500 g pkgs. | 26 |
38 | Côte de Blaye | 18 | 1 | 12 – 75 cl bottles | 263.5 |
40 | Boston Crab Meat | 19 | 8 | 24 – 4 oz tins | 18.4 |
41 | Jack’s New England Clam Chowder | 19 | 8 | 12 – 12 oz cans | 9.65 |
42 | Singaporean Hokkien Fried Mee | 20 | 5 | 32 – 1 kg pkgs. | 14 |
43 | Ipoh Coffee | 20 | 1 | 16 – 500 g tins | 46 |
44 | Gula Malacca | 20 | 2 | 20 – 2 kg bags | 19.45 |
45 | Røgede sild | 21 | 8 | 1k pkg. | 9.5 |
46 | Spegesild | 21 | 8 | 4 – 450 g glasses | 12 |
47 | Zaanse koeken | 22 | 3 | 10 – 4 oz boxes | 9.5 |
48 | Chocolade | 22 | 3 | 10 pkgs. | 12.75 |
49 | Maxilaku | 23 | 3 | 24 – 50 g pkgs. | 20 |
50 | Valkoinen suklaa | 23 | 3 | 12 – 100 g bars | 16.25 |
51 | Manjimup Dried Apples | 24 | 7 | 50 – 300 g pkgs. | 53 |
52 | Filo Mix | 24 | 5 | 16 – 2 kg boxes | 7 |
53 | Perth Pasties | 24 | 6 | 48 pieces | 32.8 |
54 | Tourtière | 25 | 6 | 16 pies | 7.45 |
55 | Pâté chinois | 25 | 6 | 24 boxes x 2 pies | 24 |
56 | Gnocchi di nonna Alice | 26 | 5 | 24 – 250 g pkgs. | 38 |
57 | Ravioli Angelo | 26 | 5 | 24 – 250 g pkgs. | 19.5 |
58 | Escargots de Bourgogne | 27 | 8 | 24 pieces | 13.25 |
59 | Raclette Courdavault | 28 | 4 | 5 kg pkg. | 55 |
60 | Camembert Pierrot | 28 | 4 | 15 – 300 g rounds | 34 |
61 | Sirop d’érable | 29 | 2 | 24 – 500 ml bottles | 28.5 |
62 | Tarte au sucre | 29 | 3 | 48 pies | 49.3 |
63 | Vegie-spread | 7 | 2 | 15 – 625 g jars | 43.9 |
64 | Wimmers gute Semmelknödel | 12 | 5 | 20 bags x 4 pieces | 33.25 |
65 | Louisiana Fiery Hot Pepper Sauce | 2 | 2 | 32 – 8 oz bottles | 21.05 |
66 | Louisiana Hot Spiced Okra | 2 | 2 | 24 – 8 oz jars | 17 |
67 | Laughing Lumberjack Lager | 16 | 1 | 24 – 12 oz bottles | 14 |
68 | Scottish Longbreads | 8 | 3 | 10 boxes x 8 pieces | 12.5 |
69 | Gudbrandsdalsost | 15 | 4 | 10 kg pkg. | 36 |
70 | Outback Lager | 7 | 1 | 24 – 355 ml bottles | 15 |
71 | Fløtemysost | 15 | 4 | 10 – 500 g pkgs. | 21.5 |
72 | Mozzarella di Giovanni | 14 | 4 | 24 – 200 g pkgs. | 34.8 |
73 | Röd Kaviar | 17 | 8 | 24 – 150 g jars | 15 |
74 | Longlife Tofu | 4 | 7 | 5 kg pkg. | 10 |
75 | Rhönbräu Klosterbier | 12 | 1 | 24 – 0.5 l bottles | 7.75 |
77 | Original Frankfurter grüne Soße | 12 | 2 | 12 boxes | 13 |
Kondisi Menampilkan Data Dalam Range Tertentu #
Gunakan BETWEEN AND untuk menuliskan kondisi untuk menampilkan data dalam range tertentu. Contoh di bawah ini hanya menampilkan data dengan kondisi nilai kolom Price bernilai di antara 50 sampai 60.
SELECT * FROM Products
WHERE Price BETWEEN 50 AND 60;
ProductID | ProductName | SupplierID | CategoryID | Unit | Price |
---|---|---|---|---|---|
51 | Manjimup Dried Apples | 24 | 7 | 50 – 300 g pkgs. | 53 |
59 | Raclette Courdavault | 28 | 4 | 5 kg pkg. | 55 |
Contoh Kondisi LIKE #
Contoh di bawah ini hanya menampilkan data dengan kondisi nilai kolom City berawalan huruf s.
SELECT * FROM Customers
WHERE City LIKE 's%';
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
7 | Blondel père et fils | Frédérique Citeaux | 24, place Kléber | Strasbourg | 67000 | France |
15 | Comércio Mineiro | Pedro Afonso | Av. dos Lusíadas, 23 | São Paulo | 05432-043 | Brazil |
21 | Familia Arquibaldo | Aria Cruz | Rua Orós, 92 | São Paulo | 05442-030 | Brazil |
30 | Godos Cocina Típica | José Pedro Freyre | C/ Romero, 33 | Sevilla | 41101 | Spain |
35 | HILARIÓN-Abastos | Carlos Hernández | Carrera 22 con Ave. Carlos Soublette #8-35 | San Cristóbal | 5022 | Venezuela |
45 | Let’s Stop N Shop | Jaime Yorres | 87 Polk St. Suite 5 | San Francisco | 94117 | USA |
59 | Piccolo und mehr | Georg Pipps | Geislweg 14 | Salzburg | 5020 | Austria |
62 | Queen Cozinha | Lúcia Carvalho | Alameda dos Canàrios, 891 | São Paulo | 05487-020 | Brazil |
70 | Santé Gourmet | Jonas Bergulfsen | Erling Skakkes gate 78 | Stavern | 4110 | Norway |
81 | Tradição Hipermercados | Anabela Domingues | Av. Inês de Castro, 414 | São Paulo | 05634-030 | Brazil |
86 | Die Wandernde Kuh | Rita Müller | Adenauerallee 900 | Stuttgart | 70563 | Germany |
89 | White Clover Markets | Karl Jablonski | 305 – 14th Ave. S. Suite 3B | Seattle | 98128 | USA |
Contoh Kondisi IN #
Gunakan kondisi IN untuk melakukan filter data berdasarkan beberapa nilai tertentu. Contoh di bawah ini akan menampilkan data dengan kondisi nilai kolom City bernilai ‘Paris’ atau ‘London’.
SELECT * FROM Customers
WHERE City IN ('Paris','London');
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
4 | Around the Horn | Thomas Hardy | 120 Hanover Sq. | London | WA1 1DP | UK |
11 | B’s Beverages | Victoria Ashworth | Fauntleroy Circus | London | EC2 5NT | UK |
16 | Consolidated Holdings | Elizabeth Brown | Berkeley Gardens 12 Brewery | London | WX1 6LT | UK |
19 | Eastern Connection | Ann Devon | 35 King George | London | WX3 6FW | UK |
53 | North/South | Simon Crowther | South House 300 Queensbridge | London | SW7 1RZ | UK |
57 | Paris spécialités | Marie Bertrand | 265, boulevard Charonne | Paris | 75012 | France |
72 | Seven Seas Imports | Hari Kumar | 90 Wadhurst Rd. | London | OX15 4NB | UK |
74 | Spécialités du monde | Dominique Perrier | 25, rue Lauriston | Paris | 75016 | France |
Menggabungkan Kondisi #
Query SELECT WHERE juga bisa menggunakan gabungan beberapa kondisi sekaligus. Penggabungan kondisi bisa menggunakan keyword AND atau keyword OR. Penggabungan dengan menggunakan AND menyebabkan satu baris data lolos filter apabila memenuhi semua kondisi yang digabungkan. Penggabungan dengan menggunakan OR menyebabkan satu baris data lolos filter apabila memenuhi salah satu kondisi yang digabungkan.
Berikut adalah format penggabungan kondisi dengan menggunakan AND.
SELECT column1, column2, ...
FROM table_name
WHERE condition1 AND condition2 AND condition3 ...;
Berikut adalah format penggabungan kondisi dengan menggunakan OR.
SELECT column1, column2, ...
FROM table_name
WHERE condition1 OR condition2 OR condition3 ...;
Kita juga dapat menggunakan NOT untuk melakukan negasi pada kondisi. Dengan menggunakan keyword NOT maka satu baris data akan lolos filter apabila tidak memenuhi kondisi yang diberikan. Di bawah ini adalah format pemakaian kondisi NOT.
SELECT column1, column2, ...
FROM table_name
WHERE NOT condition;
Contoh Penggunaan AND #
Contoh di bawah ini hanya menampilkan data dengan kondisi nilai kolom Country sama dengan ‘Germany’ dan kolom City sama dengan ‘Berlin’.
SELECT * FROM Customers
WHERE Country='Germany' AND City='Berlin';
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
1 | Alfreds Futterkiste | Maria Anders | Obere Str. 57 | Berlin | 12209 | Germany |
Contoh Penggunaan OR #
Contoh di bawah ini menampilkan data dengan kondisi nilai kolom City sama dengan ‘Berlin’ atau sama dengan ‘Munchen’.
SELECT * FROM Customers
WHERE City='Berlin' OR City='München';
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
1 | Alfreds Futterkiste | Maria Anders | Obere Str. 57 | Berlin | 12209 | Germany |
25 | Frankenversand | Peter Franken | Berliner Platz 43 | München | 80805 | Germany |
Contoh di bawah ini menampilkan data dengan kondisi nilai kolom Country sama dengan ‘Germany’ atau sama dengan ‘Spain’.
SELECT * FROM Customers
WHERE Country='Germany' OR Country='Spain';
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
1 | Alfreds Futterkiste | Maria Anders | Obere Str. 57 | Berlin | 12209 | Germany |
6 | Blauer See Delikatessen | Hanna Moos | Forsterstr. 57 | Mannheim | 68306 | Germany |
8 | Bólido Comidas preparadas | Martín Sommer | C/ Araquil, 67 | Madrid | 28023 | Spain |
17 | Drachenblut Delikatessend | Sven Ottlieb | Walserweg 21 | Aachen | 52066 | Germany |
22 | FISSA Fabrica Inter. Salchichas S.A. | Diego Roel | C/ Moralzarzal, 86 | Madrid | 28034 | Spain |
25 | Frankenversand | Peter Franken | Berliner Platz 43 | München | 80805 | Germany |
29 | Galería del gastrónomo | Eduardo Saavedra | Rambla de Cataluña, 23 | Barcelona | 08022 | Spain |
30 | Godos Cocina Típica | José Pedro Freyre | C/ Romero, 33 | Sevilla | 41101 | Spain |
39 | Königlich Essen | Philip Cramer | Maubelstr. 90 | Brandenburg | 14776 | Germany |
44 | Lehmanns Marktstand | Renate Messner | Magazinweg 7 | Frankfurt a.M. | 60528 | Germany |
52 | Morgenstern Gesundkost | Alexander Feuer | Heerstr. 22 | Leipzig | 04179 | Germany |
56 | Ottilies Käseladen | Henriette Pfalzheim | Mehrheimerstr. 369 | Köln | 50739 | Germany |
63 | QUICK-Stop | Horst Kloss | Taucherstraße 10 | Cunewalde | 01307 | Germany |
69 | Romero y tomillo | Alejandra Camino | Gran Vía, 1 | Madrid | 28001 | Spain |
79 | Toms Spezialitäten | Karin Josephs | Luisenstr. 48 | Münster | 44087 | Germany |
86 | Die Wandernde Kuh | Rita Müller | Adenauerallee 900 | Stuttgart | 70563 | Germany |
Contoh Penggunaan NOT #
Contoh di bawah ini menampilkan data dengan kondisi nilai kolom Country tidak sama dengan ‘Germany’.
SELECT * FROM Customers
WHERE NOT Country='Germany';
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
2 | Ana Trujillo Emparedados y helados | Ana Trujillo | Avda. de la Constitución 2222 | México D.F. | 05021 | Mexico |
3 | Antonio Moreno Taquería | Antonio Moreno | Mataderos 2312 | México D.F. | 05023 | Mexico |
4 | Around the Horn | Thomas Hardy | 120 Hanover Sq. | London | WA1 1DP | UK |
5 | Berglunds snabbköp | Christina Berglund | Berguvsvägen 8 | Luleå | S-958 22 | Sweden |
7 | Blondel père et fils | Frédérique Citeaux | 24, place Kléber | Strasbourg | 67000 | France |
8 | Bólido Comidas preparadas | Martín Sommer | C/ Araquil, 67 | Madrid | 28023 | Spain |
9 | Bon app’ | Laurence Lebihans | 12, rue des Bouchers | Marseille | 13008 | France |
10 | Bottom-Dollar Marketse | Elizabeth Lincoln | 23 Tsawassen Blvd. | Tsawassen | T2F 8M4 | Canada |
11 | B’s Beverages | Victoria Ashworth | Fauntleroy Circus | London | EC2 5NT | UK |
12 | Cactus Comidas para llevar | Patricio Simpson | Cerrito 333 | Buenos Aires | 1010 | Argentina |
13 | Centro comercial Moctezuma | Francisco Chang | Sierras de Granada 9993 | México D.F. | 05022 | Mexico |
14 | Chop-suey Chinese | Yang Wang | Hauptstr. 29 | Bern | 3012 | Switzerland |
15 | Comércio Mineiro | Pedro Afonso | Av. dos Lusíadas, 23 | São Paulo | 05432-043 | Brazil |
16 | Consolidated Holdings | Elizabeth Brown | Berkeley Gardens 12 Brewery | London | WX1 6LT | UK |
18 | Du monde entier | Janine Labrune | 67, rue des Cinquante Otages | Nantes | 44000 | France |
19 | Eastern Connection | Ann Devon | 35 King George | London | WX3 6FW | UK |
20 | Ernst Handel | Roland Mendel | Kirchgasse 6 | Graz | 8010 | Austria |
21 | Familia Arquibaldo | Aria Cruz | Rua Orós, 92 | São Paulo | 05442-030 | Brazil |
22 | FISSA Fabrica Inter. Salchichas S.A. | Diego Roel | C/ Moralzarzal, 86 | Madrid | 28034 | Spain |
23 | Folies gourmandes | Martine Rancé | 184, chaussée de Tournai | Lille | 59000 | France |
24 | Folk och fä HB | Maria Larsson | Åkergatan 24 | Bräcke | S-844 67 | Sweden |
26 | France restauration | Carine Schmitt | 54, rue Royale | Nantes | 44000 | France |
27 | Franchi S.p.A. | Paolo Accorti | Via Monte Bianco 34 | Torino | 10100 | Italy |
28 | Furia Bacalhau e Frutos do Mar | Lino Rodriguez | Jardim das rosas n. 32 | Lisboa | 1675 | Portugal |
29 | Galería del gastrónomo | Eduardo Saavedra | Rambla de Cataluña, 23 | Barcelona | 08022 | Spain |
30 | Godos Cocina Típica | José Pedro Freyre | C/ Romero, 33 | Sevilla | 41101 | Spain |
31 | Gourmet Lanchonetes | André Fonseca | Av. Brasil, 442 | Campinas | 04876-786 | Brazil |
32 | Great Lakes Food Market | Howard Snyder | 2732 Baker Blvd. | Eugene | 97403 | USA |
33 | GROSELLA-Restaurante | Manuel Pereira | 5ª Ave. Los Palos Grandes | Caracas | 1081 | Venezuela |
34 | Hanari Carnes | Mario Pontes | Rua do Paço, 67 | Rio de Janeiro | 05454-876 | Brazil |
35 | HILARIÓN-Abastos | Carlos Hernández | Carrera 22 con Ave. Carlos Soublette #8-35 | San Cristóbal | 5022 | Venezuela |
36 | Hungry Coyote Import Store | Yoshi Latimer | City Center Plaza 516 Main St. | Elgin | 97827 | USA |
37 | Hungry Owl All-Night Grocers | Patricia McKenna | 8 Johnstown Road | Cork | Ireland | |
38 | Island Trading | Helen Bennett | Garden House Crowther Way | Cowes | PO31 7PJ | UK |
40 | La corne d’abondance | Daniel Tonini | 67, avenue de l’Europe | Versailles | 78000 | France |
41 | La maison d’Asie | Annette Roulet | 1 rue Alsace-Lorraine | Toulouse | 31000 | France |
42 | Laughing Bacchus Wine Cellars | Yoshi Tannamuri | 1900 Oak St. | Vancouver | V3F 2K1 | Canada |
43 | Lazy K Kountry Store | John Steel | 12 Orchestra Terrace | Walla Walla | 99362 | USA |
45 | Let’s Stop N Shop | Jaime Yorres | 87 Polk St. Suite 5 | San Francisco | 94117 | USA |
46 | LILA-Supermercado | Carlos González | Carrera 52 con Ave. Bolívar #65-98 Llano Largo | Barquisimeto | 3508 | Venezuela |
47 | LINO-Delicateses | Felipe Izquierdo | Ave. 5 de Mayo Porlamar | I. de Margarita | 4980 | Venezuela |
48 | Lonesome Pine Restaurant | Fran Wilson | 89 Chiaroscuro Rd. | Portland | 97219 | USA |
49 | Magazzini Alimentari Riuniti | Giovanni Rovelli | Via Ludovico il Moro 22 | Bergamo | 24100 | Italy |
50 | Maison Dewey | Catherine Dewey | Rue Joseph-Bens 532 | Bruxelles | B-1180 | Belgium |
51 | Mère Paillarde | Jean Fresnière | 43 rue St. Laurent | Montréal | H1J 1C3 | Canada |
53 | North/South | Simon Crowther | South House 300 Queensbridge | London | SW7 1RZ | UK |
54 | Océano Atlántico Ltda. | Yvonne Moncada | Ing. Gustavo Moncada 8585 Piso 20-A | Buenos Aires | 1010 | Argentina |
55 | Old World Delicatessen | Rene Phillips | 2743 Bering St. | Anchorage | 99508 | USA |
57 | Paris spécialités | Marie Bertrand | 265, boulevard Charonne | Paris | 75012 | France |
58 | Pericles Comidas clásicas | Guillermo Fernández | Calle Dr. Jorge Cash 321 | México D.F. | 05033 | Mexico |
59 | Piccolo und mehr | Georg Pipps | Geislweg 14 | Salzburg | 5020 | Austria |
60 | Princesa Isabel Vinhoss | Isabel de Castro | Estrada da saúde n. 58 | Lisboa | 1756 | Portugal |
61 | Que Delícia | Bernardo Batista | Rua da Panificadora, 12 | Rio de Janeiro | 02389-673 | Brazil |
62 | Queen Cozinha | Lúcia Carvalho | Alameda dos Canàrios, 891 | São Paulo | 05487-020 | Brazil |
64 | Rancho grande | Sergio Gutiérrez | Av. del Libertador 900 | Buenos Aires | 1010 | Argentina |
65 | Rattlesnake Canyon Grocery | Paula Wilson | 2817 Milton Dr. | Albuquerque | 87110 | USA |
66 | Reggiani Caseifici | Maurizio Moroni | Strada Provinciale 124 | Reggio Emilia | 42100 | Italy |
67 | Ricardo Adocicados | Janete Limeira | Av. Copacabana, 267 | Rio de Janeiro | 02389-890 | Brazil |
68 | Richter Supermarkt | Michael Holz | Grenzacherweg 237 | Genève | 1203 | Switzerland |
69 | Romero y tomillo | Alejandra Camino | Gran Vía, 1 | Madrid | 28001 | Spain |
70 | Santé Gourmet | Jonas Bergulfsen | Erling Skakkes gate 78 | Stavern | 4110 | Norway |
71 | Save-a-lot Markets | Jose Pavarotti | 187 Suffolk Ln. | Boise | 83720 | USA |
72 | Seven Seas Imports | Hari Kumar | 90 Wadhurst Rd. | London | OX15 4NB | UK |
73 | Simons bistro | Jytte Petersen | Vinbæltet 34 | København | 1734 | Denmark |
74 | Spécialités du monde | Dominique Perrier | 25, rue Lauriston | Paris | 75016 | France |
75 | Split Rail Beer & Ale | Art Braunschweiger | P.O. Box 555 | Lander | 82520 | USA |
76 | Suprêmes délices | Pascale Cartrain | Boulevard Tirou, 255 | Charleroi | B-6000 | Belgium |
77 | The Big Cheese | Liz Nixon | 89 Jefferson Way Suite 2 | Portland | 97201 | USA |
78 | The Cracker Box | Liu Wong | 55 Grizzly Peak Rd. | Butte | 59801 | USA |
80 | Tortuga Restaurante | Miguel Angel Paolino | Avda. Azteca 123 | México D.F. | 05033 | Mexico |
81 | Tradição Hipermercados | Anabela Domingues | Av. Inês de Castro, 414 | São Paulo | 05634-030 | Brazil |
82 | Trail’s Head Gourmet Provisioners | Helvetius Nagy | 722 DaVinci Blvd. | Kirkland | 98034 | USA |
83 | Vaffeljernet | Palle Ibsen | Smagsløget 45 | Århus | 8200 | Denmark |
84 | Victuailles en stock | Mary Saveley | 2, rue du Commerce | Lyon | 69004 | France |
85 | Vins et alcools Chevalier | Paul Henriot | 59 rue de l’Abbaye | Reims | 51100 | France |
87 | Wartian Herkku | Pirkko Koskitalo | Torikatu 38 | Oulu | 90110 | Finland |
88 | Wellington Importadora | Paula Parente | Rua do Mercado, 12 | Resende | 08737-363 | Brazil |
89 | White Clover Markets | Karl Jablonski | 305 – 14th Ave. S. Suite 3B | Seattle | 98128 | USA |
90 | Wilman Kala | Matti Karttunen | Keskuskatu 45 | Helsinki | 21240 | Finland |
91 | Wolski | Zbyszek | ul. Filtrowa 68 | Walla | 01-012 | Poland |
Contoh Penggunaan AND Dan OR #
Contoh di bawah ini menampilkan data dengan kondisi nilai kolom Country sama dengan ‘Germany’ dan nilai kolom City sama dengan ‘Berlin’ atau sama dengan ‘Munchen’. Kondisi OR dijadikan satu kondisi tersendiri kemudian digabungkan dengan kondisi AND.
SELECT * FROM Customers
WHERE Country='Germany' AND (City='Berlin' OR City='München');
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
1 | Alfreds Futterkiste | Maria Anders | Obere Str. 57 | Berlin | 12209 | Germany |
25 | Frankenversand | Peter Franken | Berliner Platz 43 | München | 80805 | Germany |
Contoh Penggunaan AND Dan NOT #
Contoh di bawah ini menampilkan data dengan kondisi nilai kolom Contry tidak sama dengan ‘Germany’ dan juga tidak sama dengan ‘USA’.
SELECT * FROM Customers
WHERE NOT Country='Germany' AND NOT Country='USA';
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
2 | Ana Trujillo Emparedados y helados | Ana Trujillo | Avda. de la Constitución 2222 | México D.F. | 05021 | Mexico |
3 | Antonio Moreno Taquería | Antonio Moreno | Mataderos 2312 | México D.F. | 05023 | Mexico |
4 | Around the Horn | Thomas Hardy | 120 Hanover Sq. | London | WA1 1DP | UK |
5 | Berglunds snabbköp | Christina Berglund | Berguvsvägen 8 | Luleå | S-958 22 | Sweden |
7 | Blondel père et fils | Frédérique Citeaux | 24, place Kléber | Strasbourg | 67000 | France |
8 | Bólido Comidas preparadas | Martín Sommer | C/ Araquil, 67 | Madrid | 28023 | Spain |
9 | Bon app’ | Laurence Lebihans | 12, rue des Bouchers | Marseille | 13008 | France |
10 | Bottom-Dollar Marketse | Elizabeth Lincoln | 23 Tsawassen Blvd. | Tsawassen | T2F 8M4 | Canada |
11 | B’s Beverages | Victoria Ashworth | Fauntleroy Circus | London | EC2 5NT | UK |
12 | Cactus Comidas para llevar | Patricio Simpson | Cerrito 333 | Buenos Aires | 1010 | Argentina |
13 | Centro comercial Moctezuma | Francisco Chang | Sierras de Granada 9993 | México D.F. | 05022 | Mexico |
14 | Chop-suey Chinese | Yang Wang | Hauptstr. 29 | Bern | 3012 | Switzerland |
15 | Comércio Mineiro | Pedro Afonso | Av. dos Lusíadas, 23 | São Paulo | 05432-043 | Brazil |
16 | Consolidated Holdings | Elizabeth Brown | Berkeley Gardens 12 Brewery | London | WX1 6LT | UK |
18 | Du monde entier | Janine Labrune | 67, rue des Cinquante Otages | Nantes | 44000 | France |
19 | Eastern Connection | Ann Devon | 35 King George | London | WX3 6FW | UK |
20 | Ernst Handel | Roland Mendel | Kirchgasse 6 | Graz | 8010 | Austria |
21 | Familia Arquibaldo | Aria Cruz | Rua Orós, 92 | São Paulo | 05442-030 | Brazil |
22 | FISSA Fabrica Inter. Salchichas S.A. | Diego Roel | C/ Moralzarzal, 86 | Madrid | 28034 | Spain |
23 | Folies gourmandes | Martine Rancé | 184, chaussée de Tournai | Lille | 59000 | France |
24 | Folk och fä HB | Maria Larsson | Åkergatan 24 | Bräcke | S-844 67 | Sweden |
26 | France restauration | Carine Schmitt | 54, rue Royale | Nantes | 44000 | France |
27 | Franchi S.p.A. | Paolo Accorti | Via Monte Bianco 34 | Torino | 10100 | Italy |
28 | Furia Bacalhau e Frutos do Mar | Lino Rodriguez | Jardim das rosas n. 32 | Lisboa | 1675 | Portugal |
29 | Galería del gastrónomo | Eduardo Saavedra | Rambla de Cataluña, 23 | Barcelona | 08022 | Spain |
30 | Godos Cocina Típica | José Pedro Freyre | C/ Romero, 33 | Sevilla | 41101 | Spain |
31 | Gourmet Lanchonetes | André Fonseca | Av. Brasil, 442 | Campinas | 04876-786 | Brazil |
33 | GROSELLA-Restaurante | Manuel Pereira | 5ª Ave. Los Palos Grandes | Caracas | 1081 | Venezuela |
34 | Hanari Carnes | Mario Pontes | Rua do Paço, 67 | Rio de Janeiro | 05454-876 | Brazil |
35 | HILARIÓN-Abastos | Carlos Hernández | Carrera 22 con Ave. Carlos Soublette #8-35 | San Cristóbal | 5022 | Venezuela |
37 | Hungry Owl All-Night Grocers | Patricia McKenna | 8 Johnstown Road | Cork | Ireland | |
38 | Island Trading | Helen Bennett | Garden House Crowther Way | Cowes | PO31 7PJ | UK |
40 | La corne d’abondance | Daniel Tonini | 67, avenue de l’Europe | Versailles | 78000 | France |
41 | La maison d’Asie | Annette Roulet | 1 rue Alsace-Lorraine | Toulouse | 31000 | France |
42 | Laughing Bacchus Wine Cellars | Yoshi Tannamuri | 1900 Oak St. | Vancouver | V3F 2K1 | Canada |
46 | LILA-Supermercado | Carlos González | Carrera 52 con Ave. Bolívar #65-98 Llano Largo | Barquisimeto | 3508 | Venezuela |
47 | LINO-Delicateses | Felipe Izquierdo | Ave. 5 de Mayo Porlamar | I. de Margarita | 4980 | Venezuela |
49 | Magazzini Alimentari Riuniti | Giovanni Rovelli | Via Ludovico il Moro 22 | Bergamo | 24100 | Italy |
50 | Maison Dewey | Catherine Dewey | Rue Joseph-Bens 532 | Bruxelles | B-1180 | Belgium |
51 | Mère Paillarde | Jean Fresnière | 43 rue St. Laurent | Montréal | H1J 1C3 | Canada |
53 | North/South | Simon Crowther | South House 300 Queensbridge | London | SW7 1RZ | UK |
54 | Océano Atlántico Ltda. | Yvonne Moncada | Ing. Gustavo Moncada 8585 Piso 20-A | Buenos Aires | 1010 | Argentina |
57 | Paris spécialités | Marie Bertrand | 265, boulevard Charonne | Paris | 75012 | France |
58 | Pericles Comidas clásicas | Guillermo Fernández | Calle Dr. Jorge Cash 321 | México D.F. | 05033 | Mexico |
59 | Piccolo und mehr | Georg Pipps | Geislweg 14 | Salzburg | 5020 | Austria |
60 | Princesa Isabel Vinhoss | Isabel de Castro | Estrada da saúde n. 58 | Lisboa | 1756 | Portugal |
61 | Que Delícia | Bernardo Batista | Rua da Panificadora, 12 | Rio de Janeiro | 02389-673 | Brazil |
62 | Queen Cozinha | Lúcia Carvalho | Alameda dos Canàrios, 891 | São Paulo | 05487-020 | Brazil |
64 | Rancho grande | Sergio Gutiérrez | Av. del Libertador 900 | Buenos Aires | 1010 | Argentina |
66 | Reggiani Caseifici | Maurizio Moroni | Strada Provinciale 124 | Reggio Emilia | 42100 | Italy |
67 | Ricardo Adocicados | Janete Limeira | Av. Copacabana, 267 | Rio de Janeiro | 02389-890 | Brazil |
68 | Richter Supermarkt | Michael Holz | Grenzacherweg 237 | Genève | 1203 | Switzerland |
69 | Romero y tomillo | Alejandra Camino | Gran Vía, 1 | Madrid | 28001 | Spain |
70 | Santé Gourmet | Jonas Bergulfsen | Erling Skakkes gate 78 | Stavern | 4110 | Norway |
72 | Seven Seas Imports | Hari Kumar | 90 Wadhurst Rd. | London | OX15 4NB | UK |
73 | Simons bistro | Jytte Petersen | Vinbæltet 34 | København | 1734 | Denmark |
74 | Spécialités du monde | Dominique Perrier | 25, rue Lauriston | Paris | 75016 | France |
76 | Suprêmes délices | Pascale Cartrain | Boulevard Tirou, 255 | Charleroi | B-6000 | Belgium |
80 | Tortuga Restaurante | Miguel Angel Paolino | Avda. Azteca 123 | México D.F. | 05033 | Mexico |
81 | Tradição Hipermercados | Anabela Domingues | Av. Inês de Castro, 414 | São Paulo | 05634-030 | Brazil |
83 | Vaffeljernet | Palle Ibsen | Smagsløget 45 | Århus | 8200 | Denmark |
84 | Victuailles en stock | Mary Saveley | 2, rue du Commerce | Lyon | 69004 | France |
85 | Vins et alcools Chevalier | Paul Henriot | 59 rue de l’Abbaye | Reims | 51100 | France |
87 | Wartian Herkku | Pirkko Koskitalo | Torikatu 38 | Oulu | 90110 | Finland |
88 | Wellington Importadora | Paula Parente | Rua do Mercado, 12 | Resende | 08737-363 | Brazil |
90 | Wilman Kala | Matti Karttunen | Keskuskatu 45 | Helsinki | 21240 | Finland |
91 | Wolski | Zbyszek | ul. Filtrowa 68 | Walla | 01-012 | Poland |
Mengurutkan Hasil Query #
Hasil query juga bisa diurutkan berdasarkan kriteria dan kolom tertentu. Gunakan keyword ORDER BY untuk mengurutkan hasil query. Pengurutan bisa dari nilai paling kecil sampai nilai paling besar (ASC) atau bisa juga dari nilai paling besar sampai nilai paling kecil (DESC). Secara default pengurutan memakai mode ASC. Berikut adalah format query dengan menggunakan pengurutan.
SELECT column1, column2, ...
FROM table_name
ORDER BY column1, column2, ... ASC|DESC;
Pengurutan juga bisa dilakukan pada kolom dengan tipe data text. Setiap database mempunyai aturan sendiri untuk pengurutan text.
Contoh Penggunaan ORDER BY #
Contoh di bawah ini menampilkan data dengan mengurutkan kolom Country.
SELECT * FROM Customers
ORDER BY Country;
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
12 | Cactus Comidas para llevar | Patricio Simpson | Cerrito 333 | Buenos Aires | 1010 | Argentina |
54 | Océano Atlántico Ltda. | Yvonne Moncada | Ing. Gustavo Moncada 8585 Piso 20-A | Buenos Aires | 1010 | Argentina |
64 | Rancho grande | Sergio Gutiérrez | Av. del Libertador 900 | Buenos Aires | 1010 | Argentina |
20 | Ernst Handel | Roland Mendel | Kirchgasse 6 | Graz | 8010 | Austria |
59 | Piccolo und mehr | Georg Pipps | Geislweg 14 | Salzburg | 5020 | Austria |
50 | Maison Dewey | Catherine Dewey | Rue Joseph-Bens 532 | Bruxelles | B-1180 | Belgium |
76 | Suprêmes délices | Pascale Cartrain | Boulevard Tirou, 255 | Charleroi | B-6000 | Belgium |
15 | Comércio Mineiro | Pedro Afonso | Av. dos Lusíadas, 23 | São Paulo | 05432-043 | Brazil |
21 | Familia Arquibaldo | Aria Cruz | Rua Orós, 92 | São Paulo | 05442-030 | Brazil |
31 | Gourmet Lanchonetes | André Fonseca | Av. Brasil, 442 | Campinas | 04876-786 | Brazil |
34 | Hanari Carnes | Mario Pontes | Rua do Paço, 67 | Rio de Janeiro | 05454-876 | Brazil |
61 | Que Delícia | Bernardo Batista | Rua da Panificadora, 12 | Rio de Janeiro | 02389-673 | Brazil |
62 | Queen Cozinha | Lúcia Carvalho | Alameda dos Canàrios, 891 | São Paulo | 05487-020 | Brazil |
67 | Ricardo Adocicados | Janete Limeira | Av. Copacabana, 267 | Rio de Janeiro | 02389-890 | Brazil |
81 | Tradição Hipermercados | Anabela Domingues | Av. Inês de Castro, 414 | São Paulo | 05634-030 | Brazil |
88 | Wellington Importadora | Paula Parente | Rua do Mercado, 12 | Resende | 08737-363 | Brazil |
10 | Bottom-Dollar Marketse | Elizabeth Lincoln | 23 Tsawassen Blvd. | Tsawassen | T2F 8M4 | Canada |
42 | Laughing Bacchus Wine Cellars | Yoshi Tannamuri | 1900 Oak St. | Vancouver | V3F 2K1 | Canada |
51 | Mère Paillarde | Jean Fresnière | 43 rue St. Laurent | Montréal | H1J 1C3 | Canada |
73 | Simons bistro | Jytte Petersen | Vinbæltet 34 | København | 1734 | Denmark |
83 | Vaffeljernet | Palle Ibsen | Smagsløget 45 | Århus | 8200 | Denmark |
87 | Wartian Herkku | Pirkko Koskitalo | Torikatu 38 | Oulu | 90110 | Finland |
90 | Wilman Kala | Matti Karttunen | Keskuskatu 45 | Helsinki | 21240 | Finland |
7 | Blondel père et fils | Frédérique Citeaux | 24, place Kléber | Strasbourg | 67000 | France |
9 | Bon app’ | Laurence Lebihans | 12, rue des Bouchers | Marseille | 13008 | France |
18 | Du monde entier | Janine Labrune | 67, rue des Cinquante Otages | Nantes | 44000 | France |
23 | Folies gourmandes | Martine Rancé | 184, chaussée de Tournai | Lille | 59000 | France |
26 | France restauration | Carine Schmitt | 54, rue Royale | Nantes | 44000 | France |
40 | La corne d’abondance | Daniel Tonini | 67, avenue de l’Europe | Versailles | 78000 | France |
41 | La maison d’Asie | Annette Roulet | 1 rue Alsace-Lorraine | Toulouse | 31000 | France |
57 | Paris spécialités | Marie Bertrand | 265, boulevard Charonne | Paris | 75012 | France |
74 | Spécialités du monde | Dominique Perrier | 25, rue Lauriston | Paris | 75016 | France |
84 | Victuailles en stock | Mary Saveley | 2, rue du Commerce | Lyon | 69004 | France |
85 | Vins et alcools Chevalier | Paul Henriot | 59 rue de l’Abbaye | Reims | 51100 | France |
1 | Alfreds Futterkiste | Maria Anders | Obere Str. 57 | Berlin | 12209 | Germany |
6 | Blauer See Delikatessen | Hanna Moos | Forsterstr. 57 | Mannheim | 68306 | Germany |
17 | Drachenblut Delikatessend | Sven Ottlieb | Walserweg 21 | Aachen | 52066 | Germany |
25 | Frankenversand | Peter Franken | Berliner Platz 43 | München | 80805 | Germany |
39 | Königlich Essen | Philip Cramer | Maubelstr. 90 | Brandenburg | 14776 | Germany |
44 | Lehmanns Marktstand | Renate Messner | Magazinweg 7 | Frankfurt a.M. | 60528 | Germany |
52 | Morgenstern Gesundkost | Alexander Feuer | Heerstr. 22 | Leipzig | 04179 | Germany |
56 | Ottilies Käseladen | Henriette Pfalzheim | Mehrheimerstr. 369 | Köln | 50739 | Germany |
63 | QUICK-Stop | Horst Kloss | Taucherstraße 10 | Cunewalde | 01307 | Germany |
79 | Toms Spezialitäten | Karin Josephs | Luisenstr. 48 | Münster | 44087 | Germany |
86 | Die Wandernde Kuh | Rita Müller | Adenauerallee 900 | Stuttgart | 70563 | Germany |
37 | Hungry Owl All-Night Grocers | Patricia McKenna | 8 Johnstown Road | Cork | Ireland | |
27 | Franchi S.p.A. | Paolo Accorti | Via Monte Bianco 34 | Torino | 10100 | Italy |
49 | Magazzini Alimentari Riuniti | Giovanni Rovelli | Via Ludovico il Moro 22 | Bergamo | 24100 | Italy |
66 | Reggiani Caseifici | Maurizio Moroni | Strada Provinciale 124 | Reggio Emilia | 42100 | Italy |
2 | Ana Trujillo Emparedados y helados | Ana Trujillo | Avda. de la Constitución 2222 | México D.F. | 05021 | Mexico |
3 | Antonio Moreno Taquería | Antonio Moreno | Mataderos 2312 | México D.F. | 05023 | Mexico |
13 | Centro comercial Moctezuma | Francisco Chang | Sierras de Granada 9993 | México D.F. | 05022 | Mexico |
58 | Pericles Comidas clásicas | Guillermo Fernández | Calle Dr. Jorge Cash 321 | México D.F. | 05033 | Mexico |
80 | Tortuga Restaurante | Miguel Angel Paolino | Avda. Azteca 123 | México D.F. | 05033 | Mexico |
70 | Santé Gourmet | Jonas Bergulfsen | Erling Skakkes gate 78 | Stavern | 4110 | Norway |
91 | Wolski | Zbyszek | ul. Filtrowa 68 | Walla | 01-012 | Poland |
28 | Furia Bacalhau e Frutos do Mar | Lino Rodriguez | Jardim das rosas n. 32 | Lisboa | 1675 | Portugal |
60 | Princesa Isabel Vinhoss | Isabel de Castro | Estrada da saúde n. 58 | Lisboa | 1756 | Portugal |
8 | Bólido Comidas preparadas | Martín Sommer | C/ Araquil, 67 | Madrid | 28023 | Spain |
22 | FISSA Fabrica Inter. Salchichas S.A. | Diego Roel | C/ Moralzarzal, 86 | Madrid | 28034 | Spain |
29 | Galería del gastrónomo | Eduardo Saavedra | Rambla de Cataluña, 23 | Barcelona | 08022 | Spain |
30 | Godos Cocina Típica | José Pedro Freyre | C/ Romero, 33 | Sevilla | 41101 | Spain |
69 | Romero y tomillo | Alejandra Camino | Gran Vía, 1 | Madrid | 28001 | Spain |
5 | Berglunds snabbköp | Christina Berglund | Berguvsvägen 8 | Luleå | S-958 22 | Sweden |
24 | Folk och fä HB | Maria Larsson | Åkergatan 24 | Bräcke | S-844 67 | Sweden |
14 | Chop-suey Chinese | Yang Wang | Hauptstr. 29 | Bern | 3012 | Switzerland |
68 | Richter Supermarkt | Michael Holz | Grenzacherweg 237 | Genève | 1203 | Switzerland |
4 | Around the Horn | Thomas Hardy | 120 Hanover Sq. | London | WA1 1DP | UK |
11 | B’s Beverages | Victoria Ashworth | Fauntleroy Circus | London | EC2 5NT | UK |
16 | Consolidated Holdings | Elizabeth Brown | Berkeley Gardens 12 Brewery | London | WX1 6LT | UK |
19 | Eastern Connection | Ann Devon | 35 King George | London | WX3 6FW | UK |
38 | Island Trading | Helen Bennett | Garden House Crowther Way | Cowes | PO31 7PJ | UK |
53 | North/South | Simon Crowther | South House 300 Queensbridge | London | SW7 1RZ | UK |
72 | Seven Seas Imports | Hari Kumar | 90 Wadhurst Rd. | London | OX15 4NB | UK |
32 | Great Lakes Food Market | Howard Snyder | 2732 Baker Blvd. | Eugene | 97403 | USA |
36 | Hungry Coyote Import Store | Yoshi Latimer | City Center Plaza 516 Main St. | Elgin | 97827 | USA |
43 | Lazy K Kountry Store | John Steel | 12 Orchestra Terrace | Walla Walla | 99362 | USA |
45 | Let’s Stop N Shop | Jaime Yorres | 87 Polk St. Suite 5 | San Francisco | 94117 | USA |
48 | Lonesome Pine Restaurant | Fran Wilson | 89 Chiaroscuro Rd. | Portland | 97219 | USA |
55 | Old World Delicatessen | Rene Phillips | 2743 Bering St. | Anchorage | 99508 | USA |
65 | Rattlesnake Canyon Grocery | Paula Wilson | 2817 Milton Dr. | Albuquerque | 87110 | USA |
71 | Save-a-lot Markets | Jose Pavarotti | 187 Suffolk Ln. | Boise | 83720 | USA |
75 | Split Rail Beer & Ale | Art Braunschweiger | P.O. Box 555 | Lander | 82520 | USA |
77 | The Big Cheese | Liz Nixon | 89 Jefferson Way Suite 2 | Portland | 97201 | USA |
78 | The Cracker Box | Liu Wong | 55 Grizzly Peak Rd. | Butte | 59801 | USA |
82 | Trail’s Head Gourmet Provisioners | Helvetius Nagy | 722 DaVinci Blvd. | Kirkland | 98034 | USA |
89 | White Clover Markets | Karl Jablonski | 305 – 14th Ave. S. Suite 3B | Seattle | 98128 | USA |
33 | GROSELLA-Restaurante | Manuel Pereira | 5ª Ave. Los Palos Grandes | Caracas | 1081 | Venezuela |
35 | HILARIÓN-Abastos | Carlos Hernández | Carrera 22 con Ave. Carlos Soublette #8-35 | San Cristóbal | 5022 | Venezuela |
46 | LILA-Supermercado | Carlos González | Carrera 52 con Ave. Bolívar #65-98 Llano Largo | Barquisimeto | 3508 | Venezuela |
47 | LINO-Delicateses | Felipe Izquierdo | Ave. 5 de Mayo Porlamar | I. de Margarita | 4980 | Venezuela |
Contoh Penggunaan ORDER BY DESC #
Contoh di bawah ini menampilkan data dengan mengurutkan kolom Country dari nilai paling besar sampai nilai paling kecil.
SELECT * FROM Customers
ORDER BY Country DESC;
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
33 | GROSELLA-Restaurante | Manuel Pereira | 5ª Ave. Los Palos Grandes | Caracas | 1081 | Venezuela |
35 | HILARIÓN-Abastos | Carlos Hernández | Carrera 22 con Ave. Carlos Soublette #8-35 | San Cristóbal | 5022 | Venezuela |
46 | LILA-Supermercado | Carlos González | Carrera 52 con Ave. Bolívar #65-98 Llano Largo | Barquisimeto | 3508 | Venezuela |
47 | LINO-Delicateses | Felipe Izquierdo | Ave. 5 de Mayo Porlamar | I. de Margarita | 4980 | Venezuela |
32 | Great Lakes Food Market | Howard Snyder | 2732 Baker Blvd. | Eugene | 97403 | USA |
36 | Hungry Coyote Import Store | Yoshi Latimer | City Center Plaza 516 Main St. | Elgin | 97827 | USA |
43 | Lazy K Kountry Store | John Steel | 12 Orchestra Terrace | Walla Walla | 99362 | USA |
45 | Let’s Stop N Shop | Jaime Yorres | 87 Polk St. Suite 5 | San Francisco | 94117 | USA |
48 | Lonesome Pine Restaurant | Fran Wilson | 89 Chiaroscuro Rd. | Portland | 97219 | USA |
55 | Old World Delicatessen | Rene Phillips | 2743 Bering St. | Anchorage | 99508 | USA |
65 | Rattlesnake Canyon Grocery | Paula Wilson | 2817 Milton Dr. | Albuquerque | 87110 | USA |
71 | Save-a-lot Markets | Jose Pavarotti | 187 Suffolk Ln. | Boise | 83720 | USA |
75 | Split Rail Beer & Ale | Art Braunschweiger | P.O. Box 555 | Lander | 82520 | USA |
77 | The Big Cheese | Liz Nixon | 89 Jefferson Way Suite 2 | Portland | 97201 | USA |
78 | The Cracker Box | Liu Wong | 55 Grizzly Peak Rd. | Butte | 59801 | USA |
82 | Trail’s Head Gourmet Provisioners | Helvetius Nagy | 722 DaVinci Blvd. | Kirkland | 98034 | USA |
89 | White Clover Markets | Karl Jablonski | 305 – 14th Ave. S. Suite 3B | Seattle | 98128 | USA |
4 | Around the Horn | Thomas Hardy | 120 Hanover Sq. | London | WA1 1DP | UK |
11 | B’s Beverages | Victoria Ashworth | Fauntleroy Circus | London | EC2 5NT | UK |
16 | Consolidated Holdings | Elizabeth Brown | Berkeley Gardens 12 Brewery | London | WX1 6LT | UK |
19 | Eastern Connection | Ann Devon | 35 King George | London | WX3 6FW | UK |
38 | Island Trading | Helen Bennett | Garden House Crowther Way | Cowes | PO31 7PJ | UK |
53 | North/South | Simon Crowther | South House 300 Queensbridge | London | SW7 1RZ | UK |
72 | Seven Seas Imports | Hari Kumar | 90 Wadhurst Rd. | London | OX15 4NB | UK |
14 | Chop-suey Chinese | Yang Wang | Hauptstr. 29 | Bern | 3012 | Switzerland |
68 | Richter Supermarkt | Michael Holz | Grenzacherweg 237 | Genève | 1203 | Switzerland |
5 | Berglunds snabbköp | Christina Berglund | Berguvsvägen 8 | Luleå | S-958 22 | Sweden |
24 | Folk och fä HB | Maria Larsson | Åkergatan 24 | Bräcke | S-844 67 | Sweden |
8 | Bólido Comidas preparadas | Martín Sommer | C/ Araquil, 67 | Madrid | 28023 | Spain |
22 | FISSA Fabrica Inter. Salchichas S.A. | Diego Roel | C/ Moralzarzal, 86 | Madrid | 28034 | Spain |
29 | Galería del gastrónomo | Eduardo Saavedra | Rambla de Cataluña, 23 | Barcelona | 08022 | Spain |
30 | Godos Cocina Típica | José Pedro Freyre | C/ Romero, 33 | Sevilla | 41101 | Spain |
69 | Romero y tomillo | Alejandra Camino | Gran Vía, 1 | Madrid | 28001 | Spain |
28 | Furia Bacalhau e Frutos do Mar | Lino Rodriguez | Jardim das rosas n. 32 | Lisboa | 1675 | Portugal |
60 | Princesa Isabel Vinhoss | Isabel de Castro | Estrada da saúde n. 58 | Lisboa | 1756 | Portugal |
91 | Wolski | Zbyszek | ul. Filtrowa 68 | Walla | 01-012 | Poland |
70 | Santé Gourmet | Jonas Bergulfsen | Erling Skakkes gate 78 | Stavern | 4110 | Norway |
2 | Ana Trujillo Emparedados y helados | Ana Trujillo | Avda. de la Constitución 2222 | México D.F. | 05021 | Mexico |
3 | Antonio Moreno Taquería | Antonio Moreno | Mataderos 2312 | México D.F. | 05023 | Mexico |
13 | Centro comercial Moctezuma | Francisco Chang | Sierras de Granada 9993 | México D.F. | 05022 | Mexico |
58 | Pericles Comidas clásicas | Guillermo Fernández | Calle Dr. Jorge Cash 321 | México D.F. | 05033 | Mexico |
80 | Tortuga Restaurante | Miguel Angel Paolino | Avda. Azteca 123 | México D.F. | 05033 | Mexico |
27 | Franchi S.p.A. | Paolo Accorti | Via Monte Bianco 34 | Torino | 10100 | Italy |
49 | Magazzini Alimentari Riuniti | Giovanni Rovelli | Via Ludovico il Moro 22 | Bergamo | 24100 | Italy |
66 | Reggiani Caseifici | Maurizio Moroni | Strada Provinciale 124 | Reggio Emilia | 42100 | Italy |
37 | Hungry Owl All-Night Grocers | Patricia McKenna | 8 Johnstown Road | Cork | Ireland | |
1 | Alfreds Futterkiste | Maria Anders | Obere Str. 57 | Berlin | 12209 | Germany |
6 | Blauer See Delikatessen | Hanna Moos | Forsterstr. 57 | Mannheim | 68306 | Germany |
17 | Drachenblut Delikatessend | Sven Ottlieb | Walserweg 21 | Aachen | 52066 | Germany |
25 | Frankenversand | Peter Franken | Berliner Platz 43 | München | 80805 | Germany |
39 | Königlich Essen | Philip Cramer | Maubelstr. 90 | Brandenburg | 14776 | Germany |
44 | Lehmanns Marktstand | Renate Messner | Magazinweg 7 | Frankfurt a.M. | 60528 | Germany |
52 | Morgenstern Gesundkost | Alexander Feuer | Heerstr. 22 | Leipzig | 04179 | Germany |
56 | Ottilies Käseladen | Henriette Pfalzheim | Mehrheimerstr. 369 | Köln | 50739 | Germany |
63 | QUICK-Stop | Horst Kloss | Taucherstraße 10 | Cunewalde | 01307 | Germany |
79 | Toms Spezialitäten | Karin Josephs | Luisenstr. 48 | Münster | 44087 | Germany |
86 | Die Wandernde Kuh | Rita Müller | Adenauerallee 900 | Stuttgart | 70563 | Germany |
7 | Blondel père et fils | Frédérique Citeaux | 24, place Kléber | Strasbourg | 67000 | France |
9 | Bon app’ | Laurence Lebihans | 12, rue des Bouchers | Marseille | 13008 | France |
18 | Du monde entier | Janine Labrune | 67, rue des Cinquante Otages | Nantes | 44000 | France |
23 | Folies gourmandes | Martine Rancé | 184, chaussée de Tournai | Lille | 59000 | France |
26 | France restauration | Carine Schmitt | 54, rue Royale | Nantes | 44000 | France |
40 | La corne d’abondance | Daniel Tonini | 67, avenue de l’Europe | Versailles | 78000 | France |
41 | La maison d’Asie | Annette Roulet | 1 rue Alsace-Lorraine | Toulouse | 31000 | France |
57 | Paris spécialités | Marie Bertrand | 265, boulevard Charonne | Paris | 75012 | France |
74 | Spécialités du monde | Dominique Perrier | 25, rue Lauriston | Paris | 75016 | France |
84 | Victuailles en stock | Mary Saveley | 2, rue du Commerce | Lyon | 69004 | France |
85 | Vins et alcools Chevalier | Paul Henriot | 59 rue de l’Abbaye | Reims | 51100 | France |
87 | Wartian Herkku | Pirkko Koskitalo | Torikatu 38 | Oulu | 90110 | Finland |
90 | Wilman Kala | Matti Karttunen | Keskuskatu 45 | Helsinki | 21240 | Finland |
73 | Simons bistro | Jytte Petersen | Vinbæltet 34 | København | 1734 | Denmark |
83 | Vaffeljernet | Palle Ibsen | Smagsløget 45 | Århus | 8200 | Denmark |
10 | Bottom-Dollar Marketse | Elizabeth Lincoln | 23 Tsawassen Blvd. | Tsawassen | T2F 8M4 | Canada |
42 | Laughing Bacchus Wine Cellars | Yoshi Tannamuri | 1900 Oak St. | Vancouver | V3F 2K1 | Canada |
51 | Mère Paillarde | Jean Fresnière | 43 rue St. Laurent | Montréal | H1J 1C3 | Canada |
15 | Comércio Mineiro | Pedro Afonso | Av. dos Lusíadas, 23 | São Paulo | 05432-043 | Brazil |
21 | Familia Arquibaldo | Aria Cruz | Rua Orós, 92 | São Paulo | 05442-030 | Brazil |
31 | Gourmet Lanchonetes | André Fonseca | Av. Brasil, 442 | Campinas | 04876-786 | Brazil |
34 | Hanari Carnes | Mario Pontes | Rua do Paço, 67 | Rio de Janeiro | 05454-876 | Brazil |
61 | Que Delícia | Bernardo Batista | Rua da Panificadora, 12 | Rio de Janeiro | 02389-673 | Brazil |
62 | Queen Cozinha | Lúcia Carvalho | Alameda dos Canàrios, 891 | São Paulo | 05487-020 | Brazil |
67 | Ricardo Adocicados | Janete Limeira | Av. Copacabana, 267 | Rio de Janeiro | 02389-890 | Brazil |
81 | Tradição Hipermercados | Anabela Domingues | Av. Inês de Castro, 414 | São Paulo | 05634-030 | Brazil |
88 | Wellington Importadora | Paula Parente | Rua do Mercado, 12 | Resende | 08737-363 | Brazil |
50 | Maison Dewey | Catherine Dewey | Rue Joseph-Bens 532 | Bruxelles | B-1180 | Belgium |
76 | Suprêmes délices | Pascale Cartrain | Boulevard Tirou, 255 | Charleroi | B-6000 | Belgium |
20 | Ernst Handel | Roland Mendel | Kirchgasse 6 | Graz | 8010 | Austria |
59 | Piccolo und mehr | Georg Pipps | Geislweg 14 | Salzburg | 5020 | Austria |
12 | Cactus Comidas para llevar | Patricio Simpson | Cerrito 333 | Buenos Aires | 1010 | Argentina |
54 | Océano Atlántico Ltda. | Yvonne Moncada | Ing. Gustavo Moncada 8585 Piso 20-A | Buenos Aires | 1010 | Argentina |
64 | Rancho grande | Sergio Gutiérrez | Av. del Libertador 900 | Buenos Aires | 1010 | Argentina |
Contoh Mengurutkan Beberapa Kolom #
Contoh di bawah ini menampilkan data dengan mengurutkan kolom Country dan CustomerName.
SELECT * FROM Customers
ORDER BY Country, CustomerName;
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
12 | Cactus Comidas para llevar | Patricio Simpson | Cerrito 333 | Buenos Aires | 1010 | Argentina |
54 | Océano Atlántico Ltda. | Yvonne Moncada | Ing. Gustavo Moncada 8585 Piso 20-A | Buenos Aires | 1010 | Argentina |
64 | Rancho grande | Sergio Gutiérrez | Av. del Libertador 900 | Buenos Aires | 1010 | Argentina |
20 | Ernst Handel | Roland Mendel | Kirchgasse 6 | Graz | 8010 | Austria |
59 | Piccolo und mehr | Georg Pipps | Geislweg 14 | Salzburg | 5020 | Austria |
50 | Maison Dewey | Catherine Dewey | Rue Joseph-Bens 532 | Bruxelles | B-1180 | Belgium |
76 | Suprêmes délices | Pascale Cartrain | Boulevard Tirou, 255 | Charleroi | B-6000 | Belgium |
15 | Comércio Mineiro | Pedro Afonso | Av. dos Lusíadas, 23 | São Paulo | 05432-043 | Brazil |
21 | Familia Arquibaldo | Aria Cruz | Rua Orós, 92 | São Paulo | 05442-030 | Brazil |
31 | Gourmet Lanchonetes | André Fonseca | Av. Brasil, 442 | Campinas | 04876-786 | Brazil |
34 | Hanari Carnes | Mario Pontes | Rua do Paço, 67 | Rio de Janeiro | 05454-876 | Brazil |
61 | Que Delícia | Bernardo Batista | Rua da Panificadora, 12 | Rio de Janeiro | 02389-673 | Brazil |
62 | Queen Cozinha | Lúcia Carvalho | Alameda dos Canàrios, 891 | São Paulo | 05487-020 | Brazil |
67 | Ricardo Adocicados | Janete Limeira | Av. Copacabana, 267 | Rio de Janeiro | 02389-890 | Brazil |
81 | Tradição Hipermercados | Anabela Domingues | Av. Inês de Castro, 414 | São Paulo | 05634-030 | Brazil |
88 | Wellington Importadora | Paula Parente | Rua do Mercado, 12 | Resende | 08737-363 | Brazil |
10 | Bottom-Dollar Marketse | Elizabeth Lincoln | 23 Tsawassen Blvd. | Tsawassen | T2F 8M4 | Canada |
42 | Laughing Bacchus Wine Cellars | Yoshi Tannamuri | 1900 Oak St. | Vancouver | V3F 2K1 | Canada |
51 | Mère Paillarde | Jean Fresnière | 43 rue St. Laurent | Montréal | H1J 1C3 | Canada |
73 | Simons bistro | Jytte Petersen | Vinbæltet 34 | København | 1734 | Denmark |
83 | Vaffeljernet | Palle Ibsen | Smagsløget 45 | Århus | 8200 | Denmark |
87 | Wartian Herkku | Pirkko Koskitalo | Torikatu 38 | Oulu | 90110 | Finland |
90 | Wilman Kala | Matti Karttunen | Keskuskatu 45 | Helsinki | 21240 | Finland |
7 | Blondel père et fils | Frédérique Citeaux | 24, place Kléber | Strasbourg | 67000 | France |
9 | Bon app’ | Laurence Lebihans | 12, rue des Bouchers | Marseille | 13008 | France |
18 | Du monde entier | Janine Labrune | 67, rue des Cinquante Otages | Nantes | 44000 | France |
23 | Folies gourmandes | Martine Rancé | 184, chaussée de Tournai | Lille | 59000 | France |
26 | France restauration | Carine Schmitt | 54, rue Royale | Nantes | 44000 | France |
40 | La corne d’abondance | Daniel Tonini | 67, avenue de l’Europe | Versailles | 78000 | France |
41 | La maison d’Asie | Annette Roulet | 1 rue Alsace-Lorraine | Toulouse | 31000 | France |
57 | Paris spécialités | Marie Bertrand | 265, boulevard Charonne | Paris | 75012 | France |
74 | Spécialités du monde | Dominique Perrier | 25, rue Lauriston | Paris | 75016 | France |
84 | Victuailles en stock | Mary Saveley | 2, rue du Commerce | Lyon | 69004 | France |
85 | Vins et alcools Chevalier | Paul Henriot | 59 rue de l’Abbaye | Reims | 51100 | France |
1 | Alfreds Futterkiste | Maria Anders | Obere Str. 57 | Berlin | 12209 | Germany |
6 | Blauer See Delikatessen | Hanna Moos | Forsterstr. 57 | Mannheim | 68306 | Germany |
86 | Die Wandernde Kuh | Rita Müller | Adenauerallee 900 | Stuttgart | 70563 | Germany |
17 | Drachenblut Delikatessend | Sven Ottlieb | Walserweg 21 | Aachen | 52066 | Germany |
25 | Frankenversand | Peter Franken | Berliner Platz 43 | München | 80805 | Germany |
39 | Königlich Essen | Philip Cramer | Maubelstr. 90 | Brandenburg | 14776 | Germany |
44 | Lehmanns Marktstand | Renate Messner | Magazinweg 7 | Frankfurt a.M. | 60528 | Germany |
52 | Morgenstern Gesundkost | Alexander Feuer | Heerstr. 22 | Leipzig | 04179 | Germany |
56 | Ottilies Käseladen | Henriette Pfalzheim | Mehrheimerstr. 369 | Köln | 50739 | Germany |
63 | QUICK-Stop | Horst Kloss | Taucherstraße 10 | Cunewalde | 01307 | Germany |
79 | Toms Spezialitäten | Karin Josephs | Luisenstr. 48 | Münster | 44087 | Germany |
37 | Hungry Owl All-Night Grocers | Patricia McKenna | 8 Johnstown Road | Cork | Ireland | |
27 | Franchi S.p.A. | Paolo Accorti | Via Monte Bianco 34 | Torino | 10100 | Italy |
49 | Magazzini Alimentari Riuniti | Giovanni Rovelli | Via Ludovico il Moro 22 | Bergamo | 24100 | Italy |
66 | Reggiani Caseifici | Maurizio Moroni | Strada Provinciale 124 | Reggio Emilia | 42100 | Italy |
2 | Ana Trujillo Emparedados y helados | Ana Trujillo | Avda. de la Constitución 2222 | México D.F. | 05021 | Mexico |
3 | Antonio Moreno Taquería | Antonio Moreno | Mataderos 2312 | México D.F. | 05023 | Mexico |
13 | Centro comercial Moctezuma | Francisco Chang | Sierras de Granada 9993 | México D.F. | 05022 | Mexico |
58 | Pericles Comidas clásicas | Guillermo Fernández | Calle Dr. Jorge Cash 321 | México D.F. | 05033 | Mexico |
80 | Tortuga Restaurante | Miguel Angel Paolino | Avda. Azteca 123 | México D.F. | 05033 | Mexico |
70 | Santé Gourmet | Jonas Bergulfsen | Erling Skakkes gate 78 | Stavern | 4110 | Norway |
91 | Wolski | Zbyszek | ul. Filtrowa 68 | Walla | 01-012 | Poland |
28 | Furia Bacalhau e Frutos do Mar | Lino Rodriguez | Jardim das rosas n. 32 | Lisboa | 1675 | Portugal |
60 | Princesa Isabel Vinhoss | Isabel de Castro | Estrada da saúde n. 58 | Lisboa | 1756 | Portugal |
8 | Bólido Comidas preparadas | Martín Sommer | C/ Araquil, 67 | Madrid | 28023 | Spain |
22 | FISSA Fabrica Inter. Salchichas S.A. | Diego Roel | C/ Moralzarzal, 86 | Madrid | 28034 | Spain |
29 | Galería del gastrónomo | Eduardo Saavedra | Rambla de Cataluña, 23 | Barcelona | 08022 | Spain |
30 | Godos Cocina Típica | José Pedro Freyre | C/ Romero, 33 | Sevilla | 41101 | Spain |
69 | Romero y tomillo | Alejandra Camino | Gran Vía, 1 | Madrid | 28001 | Spain |
5 | Berglunds snabbköp | Christina Berglund | Berguvsvägen 8 | Luleå | S-958 22 | Sweden |
24 | Folk och fä HB | Maria Larsson | Åkergatan 24 | Bräcke | S-844 67 | Sweden |
14 | Chop-suey Chinese | Yang Wang | Hauptstr. 29 | Bern | 3012 | Switzerland |
68 | Richter Supermarkt | Michael Holz | Grenzacherweg 237 | Genève | 1203 | Switzerland |
4 | Around the Horn | Thomas Hardy | 120 Hanover Sq. | London | WA1 1DP | UK |
11 | B’s Beverages | Victoria Ashworth | Fauntleroy Circus | London | EC2 5NT | UK |
16 | Consolidated Holdings | Elizabeth Brown | Berkeley Gardens 12 Brewery | London | WX1 6LT | UK |
19 | Eastern Connection | Ann Devon | 35 King George | London | WX3 6FW | UK |
38 | Island Trading | Helen Bennett | Garden House Crowther Way | Cowes | PO31 7PJ | UK |
53 | North/South | Simon Crowther | South House 300 Queensbridge | London | SW7 1RZ | UK |
72 | Seven Seas Imports | Hari Kumar | 90 Wadhurst Rd. | London | OX15 4NB | UK |
32 | Great Lakes Food Market | Howard Snyder | 2732 Baker Blvd. | Eugene | 97403 | USA |
36 | Hungry Coyote Import Store | Yoshi Latimer | City Center Plaza 516 Main St. | Elgin | 97827 | USA |
43 | Lazy K Kountry Store | John Steel | 12 Orchestra Terrace | Walla Walla | 99362 | USA |
45 | Let’s Stop N Shop | Jaime Yorres | 87 Polk St. Suite 5 | San Francisco | 94117 | USA |
48 | Lonesome Pine Restaurant | Fran Wilson | 89 Chiaroscuro Rd. | Portland | 97219 | USA |
55 | Old World Delicatessen | Rene Phillips | 2743 Bering St. | Anchorage | 99508 | USA |
65 | Rattlesnake Canyon Grocery | Paula Wilson | 2817 Milton Dr. | Albuquerque | 87110 | USA |
71 | Save-a-lot Markets | Jose Pavarotti | 187 Suffolk Ln. | Boise | 83720 | USA |
75 | Split Rail Beer & Ale | Art Braunschweiger | P.O. Box 555 | Lander | 82520 | USA |
77 | The Big Cheese | Liz Nixon | 89 Jefferson Way Suite 2 | Portland | 97201 | USA |
78 | The Cracker Box | Liu Wong | 55 Grizzly Peak Rd. | Butte | 59801 | USA |
82 | Trail’s Head Gourmet Provisioners | Helvetius Nagy | 722 DaVinci Blvd. | Kirkland | 98034 | USA |
89 | White Clover Markets | Karl Jablonski | 305 – 14th Ave. S. Suite 3B | Seattle | 98128 | USA |
33 | GROSELLA-Restaurante | Manuel Pereira | 5ª Ave. Los Palos Grandes | Caracas | 1081 | Venezuela |
35 | HILARIÓN-Abastos | Carlos Hernández | Carrera 22 con Ave. Carlos Soublette #8-35 | San Cristóbal | 5022 | Venezuela |
46 | LILA-Supermercado | Carlos González | Carrera 52 con Ave. Bolívar #65-98 Llano Largo | Barquisimeto | 3508 | Venezuela |
47 | LINO-Delicateses | Felipe Izquierdo | Ave. 5 de Mayo Porlamar | I. de Margarita | 4980 | Venezuela |
Contoh di bawah ini menampilkan data dengan mengurutkan kolom Country dan mengurutkan kolom CustomerName dari nilai paling besar sampai nilai paling kecil.
SELECT * FROM Customers
ORDER BY Country ASC, CustomerName DESC;
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
64 | Rancho grande | Sergio Gutiérrez | Av. del Libertador 900 | Buenos Aires | 1010 | Argentina |
54 | Océano Atlántico Ltda. | Yvonne Moncada | Ing. Gustavo Moncada 8585 Piso 20-A | Buenos Aires | 1010 | Argentina |
12 | Cactus Comidas para llevar | Patricio Simpson | Cerrito 333 | Buenos Aires | 1010 | Argentina |
59 | Piccolo und mehr | Georg Pipps | Geislweg 14 | Salzburg | 5020 | Austria |
20 | Ernst Handel | Roland Mendel | Kirchgasse 6 | Graz | 8010 | Austria |
76 | Suprêmes délices | Pascale Cartrain | Boulevard Tirou, 255 | Charleroi | B-6000 | Belgium |
50 | Maison Dewey | Catherine Dewey | Rue Joseph-Bens 532 | Bruxelles | B-1180 | Belgium |
88 | Wellington Importadora | Paula Parente | Rua do Mercado, 12 | Resende | 08737-363 | Brazil |
81 | Tradição Hipermercados | Anabela Domingues | Av. Inês de Castro, 414 | São Paulo | 05634-030 | Brazil |
67 | Ricardo Adocicados | Janete Limeira | Av. Copacabana, 267 | Rio de Janeiro | 02389-890 | Brazil |
62 | Queen Cozinha | Lúcia Carvalho | Alameda dos Canàrios, 891 | São Paulo | 05487-020 | Brazil |
61 | Que Delícia | Bernardo Batista | Rua da Panificadora, 12 | Rio de Janeiro | 02389-673 | Brazil |
34 | Hanari Carnes | Mario Pontes | Rua do Paço, 67 | Rio de Janeiro | 05454-876 | Brazil |
31 | Gourmet Lanchonetes | André Fonseca | Av. Brasil, 442 | Campinas | 04876-786 | Brazil |
21 | Familia Arquibaldo | Aria Cruz | Rua Orós, 92 | São Paulo | 05442-030 | Brazil |
15 | Comércio Mineiro | Pedro Afonso | Av. dos Lusíadas, 23 | São Paulo | 05432-043 | Brazil |
51 | Mère Paillarde | Jean Fresnière | 43 rue St. Laurent | Montréal | H1J 1C3 | Canada |
42 | Laughing Bacchus Wine Cellars | Yoshi Tannamuri | 1900 Oak St. | Vancouver | V3F 2K1 | Canada |
10 | Bottom-Dollar Marketse | Elizabeth Lincoln | 23 Tsawassen Blvd. | Tsawassen | T2F 8M4 | Canada |
83 | Vaffeljernet | Palle Ibsen | Smagsløget 45 | Århus | 8200 | Denmark |
73 | Simons bistro | Jytte Petersen | Vinbæltet 34 | København | 1734 | Denmark |
90 | Wilman Kala | Matti Karttunen | Keskuskatu 45 | Helsinki | 21240 | Finland |
87 | Wartian Herkku | Pirkko Koskitalo | Torikatu 38 | Oulu | 90110 | Finland |
85 | Vins et alcools Chevalier | Paul Henriot | 59 rue de l’Abbaye | Reims | 51100 | France |
84 | Victuailles en stock | Mary Saveley | 2, rue du Commerce | Lyon | 69004 | France |
74 | Spécialités du monde | Dominique Perrier | 25, rue Lauriston | Paris | 75016 | France |
57 | Paris spécialités | Marie Bertrand | 265, boulevard Charonne | Paris | 75012 | France |
41 | La maison d’Asie | Annette Roulet | 1 rue Alsace-Lorraine | Toulouse | 31000 | France |
40 | La corne d’abondance | Daniel Tonini | 67, avenue de l’Europe | Versailles | 78000 | France |
26 | France restauration | Carine Schmitt | 54, rue Royale | Nantes | 44000 | France |
23 | Folies gourmandes | Martine Rancé | 184, chaussée de Tournai | Lille | 59000 | France |
18 | Du monde entier | Janine Labrune | 67, rue des Cinquante Otages | Nantes | 44000 | France |
9 | Bon app’ | Laurence Lebihans | 12, rue des Bouchers | Marseille | 13008 | France |
7 | Blondel père et fils | Frédérique Citeaux | 24, place Kléber | Strasbourg | 67000 | France |
79 | Toms Spezialitäten | Karin Josephs | Luisenstr. 48 | Münster | 44087 | Germany |
63 | QUICK-Stop | Horst Kloss | Taucherstraße 10 | Cunewalde | 01307 | Germany |
56 | Ottilies Käseladen | Henriette Pfalzheim | Mehrheimerstr. 369 | Köln | 50739 | Germany |
52 | Morgenstern Gesundkost | Alexander Feuer | Heerstr. 22 | Leipzig | 04179 | Germany |
44 | Lehmanns Marktstand | Renate Messner | Magazinweg 7 | Frankfurt a.M. | 60528 | Germany |
39 | Königlich Essen | Philip Cramer | Maubelstr. 90 | Brandenburg | 14776 | Germany |
25 | Frankenversand | Peter Franken | Berliner Platz 43 | München | 80805 | Germany |
17 | Drachenblut Delikatessend | Sven Ottlieb | Walserweg 21 | Aachen | 52066 | Germany |
86 | Die Wandernde Kuh | Rita Müller | Adenauerallee 900 | Stuttgart | 70563 | Germany |
6 | Blauer See Delikatessen | Hanna Moos | Forsterstr. 57 | Mannheim | 68306 | Germany |
1 | Alfreds Futterkiste | Maria Anders | Obere Str. 57 | Berlin | 12209 | Germany |
37 | Hungry Owl All-Night Grocers | Patricia McKenna | 8 Johnstown Road | Cork | Ireland | |
66 | Reggiani Caseifici | Maurizio Moroni | Strada Provinciale 124 | Reggio Emilia | 42100 | Italy |
49 | Magazzini Alimentari Riuniti | Giovanni Rovelli | Via Ludovico il Moro 22 | Bergamo | 24100 | Italy |
27 | Franchi S.p.A. | Paolo Accorti | Via Monte Bianco 34 | Torino | 10100 | Italy |
80 | Tortuga Restaurante | Miguel Angel Paolino | Avda. Azteca 123 | México D.F. | 05033 | Mexico |
58 | Pericles Comidas clásicas | Guillermo Fernández | Calle Dr. Jorge Cash 321 | México D.F. | 05033 | Mexico |
13 | Centro comercial Moctezuma | Francisco Chang | Sierras de Granada 9993 | México D.F. | 05022 | Mexico |
3 | Antonio Moreno Taquería | Antonio Moreno | Mataderos 2312 | México D.F. | 05023 | Mexico |
2 | Ana Trujillo Emparedados y helados | Ana Trujillo | Avda. de la Constitución 2222 | México D.F. | 05021 | Mexico |
70 | Santé Gourmet | Jonas Bergulfsen | Erling Skakkes gate 78 | Stavern | 4110 | Norway |
91 | Wolski | Zbyszek | ul. Filtrowa 68 | Walla | 01-012 | Poland |
60 | Princesa Isabel Vinhoss | Isabel de Castro | Estrada da saúde n. 58 | Lisboa | 1756 | Portugal |
28 | Furia Bacalhau e Frutos do Mar | Lino Rodriguez | Jardim das rosas n. 32 | Lisboa | 1675 | Portugal |
69 | Romero y tomillo | Alejandra Camino | Gran Vía, 1 | Madrid | 28001 | Spain |
30 | Godos Cocina Típica | José Pedro Freyre | C/ Romero, 33 | Sevilla | 41101 | Spain |
29 | Galería del gastrónomo | Eduardo Saavedra | Rambla de Cataluña, 23 | Barcelona | 08022 | Spain |
22 | FISSA Fabrica Inter. Salchichas S.A. | Diego Roel | C/ Moralzarzal, 86 | Madrid | 28034 | Spain |
8 | Bólido Comidas preparadas | Martín Sommer | C/ Araquil, 67 | Madrid | 28023 | Spain |
24 | Folk och fä HB | Maria Larsson | Åkergatan 24 | Bräcke | S-844 67 | Sweden |
5 | Berglunds snabbköp | Christina Berglund | Berguvsvägen 8 | Luleå | S-958 22 | Sweden |
68 | Richter Supermarkt | Michael Holz | Grenzacherweg 237 | Genève | 1203 | Switzerland |
14 | Chop-suey Chinese | Yang Wang | Hauptstr. 29 | Bern | 3012 | Switzerland |
72 | Seven Seas Imports | Hari Kumar | 90 Wadhurst Rd. | London | OX15 4NB | UK |
53 | North/South | Simon Crowther | South House 300 Queensbridge | London | SW7 1RZ | UK |
38 | Island Trading | Helen Bennett | Garden House Crowther Way | Cowes | PO31 7PJ | UK |
19 | Eastern Connection | Ann Devon | 35 King George | London | WX3 6FW | UK |
16 | Consolidated Holdings | Elizabeth Brown | Berkeley Gardens 12 Brewery | London | WX1 6LT | UK |
11 | B’s Beverages | Victoria Ashworth | Fauntleroy Circus | London | EC2 5NT | UK |
4 | Around the Horn | Thomas Hardy | 120 Hanover Sq. | London | WA1 1DP | UK |
89 | White Clover Markets | Karl Jablonski | 305 – 14th Ave. S. Suite 3B | Seattle | 98128 | USA |
82 | Trail’s Head Gourmet Provisioners | Helvetius Nagy | 722 DaVinci Blvd. | Kirkland | 98034 | USA |
78 | The Cracker Box | Liu Wong | 55 Grizzly Peak Rd. | Butte | 59801 | USA |
77 | The Big Cheese | Liz Nixon | 89 Jefferson Way Suite 2 | Portland | 97201 | USA |
75 | Split Rail Beer & Ale | Art Braunschweiger | P.O. Box 555 | Lander | 82520 | USA |
71 | Save-a-lot Markets | Jose Pavarotti | 187 Suffolk Ln. | Boise | 83720 | USA |
65 | Rattlesnake Canyon Grocery | Paula Wilson | 2817 Milton Dr. | Albuquerque | 87110 | USA |
55 | Old World Delicatessen | Rene Phillips | 2743 Bering St. | Anchorage | 99508 | USA |
48 | Lonesome Pine Restaurant | Fran Wilson | 89 Chiaroscuro Rd. | Portland | 97219 | USA |
45 | Let’s Stop N Shop | Jaime Yorres | 87 Polk St. Suite 5 | San Francisco | 94117 | USA |
43 | Lazy K Kountry Store | John Steel | 12 Orchestra Terrace | Walla Walla | 99362 | USA |
36 | Hungry Coyote Import Store | Yoshi Latimer | City Center Plaza 516 Main St. | Elgin | 97827 | USA |
32 | Great Lakes Food Market | Howard Snyder | 2732 Baker Blvd. | Eugene | 97403 | USA |
47 | LINO-Delicateses | Felipe Izquierdo | Ave. 5 de Mayo Porlamar | I. de Margarita | 4980 | Venezuela |
46 | LILA-Supermercado | Carlos González | Carrera 52 con Ave. Bolívar #65-98 Llano Largo | Barquisimeto | 3508 | Venezuela |
35 | HILARIÓN-Abastos | Carlos Hernández | Carrera 22 con Ave. Carlos Soublette #8-35 | San Cristóbal | 5022 | Venezuela |
33 | GROSELLA-Restaurante | Manuel Pereira | 5ª Ave. Los Palos Grandes | Caracas | 1081 | Venezuela |