Question

Below is the database schema for a company. Primary keys are underlined. Customers (CustomerID, CompanyName, Phone,...

Below is the database schema for a company. Primary keys are underlined. Customers (CustomerID, CompanyName, Phone, BalanceDue) Oders (Orderid, orderdate, customerid, freightamount) Orderdetails (oderid, productid, qtyordered, price) Products (productid, productname, qtyinstock, suggestedprice, minstocklevel) Given this SQL statement: Select * From Customers Inner Join Orders on Orders.CustomerID=Customers.CustomerID Where Orders.CustomerID is Null; Which of the following statement is correct?

It is a SQL select statement that will list the ProductName for all products where the Qtyinstock is less than the total QtyOrdered (in OrderDetails) of that product.

It is a SQL select statement that will list all customers who have not placed any order.

It is a SQL select statement that will list the most expensive (highest suggested price) product's name, and its suggested price.

It is a SQL select statement that will list in alphabetical order, the ProductName of all products where the Qtystock is less than 10.

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

Dear Student ,

As per the requirement submitted above , kindly find the below solution.

Question :

Answer :It is a SQL select statement that will list all customers who have not placed any order.

Explanation :

  • Given sql statement will join Customers and orders table based on CustomerID
  • and will return the records for orders where customer is null.
  • This means SQL select statement that will list all customers who have not placed any order.

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.

Add a comment
Know the answer?
Add Answer to:
Below is the database schema for a company. Primary keys are underlined. Customers (CustomerID, CompanyName, Phone,...
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
  • Orders Order detail products OrderNumber (Primary) OrderNumber (Composite Primary key and Foreign) ProductID (Primary) CustomerID LineItemNumber...

    Orders Order detail products OrderNumber (Primary) OrderNumber (Composite Primary key and Foreign) ProductID (Primary) CustomerID LineItemNumber (Composite Primary key) ProductName OrderDate ProductID (Foreign) Price ShipDate Quantity Category Determine SQL d. Produce itemized bills for orders showing line item totals. (For example, show OrderNumber, CustomerID, LineItemNumber, Product, Total.) The total is the line item total. e. List the customers that have orders that have not yet shipped f. Determine the number of orders that ship the same day they were ordered

  • Orders Order detail products OrderNumber (Primary) OrderNumber (Composite Primary key and Foreign) ProductID (Primary) CustomerID LineItemNumber...

    Orders Order detail products OrderNumber (Primary) OrderNumber (Composite Primary key and Foreign) ProductID (Primary) CustomerID LineItemNumber (Composite Primary key) ProductName OrderDate ProductID (Foreign) Price ShipDate Quantity Category Determine SQL d. Produce itemized bills for orders showing line item totals. (For example, show OrderNumber, CustomerID, LineItemNumber, Product, Total.) The total is the line item total. e. List the customers that have orders that have not yet shipped f. Determine the number of orders that ship the same day they were ordered...

  • The business process we are interested in is sales(i.e., selling products to customers). Develop a logical...

    The business process we are interested in is sales(i.e., selling products to customers). Develop a logical star- or snowflake-schema dimensional model. orders customers + PK FK orderdetails PK/EK OrderID PK/FK Products UnitPrice Quantity Discount PK OrderID Customer D FK Employeeld Order Date RequiredDate Shipped Date FK ShipVia Freight ShipName ShipAddress ShipCity ShipRegion ShipPostalCode Ship Country CustomerID CompanyName ContactName Contact Title Address City Region PostalCode Country Phone shipppers PK Shipperid CompanyName Phone Fax products PK ProductID + employees PK Employeeld LastName...

  • The Northwind database created by Microsoft contains the sales data for a fictitious company called Northwind...

    The Northwind database created by Microsoft contains the sales data for a fictitious company called Northwind Traders, which imports and exports specialty foods from around the world. Here is the schema of the database: Products (ProductID, ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued); Suppliers (SupplierID, CompanyName, ContactName , ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax, HomePage); Categories (CategoryID, CategoryName, Description, Picture); Orders (OrderID, CustomerID, EmployeeID, OrderDate, RequiredDate, ShippedDate, ShipVia,  Freight, ShipName,ShipAddress, ShipCity, ShipRegion, ShipPostalCode, ShipCountry); Order_details (ID, OrderID,...

  • the lifestyle manager decides to give customers who bought three or more units of the same...

    the lifestyle manager decides to give customers who bought three or more units of the same product in the same order a 20 percent discount. Show order id, product id, price, quantity and discounted price for those discounted in orderdetails I have the sql working except I cannot figure out the discounted price SELECT OrderID, ProductID, quantity, Price, Price *0.20 AS "Discounted Price" From Sales.OrderDetails where OrderID >1 and quantity >2 Example OrderID ProductID Price Quantity Discounted Price 2 4...

  • Given the following relational database schema (primary keys are bold and underlined). Answer questions 2.1 to 2.4 Orde...

    Given the following relational database schema (primary keys are bold and underlined). Answer questions 2.1 to 2.4 Orders(orderld, customerld, dateOrdered, dateRequired, status) Customer(customerld, customerLastName, customerStreet, customerCity, customerState, customer Lip OrderDetails(orderld.productld, quantity, lineNumber, amount) Products(productld, name, description, quantity, unitPrice) Account(accountNumber, customerld, dateOpened, creditCard, mailingStreet, mailingCity, mailingState, mailingZip) 2.1 (2 Points) List all possible foreign keys. For each foreign key list both the referencing and referenced relations. 2.2 (2 Points) Devise a reasonable database instance by filling the tables with data of...

  • Question : Map the below ERD into the relational schema and explain the steps for mapping...

    Question : Map the below ERD into the relational schema and explain the steps for mapping showing the tables that have been designed. Should ensure that all tables are fully normalised. FIRSTNAME LASTNAME BASICSALARY (NAME) EMPLOYEEID ADDRESS ACCOUNTNO CONTACT EMPLOYEE PRODUCTNAME ISA PRODUCTID PRICE PRODUCT QUANTITY MANAGES MANAGES PAYROLLOFFICE SALESOFFICER PURCHASEOFFI CER PROVIDED BY> ORDERS FROM SUPPLIERID FIRSTNAME PROCESSES MANAGES CUSTOMERID (NAME) CONTACT TOTAL LASTNAME SUPPLIER CUSTOMERAH MAKES TA ORDER PAYID ADDRESS PAYROLL SUPPLIERNAME BONUS ORDERID DATE STAFFID TOTALNETPAY CONTACT...

  • Exercise 3 [12.5 marks] Given the Restaurant management system database that contains the following tables (primary...

    Exercise 3 [12.5 marks] Given the Restaurant management system database that contains the following tables (primary keys are underlined and foreign keys are preceded with #): Customer (customerID,customerFirstName,customerLastName,customerAddress) Oreder (orderID,orderDate, #customerID,#menuItemID,#staffID) MenuItem(menuItemID, menuItemName,ingredients,type,availability) Staff(staffID, staffName, staffPhoneNumber, staffRole ) OrderPayment(paymentID,paymentAmount,#orderID,#staffID) 1) Without using DISTINCT, write the SQL query equivalent to the following one:[1.5 marks] SELECT DISTINCT menuItemName FROM MenuItem WHERE type = ‘Vegetarian’ OR availability= ‘Yes’; 2) Express the following queries in SQL: a) Find the number of orders placed by...

  • Customer (CustomerId, CustomerName) Employee (EmployeeId, EmployeeName, Salary, SupervisorId) Product(ProductId, ProductName, ListPrice) Orders (OrderId, OrderDate, CustomerId, EmployeeId,...

    Customer (CustomerId, CustomerName) Employee (EmployeeId, EmployeeName, Salary, SupervisorId) Product(ProductId, ProductName, ListPrice) Orders (OrderId, OrderDate, CustomerId, EmployeeId, Total) OrderedProduct (OrderId, ProductId, Quantity, Price) Write the code to complete the methods in OrderJDBC.java (look for TODO items). <---**IN BOLD** throughout code. /* OrderJDBC.java - A JDBC program for accessing and updating an order database on MySQL. */ import java.io.File; import java.math.BigDecimal; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Statement; import java.util.Scanner; /** * An application for...

  • Questions are based on the Northwind database. a. A data dictionary (Excel file) that describes each...

    Questions are based on the Northwind database. a. A data dictionary (Excel file) that describes each of the tables. (Attached in question) b.    Write good, clean SQL that answers the following questions. c.     Separate your queries as I have done in the following example. End each query with a semicolon (;) and insert the word "go" between each query. Queries can span multiple lines if required. Select CustomerID from Customers; go Select Count(*) from Employees; go Select max(productID) from Products; 18. Produce...

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