Question: MySQL Workbench question. How would I..... Write a SELECT statement that returns one row for each category that has products (inner join) with these columns:

MySQL Workbench question. How would I..... Write a SELECT statement that returns one row for each category that has products (inner join) with these columns: a) The Category Name column from the Categories table b) The count of the products in the Products table (join these two tables) c) The price of the most expensive product in the Products table d) Sort the result set so the category with the most products appears first.

Write a SELECT statement that answers this question: What is the total quantity purchased for each product within each category? Return these columns: a) The CategoryName column from the category table b) The ProductName column from the products table c) The total quantity purchased for each product with orders in the OrderDetails table d) Use the WITH ROLLUP operator to include rows that give a summary for each category name as well as a row that gives the grand total. Use the IF and GROUPING functions to replace null values in the category_name and product_name columns with literal values if theyre for summary rows.

Write a SELECT statement that returns the same result set as this SELECT statement, but dont use a join. Instead, use a subquery in a WHERE clause that uses the IN keyword. SELECT DISTINCT category_name FROM categories c JOIN products p ON c.category_id = p.category_id ORDER BY category_name

Write a SELECT statement that returns three columns: email_address, order_id, and the order total for each customer. To do this, you can group the result set by the email_address and order_id columns. In addition, you must calculate the order total from the columns in the Order_Items table.

In MySQL Workbench, select the Administration tab on the lower left and then select Status and System Variables item from the Navigator window. Next, select Commands/DDL (under the Status Variables tab) to view the server variables. a) Explain the following in the text submission box: What variable(s) currently have a value and why? b) Next, select Commands/General and explain the values greater than zero that you see. You may need to do a bit of additional research.

addresses- address_id, customer_id, line1, line2, city, state, zip_code, phone, disabled

administrations- admin_id, email address, password, first_name, last_name

categories- category_id, category_name

customers- customer_id, email_address, password, first_name, last_name, shipping_address_id, billing_address_id

order_items- item_id, order_id, product_id, item_price, discount_amount, quantity

orders- order_id, customer_id, order_date, ship_amount, tax_amount, ship_date, ship_address_id, card_type, card_number, card_expires, billing_address_id

products- product_id, category_id, product_code, product_name, description, list_price, discount_percent, date_added

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!