">

Midterm2.pdf - 1 > SELECT COUNT(DISTINCT customerName AS...

Info icon This preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
1. > SELECT COUNT(DISTINCT customerName) AS FrenchCustomers From Customers WHERE country = "France" + -------------------- + | FrenchCustomers | + -------------------- + | 12 | + -------------------- + 1 rows 2. > SELECT city, lastName, firstName FROM Offices JOIN Employees ON Offices.officeCode = Employees.officeCode ORDER BY city, lastName, firstName + --------- + ------------- + -------------- + | city | lastName | firstName | + --------- + ------------- + -------------- + | Boston | Firrelli | Julie | | Boston | Patterson | Steve | | London | Bott | Larry | | London | Jones | Barry | | NYC | Tseng | Foon Yue | | NYC | Vanauf | George | | Paris | Bondur | Gerard | | Paris | Bondur | Loui | | Paris | Castillo | Pamela | | Paris | Gerard | Martin | | Paris | Hernandez | Gerard | | San Francisco | Bow | Anthony | | San Francisco | Firrelli | Jeff |
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
| San Francisco | Jennings | Leslie | | San Francisco | Murphy | Diane | | San Francisco | Patterson | Mary | | San Francisco | Thompson | Leslie | | Sydney | Fixter | Andy | | Sydney | King | Tom | | Sydney | Marsh | Peter | | Sydney | Patterson | William | | Tokyo | Kato | Yoshimi | | Tokyo | Nishi | Mami | + --------- + ------------- + -------------- + 23 rows 3. > SELECT customerName, COUNT(orderNumber) AS Total FROM Customers JOIN Orders ON Customers.customerNumber = Orders.customerNumber WHERE country = "Australia" GROUP BY customerName + ----------------- + ---------- + | customerName | Total | + ----------------- + ---------- + | Anna's Decorations, Ltd | 4 | | Australian Collectables, Ltd | 3 | | Australian Collectors, Co. | 5 | | Australian Gift Network, Co | 3 | | Souveniers And Things Co. | 4 | + ----------------- + ---------- + 5 rows 4. > SELECT country, customerName FROM Customers
Image of page 2
WHERE customerName REGEXP "gift|toy|Gift|Toy" ORDER BY country, customerName + ------------ + ----------------- + | country | customerName | + ------------ + ----------------- + | Australia | Australian Gift Network, Co | | Canada
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.
  • Fall '08
  • GOODHUE
  • San Francisco, Coupes, Rear wheel drive vehicles, Motor vehicles manufactured in the United States, Ford vehicles, La Rochelle Gifts

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern