Professional Documents
Culture Documents
23027119-025 Quiz
23027119-025 Quiz
List the name and hire date of anyone with sales over 50000?
SELECT s.SalRepName, s.HireDate
FROM SalesRep s
WHERE s.Sales > 50000;
Show me the result if I raised each person’s quota by 3 percent of their year to date sales:
SELECT s.SalRepName, (s.Quota + (s.Sales * 0.03)) AS NewQuota
FROM SalesRep s;
List salespeople whose sales are not between 80 percent and 120 percent of the quota?
SELECT s.SalRepName, s.Sales, s.Quota
FROM SalesRep s
WHERE s.Sales NOT BETWEEN (0.8 * s.Quota) AND (1.2 * s.Quota);
Ameer Hamza(025) Quiz
List all the customers whose name starts with ‘A’ or ‘a’?
SELECT c.customerName
FROM Customer c
WHERE c.customerName LIKE 'A%' OR c.customerName LIKE 'a%';
List orders over 2500, including the name of the salesperson who took the order and the
name of the customer who placed it?
SELECT o.OrderId, s.SalRepName AS Salesperson, c.customerName AS Customer
FROM Orders o
JOIN SalesRep s ON o.SalRepId = s.SalRepId
JOIN Customer c ON o.CustomerId = c.CustomerId
WHERE o.Amount > 2500;
List the names of salespeople and their managers (Note: Manager field contains only IDs
not names):