1. Display all product information for products that contain the string hammer anywhere in their description. Remember...
Question:
1. Display all product information for products that contain the string hammer anywhere in their description. Remember to use the * for all attributes here and the LIKE keyword and the % wild card character where needed. [hint: you should have 2 rows of output].
2. Display the product code, description, and price for products provided by vendor 25595. Do NOT use the * here but list specific attributes and also use the WHERE clause. [hint: you should have 3 rows of output].
3. Display all product information for products currently selling for less than $30.00 and which have more than 50 units in stock (recorded in attribute P_QOH or quantity on hand). You will use the * for all attributes and also the AND keyword. [hint: you should have 3 rows of output].
4. Display the product code, product description, price and price after discount (a computed column that uses the P_PRICE and P_DISCOUNT [a percent discount] to be named with an alias of DiscountPrice [ ... AS DiscountPrice]) for products for which no vendor is specified in table PRODUCT. You will specify attribute names in the SELECT and use the WHERE clause for this query. [hint: you should have 2 rows of output].5. Display the product code, product description, product price and vendor name for products provided by vendors located in the state of Georgia. Since the attributes required for this query come from 2 separate tables, you will need to include those in your FROM clause and also join those 2 tables together using the PK/FK pairs WHERE T1.C1 = T2.C1 [refer to the diagram for the proper PK/FK from each table]. [hint: you should have 2 rows of output].
6. Display the full names of employees (including title and initial) who manage other employees, ordered by last name in descending order. Don't forget to include the title, initial, first name, and last name and look at the data given to determine how to designate those employees who manage others (i.e., EMP_MGR field is null). [hint: you should have 3 rows of output ordered properly].
7. Display the count only of distinct products ordered so far by customers (i. e., t h a t exist in table LINE). Make sure you position the DISTINCT keyword in the proper place. [hint: you
should have 1 value output].
8. For every manager (i. e., group on EMP_MGR), display the manager employee code (EMP_MGR) along with the total number (i. e., use COUNT() here) of employees s/he manages (requires a WHERE clause checking all EMP_MGRs that are not null). [hint: you should have 3 rows of output].
9. Display the product description, the full customer name and the customer balance for products ordered by customers having a customer balance between $300.00 and $400 (inclusive). Order by customer first name, then last name, then initial. Look at the table layouts above and determine which tables to include here. You will need to use all tables and join those appropriately in the WHERE clause using PK/FK pairs (3 joins). The BETWEEN keyword should be used in the WHERE clause for the proper balances [hint: you should have 3 rows of output ordered properly].
10. For every invoice, display the invoice number, invoice date and the total dollar amount for all products purchased in the invoice, ordered by invoice number in ascending order. Here you will use an aggregate SUM(x,y) function in your SELECT clause to calculate the total dollar amount (a calculated field - name it with the alias TOTAL). Don't forget to join on the tables as well. [hint: you should have 8 rows of output ordered properly].
Modern Systems Analysis And Design
ISBN: 9780134204925
8th Edition
Authors: Joseph Valacich, Joey George