-- Find the Companies that placed orders in 1997

/******************************
Both of the queries below will work in SQL Server

Oracle
******************************/
SELECT CompanyName
FROM Customers
WHERE CustomerID IN (SELECT CustomerID
            FROM Orders
            WHERE OrderDate BETWEEN '1-Jan-1997' AND '31-Dec-1997');

/******************************
MySQL
******************************/
SELECT CompanyName
FROM Customers
WHERE CustomerID IN (SELECT CustomerID
            FROM Orders
            WHERE OrderDate BETWEEN '1997-01-01' AND '1997-12-31');