
Now you've asked where/how to apply the criteria for 'sales in the last 3 months.' Note each order has an orderDate, representing the date the order was placed.

Since you've posted an example of an inner join, I'm going to assume you could write that one yourself, too: Next, consider how to find the orders for those customers (all of them, for now). First, let's look at 'customers from USA.' You can probably write this one yourself: You'll need to figure out what's going on for yourself. If you're just learning SQL, please don't take one of these answers and use it to do your homework.

Sorry for my question but i'm new in SQL and i'll appreciate any kind of help. Should i use other kind of joins or something else? The second problem is that i don't have an idea for the part 'employees with no sale' How can i find this? Below is a selection from the 'Customers' table in the Northwind sample database: CustomerID CustomerName ContactName Address.

SQL Database SQL Create DB SQL Drop DB SQL Backup DB SQL Create Table SQL Drop Table SQL Alter Table SQL Constraints SQL Not Null SQL Unique SQL Primary Key SQL Foreign Key SQL Check SQL. One of the problem is that i don't know where to put this select query (it's for calculating the last 3 months but i'm not sure that this is true): This is the task:Ĭreate a query that displays the employees with no sale in the last 3 months to customers who are from 'USA'.
