SQL Assignment 2 BML.doc

SQL Assignment 2 BML.doc - Brandon Little Chapter 7 SQL...

This preview shows page 1 - 3 out of 6 pages.

Brandon Little Chapter 7 SQL Course Query Assignment Go to: and Develop and execute SQL statements at the site that do the following and submit a copy of the query used under each select activity below: 1. Select the customerid, item, and price from the items_ordered table for all of the rows that have a price value ranging from 380.00 to 1500.00. SELECT customerid, item, price FROM items_ordered WHERE price >=350 and price <=1500; 2. Select the customerid, item, and quantity in items_ordered table for any items in the item column that start with the letter "P". SELECT customerid, item, quantity FROM items_ordered WHERE item LIKE 'P%'; 3. Select the custpmerid, lastname, and state from the customers table for all of the rows where the state value is either: Idaho, Oregon, or Washington. SELECT customerid, lastname, state FROM customers WHERE state in ('Idaho', 'Oregon', 'Washington'); 4. Select the distinct items in the items_ordered table. In other words, display a listing of each of the unique items from the items_ordered table. SELECT DISTINCT item FROM items_ordered; 5.How many people are in each unique state in the customers table? Select the state and displaythe number of people in each. Hint: countis used to count rows in a column.
Image of page 1

Subscribe to view the full document.

6. Select the customerid, order_date, and item from the items_ordered table for all items unless they are 'Life Vest' or if they are 'Umbrellas'. Display the rows resulting from the select. Select customerid, order_date, item From items_ordered Where item not in ('Life Vest','Umbrella'); 7. Select the average price of all of the items ordered that were purchased by customerid 10438.
Image of page 2
Image of page 3
  • Fall '17
  • Barson
  • item

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