Concept explainers
create table queries using sinplified sales table
1. Which manufacturers are located in the city of New York? Show the manufacturer's name, state, postal code, and contact person.
2. Show product information for white shoes in the 'sneakers' category that cost more than $50 and have a product description that begins with the letter "b" or "t". Show only the product name, its composition, and its list price.
3. Show the product name, description, and category for all shoes with a list price of $150 or more and in one of the following categories: sneakers, boots, or sandals. Order the output alphabetically by product name.
4. How many customers do we have with a last name starting with a 'Q' living in each city? Your query should display two columns, one named cust_num and one named city. Sort the results alphabeticaly by city.
5. Show the product name, list price, customer state (call it 'CustState'), and manufacturer state (call it 'ManState') for all products made by manufacturers in Connecticut (CT) and purchased by customers in New York (NY).
6. For green sandals, how does the current list price compare to the price at which products have sold? Show the product name, the
7. What is the total number of products sold by each manufacturer? Your query should display two columns, one named productnum and one named manufacturername. Sort the results alphabetically by manufacturername.
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps
- For every order that has been received, display the order ID, the total dollar amount owed on that order (you’ll have to calculate this total from attributes in one or more tables; label this result TotalDue), and the amount received in payments on that order (assume that there is only one payment made on each order). To make this query a little simpler, you don’t have to include those orders for which no payment has yet been received. List the results in decreasing order of the difference between total due and amount paid.arrow_forwardNot all Global Fast Foods staff members have a manager. Create a query that displays the employee last name and 9999 in the manager ID column for these employees.arrow_forwardCreate a View to show all the first and last names of managers and the count of their employees. Order the result by the highest number of employees first.You must use a correlated Subquery to obtain the employee count on each row. (Hint: put the subquery in the SELECT)You may have a lot of results with 0, that’s fine.Use the View to rename: first_name to “First Name”, last_name to “Last Name” Employee count result to “Employee Count”Call this view: Management_Employee_CountsInclude a second query to display from the View after it is created. Example data: Refer to attached for the sample data refer to attached for the reference of table.arrow_forward
- The Colombia City office of StayWell indicated that there is a new tenant by the name of Yigit Yilmaz staying at the property with an ID of 13. You need to include this new resident in the RESIDENTS table.arrow_forwardUse SQL to complete the following exercises. Provide SQL screenshots of the resutls of both questions. 1. Create a table named REP. The table has the same structure as the SALES_REP table shown in Figure 3-15 except the LAST_NAME column should use the VARCHAR data type and the COMMISSION and RATE columns should use the NUMERIC data type. Execute the command to describe the layout and characteristics of the REP table. 2. Add the following row to the REP table: rep ID: 35, first name: Fred; last name: Kiser; address: 427 Billings Dr.; city: Cody; state: WY; postal: 82414; cell phone: 307-555-6309; commission: 0.00; and rate: 0.05. Display the contents of the REP table.arrow_forwardList the names of all Staff members who hold a faculty position and have a salary of $45,000 or less. Show their names as their first name, followed by a space, and then their last name but sort the list alphabetically by last name and then first name. Hint: Check out the Position column in the Staff table. All staff members who do not hold a faculty position will get a bonus this year equal to 5% of their salary. List the names, current salary, and bonus amount for each Staff member (non-faculty) who is due a bonus. Show your list in order with the person receiving the highest bonus first.arrow_forward
- Given the table PRODUCT(ProductID, ProductName, ProductClass, ProductWeight, ProductStyle, ProductColor, ProductPrice). Note: ProductWeight and ProductPrice are numeric fields, and the other attributes are character fields, i.e., store text. Write a SQL query to display the product class whose average price is at least 50arrow_forwardIn the BOOK_PRICING table, you should indicate that the Category field is not being utilized. Confirm that the column is no longer an option to choose.arrow_forwardWrite the SQL code that will produce the results shown as below. Write the SQL code to calculate the ASSIGN_CHARGE values in the ASSIGNMENT table. Note that ASSIGN_CHARGE is a derived attribute that is calculated by multiplying ASSIGN_CHG_HR by ASSIGN_HOURS. Write the SQL code that will yield the total number of hours worked for each employee and the total charges stemming from those hours worked. The result is shown as below.arrow_forward
- 5. Which orders were placed on or before April 1, 2009? List each order number and orderdate. Write this query in two different ways.arrow_forwarduse the following picture to answer question below question 10 Insert below record to the Customer table. Assuming there is a Default Constraint on the City column, insert default value of Default Constraint. Insert Null values for State and Phone columns. CustID: 180 LName: Pourhadi FName: Farhadarrow_forward7. List the shipping city and state for the order that had the longest shipping delay. SQL commandsarrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education