Skip to content

AND

SELECT * FROM Customers
WHERE Country='Germany' AND City='Berlin';
CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country
--- | --- | --- | --- | --- | --- | ---
1 | Alfreds | Maria | Obere Str. 57| Berlin | 12209 | Germany
2 | Blauer See | Henna | Forsterstr. 57| Berlin | 14163 | Germany

The code illustrates a simple usage of the AND logic operator in SQL. AND is used to filter records based on multiple conditions. In this case, it selects customers from the Customers table that are both in the Country ‘Germany’ and the City ‘Berlin’. The output provides a list of customer details who fulfill both conditions.