0% found this document useful (0 votes)
319 views5 pages

Find All Customers From The Country "Germany" AND The City "Berlin", in The "Customers" Table

The document provides 9 SQL queries to retrieve, update, and delete customer data from a Customers database table. The queries select customers by country and city, order results by country and customer name, update a customer's contact and city, and limit results to the first two records.

Uploaded by

Mehdi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
319 views5 pages

Find All Customers From The Country "Germany" AND The City "Berlin", in The "Customers" Table

The document provides 9 SQL queries to retrieve, update, and delete customer data from a Customers database table. The queries select customers by country and city, order results by country and customer name, update a customer's contact and city, and limit results to the first two records.

Uploaded by

Mehdi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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