Question

GIVE ME QUERIES: d) List Order IDs and the associated Customer Full Names for orders that...

GIVE ME QUERIES: d) List Order IDs and the associated Customer Full Names for orders that are ordered from either 'VIRGINIA' or 'NEW YORK'. I want you to connect three tables with SQL JOINS and use WHERE clause to filter certain customers. (Hint: Customer Table and Order Table are connected by Customer ID and Customer Table and State Table can be connected by CUST_STATE and ST, use those conditions in your JOINs)

e) Find me the Product Names from the Orders of John Dulles. You need to connect multiple tables with SQL joins and use WHERE clause to filter certain customers. I want you to list only Product Names (nothing else). Make sure you don't have duplicate Product Names in your results.

Homework Answers

Answer #1

d) select o.order_id, c.fname,c.lname from Customer c, Order o where c.customer_id=o.customer_id and c.CUST_STATE in (select ST from State where ST in ('VIRGINIA','NEW YORK');

In the above query i am aliasing customer table, order table with letters c and o respectively. and i have used sub query to know whether orders come from 'VIRGINIA' or 'NEW YORK' these states or not.

e) select distinct(o.product_Name) from Orders o, Customer c where c.customer_id=o.customer_id and c.fname='John' and c.lname='Dulles';

distinct() is used to list unique product names for customer named 'john Dulles'.

Know the answer?
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
Similar Questions
Assignment 2 Instructions You need to access to the database and write SQL queries on the...
Assignment 2 Instructions You need to access to the database and write SQL queries on the following site: https://www.w3schools.com/sql/trysql.asp?filename=trysql_op_in 1. Use INNER JOIN to create a report. In this report, list each customer’s CustomerID, CustomerName, and their each OrderID and each order’s OrderDate, if the customer has ever placed an order. You should use the Customers table and the Orders table in the database to complete this query.   2. Use INNER JOIN to create a report. In this report, list...
***This is a complete question. Do not tag this as incomplete. Write SQL queries to the...
***This is a complete question. Do not tag this as incomplete. Write SQL queries to the below Relational Database. • Regarding the SQL queries: • Do not use SELECT * in any query. • Do not use any SQL features (including Nullif) that were not covered in this course. • Do not use subqueries IF joins can be used to answer a question. However, some questions may require the use of subqueries. The Movie Database Notes: TheaterNum, MovieNum, and ActorNum...
Saul wants to buy a new writer's desk, but he doesn't want to spend more than...
Saul wants to buy a new writer's desk, but he doesn't want to spend more than $350. Write a select statement to find products matching these requirements For each customer, list the customer name and city and state in this format: City, State (one column) Display only those orders where more than one different product has been ordered Find the average price of bookcases A. List all the customers and list the number of different shipping addresses for each. Customers...
Hey guys, how are you? I was given this exercise: it asks me to draw the...
Hey guys, how are you? I was given this exercise: it asks me to draw the USE CASES MODEL, the corresponding SPECIFICATION and finally, the DOMAIN MODEL (it is required to use the cardinality and other things) for the following study case (a brief explanation of everything is needed): In order to prevent the human contact due to Corona Virus and to guarantee a better experience, a company has decided to develope a QR-based system for all the different restaurants...
Save your select statements as a script. Place the semicolon at the end of each SQL...
Save your select statements as a script. Place the semicolon at the end of each SQL statement. Please number your select statements from 1 to 8 in your script and comment out each number. Include your name and student number as a comment at the top of your script. The name of the script has to be Assignment1_JohnSmith. Instead of JohnSmith use your First Name and Last Name. Upload your script trough Blackboard. Use SQL Developer to create the My...
SQL Write the queries necessary to obtain the required information 1) Use sub query and “in”...
SQL Write the queries necessary to obtain the required information 1) Use sub query and “in” keyword to print the salesreps (ids) who have taken order for the companies ‘Zetacorp’ or ‘JCP Inc.’ . Duplicate rows are not allowed 2) Use sub query to find the id and the name of every sales rep that represents at least one customer with a credit limit of greater than $5000. 3) Use sub query and keyword “exists” to list the id and...
Please submit SQL statements as a plain text file (.txt). If blackboard rejects txt file you...
Please submit SQL statements as a plain text file (.txt). If blackboard rejects txt file you can submit a zipped file containing the text file. Word, PDF, or Image format are not accepted. You do not need to show screen shot. Make sure you have tested your SQL statements in Oracle 11g. Assumptions: Each tool belongs to a category. Each category may have a parent category but the parent category should not have parent category (so at most two levels)....
You are a database consultant with Ace Software, Inc., and have been assigned to develop a...
You are a database consultant with Ace Software, Inc., and have been assigned to develop a database for the Mom and Pop Johnson video store in town. Mom and Pop have been keeping their records of videos and DVDs purchased from distributors and rented to customers in stacks of invoices and piles of rental forms for years. They have finally decided to automate their record keeping with a relational database. You sit down with Mom and Pop to discuss their...
1. Explain and give examples of the 5 existing business model patterns. 2. Can the business...
1. Explain and give examples of the 5 existing business model patterns. 2. Can the business below use that business model pattern? Explain. Overview- We are going to start a bakery business as I have my interest in bakery. This is going to be start-up business plan. The name of our Bakery would be “Bake It or Make It”. It would be managed by me along with my team of new bakers around the city. Opening a bakery at initial...
Use the business developed below. Explain the 10 assumptions that you used in developing this business....
Use the business developed below. Explain the 10 assumptions that you used in developing this business. Overview- We are going to start a bakery business as I have my interest in bakery. This is going to be start-up business plan. The name of our Bakery would be “Bake It or Make It”. It would be managed by me along with my team of new bakers around the city. Opening a bakery at initial stage would involve a lot of investment...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT