Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Based on stage 2, write queries for the following questions:
- Write a query to display all vendors sorted by vendor name.
- Write a query to display the product id, description, type, base, category, and price for all products that have a product base of water and a product category of sealer.
- Write a query to display the first name, last name, and email address of employees who were not hired from January 1, 2015, to December 31, 2019. Sort the output by the last name and then by the first name.
- Write a query to display the first name, last name, phone number, title, and department number of employees who work in department 123 and have the title “Assistant.”
- Write a query to display the employee number, last name, first name, salary “from” date, salary end date, and salary amount for employees 99675, 53845, and 44035. Sort the output by employee number and salary “from” date.
- Write a query to display the first name, last name, street no, street name, city, state, and zip code of any customer who purchased a Forest brand between July 15, 2015, and Jul 20, 2015. If a customer purchased more than one such product, display the customer’s information only once in the output.
- Write a query to display the employee number, last name, email address, title, and department name of each employee whose job title does not end in the word ”Assistant".
- Write a query to display a brand name and the number of products of that brand that are in the
database . Sort the output by the brand name.
- Write a query to display the number of products in each category that have a water base, sorted by category.
- Write a query to display the total inventory, i.e. the sum of all products on hand for each brand id. Sort the output by brand id in ascending order.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 5 steps
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question
can you slove more 3 queries
Solution
by Bartleby Expert
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question
can you slove more 3 queries
Solution
by Bartleby Expert
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- code of create table and insert table only pleasearrow_forwardWrite a query to display the employee number, last name, first name, salary “from” date, salary end date, and salary amount for employees 99675, 53845, and 44035. Sort the output by employee number and salary “from” date.arrow_forwardYou have been told that you need to store the zip code for employees. Add a column to the EMPLOYEE table which will be used to store each employee’s zip code Update two rows in the EMPLOYEE table and assign a zip code (must have a WHERE clause). (you MAY use 1 or 2 statements) Write a query that includes each employee's last name, department name (not ID), and salary for each employee whose salary is less than the average for their departmentarrow_forward
- 4) Display the firstname, lastname of the employees and the customerID that the employee served. Arrange the results by the last name. 5) Write a query to the Name of the Product and the corresponding name of the supplier of that Product for all the products that start with a “P”. 6) Write a SQL query to output the product name and the quantity of the Orders of that product for those orders with more than 70 quantity. (hint: don’t have to use GROUP BY) I need help figuring out the SQL quereys for the questions above using table joining methodarrow_forwardWrite a query that displays the book title, cost, and year of publication for every book in the system. Sort the results by book title.arrow_forwardWrite a query that returns the Name of ALL Customers (based on CUS_FNAME and CUS_LNAME in CUSTOMER table, call this CUSTOMER_NAME), Phone number of ALL Customers (based on CUS_AREACODE and CUS_PHONE in CUSTOMER table, call this CUSTOMER_PHONE), for those haven’t flied before (based on the record in CHARTER table).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_forwardWrite a query to display the first name, last name, phone number, title, and department number of employees who work in department 300 or have the title “CLERK I.” Sort the output by last name and then by first namearrow_forwardThe Binder Prime Company wants to recognize the employee who sold the most of its products during a specified period. Write a query to display the employee num-ber, employee first name, employee last name, email address, and total units sold for the employee who sold the most Binder Prime brand products between November 1, 2015, and December 5, 2015. If there is a tie for most units sold, sort the output by employee last namearrow_forward
- SQL: 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 descending order and then by invoice date 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 TOTAL). Don’t forget to join on the tables as well. [hint: you should have 8 rows of output ordered properly]. select inv_number, inv_date sum(list_price) as 'total' from invoice, line order by desc inv_num, asc inv_date. I am getting the error: ORA-00923: FROM keyword not found where expected Am I formulating the query incorrectly?arrow_forwardEmployee table: (E_Id,E_name,dept_name,Salary) Write Update query Increase salary by 5000 if salary between 30000 to 35000 Increase salary by 7000 if salary between 35001 to 41000 Increase salary by 9000 if salary between 41001 to 46000arrow_forwardInsert into table customerPayment, columns customerOrderld and total result set returned from query a. Select columns id and total from table customerOrder where column orderStateld is equal to subquery i. (select column id from table orderState where column state is equal to "Payment received") Write Test Case 1 as a SQL join query to do the following a. Select using concatenation of columns firstName and lastName from table www customer as Customer b. Select customerOrderId from table customerPayment as "Customer Order" c. Select description from table product as Product d. Select total from table customerOrder as “Product Total" e. Join tables customerPavment, customerOrder, customer, product f. Order by column lastName from table customer Alter table purchaseOrder add column total as data type decimal size 7,2, not null, default value of 0.0arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- 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
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education