You are on page 1of 5

1.

Find all customers from the country "Germany" AND the city "Berlin", in the
"Customers" table.

Importing a database through .sql file:

SELECT * FROM `customer`.`customer` WHERE country= "Germany" AND city= "Berlin"

2. Find all customers from the city "Berlin" OR "München", in the "Customers"
table.

SELECT * FROM `customer`.`customer` WHERE city= "Berlin" OR city= "Munchen"


3. Find all customers from the "Customers" table, sorted by the "Country"
column.

SELECT Country FROM `customer`.`customer` ORDER BY Country

4. Find all customers from the "Customers" table, sorted DESCENDING by the
"Country" column.

SELECT Country FROM `customer`.`customer` ORDER BY Country DESC

5. Find all customers from the "Customers" table, sorted by the "Country" and the
"CustomerName" column.

SELECT Country, CustomerName FROM `customer`.`customer` ORDER BY Country,


CustomerName
6. Find all customers from the "Customers" table, sorted ascending by the
"Country" and descending by the "CustomerName" column.

SELECT Country, CustomerName FROM `customer`.`customer` ORDER BY Country ASC,


CustomerName DESC

7. Update the customer "Alfreds Futterkiste" with a new contact person and city.

UPDATE `customer`.`customer` SET name= "", city= "" WHERE name= "Alfreds Futterkiste"
8. Delete the customer "Alfreds Futterkiste" from the "Customers" table.

DELETE FROM `customer`.`customer` WHERE name= "Alfreds Futterkiste"

9. Find the two first records from the "Customers" table.

SELECT * FROM `customer`.`customer` LIMIT 2

You might also like