Select all records where the City column has the value 'Berlin' or 'London'. @(6) * FROM Customers @(5) City = 'Berlin' @(2) @(4) = '@(6)'; SELECT * FROM Customers WHERE City = 'Berlin' OR City = 'London';
Correct!Next ❯
From the following tables write a SQL query to find the salesperson and customer who reside in the same city. Return Salesman, cust_name and city. Sample table: salesman Sample table: customer Sample Solution: Output of the Query: Explanation: Pictorial presentation: Practice OnlineQuery Visualization:Duration: Rows: Cost: Have another way to solve this solution? Contribute your code (and comments) through Disqus. Previous SQL Exercise: SQL JOINS Exercises Home
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
WHERE vs HAVING? WHERE is applied before GROUP BY, HAVING is applied after (and can filter on aggregates). In general, you can reference aliases in neither of these clauses, but MySQL allows referencing SELECT level aliases in GROUP BY, ORDER BY and HAVING. Ref : https://bit.ly/3FeA9Qn
|