Question

Some of my codes are showing errors, please help! 1. Create a view called NumCustomerOrders which...

Some of my codes are showing errors, please help!

1. Create a view called NumCustomerOrders which lists all the customers and the
number of orders they have placed. Be sure to list the customer even if they have
not placed an order. (91 records) "

CREATE VIEW NumCustomerOrders AS
SELECT cust.CustomerName, COUNT()
FROM Customers cust
LEFT JOINS Order ord ON ord.OrderID = cust.CustomerID
WHERE Orders.OrderID IS NULL;

2. Create list of products that were shipped to customers on 04/18/2012. (4 Records) */

SELECT

INNER JOINS Order_Details ord ON pro.ProductID = ord.ProductID

INNER JOINS Order order ON ord.OrderID = order.OrderID

where order.ShippedDate = '2012-04-18';

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1) Correct Query:

CREATE VIEW NumCustomerOrders AS
SELECT cust.CustomerName, COUNT(ord.OrderId)
FROM Customers cust
LEFT JOIN Orders ord ON ord.CustomerId = cust.CustomerID
GROUP BY cust.CustomerID

Number of Records: 91 CustomerName COUNT(ord.OrderId) Alfreds Futterkiste Ana Trujillo Emparedados y helados Antonio Moreno T2)

Correct Query

SELECT ProductName FROM Products pro

INNER JOIN Order_Details ord ON pro.ProductID = ord.ProductID

INNER JOIN Order orde ON ord.OrderID = orde.OrderID

where orde.ShippedDate = '2012-04-18';

if you like the answer please provide a thumbs up.

Add a comment
Know the answer?
Add Answer to:
Some of my codes are showing errors, please help! 1. Create a view called NumCustomerOrders which...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • use workbench please Task 1: Create a database and name it practical2DB. (2 marks) Task 2:...

    use workbench please Task 1: Create a database and name it practical2DB. (2 marks) Task 2: Create all the four tables according to the relational scheme in Figure 1. (8 marks) Task 3: Insert 5 records to into each table. (5 marks) Task 4: Write a query to list alphabetically ordered names, addresses, and IDs of all the customers whose postcode is in (40150, 40400, 47500). (10 marks) Task 5: Delete 1 record from Products table using their primary keys....

  • I NEED SOME HELP WITH THIS PLEASE :) 1. Create a data entry form on one...

    I NEED SOME HELP WITH THIS PLEASE :) 1. Create a data entry form on one of your web pages for visitors who want to be added to your mailing list. Include one of each of the following input elements*: Text <input type="text".... • Tel <input type="tel".... . Email <input type="email"... Date <input type="date"... . A set of radio buttons <input type="radio"... • A set of check boxes <input type="checkbox"... • A select element with options <select>.....</select> (do NOT add...

  • can someone solve these quick please and thank you! sql chapter 4 Query #1: List the...

    can someone solve these quick please and thank you! sql chapter 4 Query #1: List the company name, contact name, contact title and the phone number for customers who HAVE NOT put in an order. Use an outer join. Query #2: Create a listing displaying the employee first name, last name and the full name (First name space Last Name) of the person they report to (Supervisor). This is a self-join. If an employee does not report to anyone then...

  • HELLO, PLEASE TAKE TIME TO ANSWER THIS QUESTION. PLESE ENSURE ITS CORRECT AND SHOW THAT THE...

    HELLO, PLEASE TAKE TIME TO ANSWER THIS QUESTION. PLESE ENSURE ITS CORRECT AND SHOW THAT THE PROGRAM RUNS. Task 1: Enforcing const-ness throughout Your first job will be to go through all of the code and decide which functions should be declared const. You should find several places throughout the program where this makes sense. We will also make the id data member in the Customer class const , as once a customer has been created their ID will never...

  • You will develop an E-Commerce database used to maintain customers, products and sales information. You are...

    You will develop an E-Commerce database used to maintain customers, products and sales information. You are required to 1) gather and analyze requirements 2) design logical structure of the database 3) create stored procedures to develop the tables and insert the data 4) write SQL statements for data extraction and reporting. Throughout the course of this semester you have analyzed the requirements for an eCommerce database, designed and developed your database. As a class we have gone through the process...

  • Data Analysis Project Part 1 Custom Fabric Ventures is a small company that produces fabric-based wardrobe...

    Data Analysis Project Part 1Custom Fabric Ventures is a small company that produces fabric-based wardrobe accessories (such as, handbags, scarves, and headbands) and home accessories (such as placemats, pillows, and window treatments).   The company keeps a limited number of popular items in stock, but primarily produces custom orders. Customers are able to choose from a wide selection of styles, sizes, and fabrics for each type of product. Most of the company’s customers are small boutiques, home décor shops, and home-decorators...

  • Can you please provide the formula for the worksheet also. CASE PROBLEMS Level 1- Analyzing Sales...

    Can you please provide the formula for the worksheet also. CASE PROBLEMS Level 1- Analyzing Sales for Crèmes Ice Cream Judd Hemming is the eastern regional marketing manager for Crèmes Ice Cream. Eac quarter, he completes two separate analyses: an analysis comparing ice cream flavor sale volumes from all regional locations with the same quarter sales volumes from the previou year and an analysis comparing total sales in dollars, including mean, median, mode, and standard deviation, of sales by store....

  • could you please help me with this problem, also I need a little text so I...

    could you please help me with this problem, also I need a little text so I can understand how you solved the problem? import java.io.File; import java.util.Scanner; /** * This program lists the files in a directory specified by * the user. The user is asked to type in a directory name. * If the name entered by the user is not a directory, a * message is printed and the program ends. */ public class DirectoryList { public static...

  • please answer these queries. 1. List the artist name of the artists who do not have...

    please answer these queries. 1. List the artist name of the artists who do not have a webaddress and their leadsource is “Directmail” 2. List the names of members in the artist called 'Today'. 3. Report the total runtime in minutes FOR EACH album in the Titles table. 4.List the firstname, lastname of members who are represented by the salesperson “Lisa Williams” 5.List EACH salesperson’s firstname along with the number of Members that EACH SalesPerson represents. DROP TABLES IF EXISTS...

  • please read instructions on the first picture and follow it Discussion Board: Chapter 1 Due: Jun...

    please read instructions on the first picture and follow it Discussion Board: Chapter 1 Due: Jun 28, 2019 at 11:59 PM Please read the article titled Evolution of Operations Planning and Control: from production to supply chains In at least three paragraphs, describe how and why the focus of operations planning and control has changed over time. While one might argue that answers consisting of sentences quoted from articles do not represent plagiarism, I do not consider them acceptable, and...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT