Use of basic and advanced sql queries

Assignment Help Basic Computer Science
Reference no: EM13846395

Purpose:

This laboratory provides practice in the creation and use of basic and advanced SQL queries involving one table in a DB schema.

Procedure:

Using your assigned user name, password, and host string, log in to Oracle SQL*Plus, and open a spool file to collect your dialog.  Create queries to answer the following questions.  Your queries should be written so that they use only the data provided and display only the data requested.

Don't edit the initial spool file. You will make mistakes and will not be penalized for them.  Attach it to the back of your report.  Follow the instructor's instruction concerning any additional required items, any needed sign-offs, and the due date of this report.

Part A:

1. Display the ids and names for all customers.

2. Display all the data in the sales representative table.

3. Display the names of all customers whose credit limits are $10,000 or more.

4. Display the invoice number for all orders placed by the customer whose id is 1619 on September 13, 2007.  Please note: A date in a condition should be in the form '13-SEP-07'.

5. Display the id and the name for all customers whose sales representative has an id of either 237 or 268.

6. Display the id and description for all products whose type is not AP.

7. Display the id, the description, and the number of items for each product that has between 12 and 30 items. Perform this query two different ways.

8. Display the id, the description, and the total value (product quantity * product price) of each product whose product type is HW.  Assign the column name TOTAL_VALUE to this calculation.

9. Display the id, the description, and the total value (product quantity * product price) of each product whose total value is greater than or equal to $4,000.  Assign the column name TOTAL_VALUE to the calculation.

10. Display the id and the description for each product whose type is either SG or AP using the IN operator.

11. Determine the id and the name of each customer whose name starts with the letter "S".

Part B:

12. Display all the data in the products table.  Order the display by the product description.

13. Display all the data in the products table.  Order the display by product type.  Within each product type, order the display by product id.

14. Determine the number of customers whose balances are less than their credit limits.

15. Display the total of the balances of all customers who are represented by sales representative 237 and whose balances are less than their credit limits.

16. Display the id, the description, and the total value of each product whose number of items is greater than the average number of items for all products. You may want to use a subquery.

17. Display the balance of the customer whose balance is the smallest.

18. Display the id, the name, and the balance of the customer with the largest balance.

19. Display the sales representative's id and the sum of the balances of all customers represented by each of these sales representatives. Group and order the display by the sales representative ids.

20. Display the sales representative's id and the sum of the balances of all customers represented by each of these sales representatives, but limit the result to those sales representatives whose sum is more than $12,000.

21. Display the ids of all products whose description is not known.

Reference no: EM13846395

Questions Cloud

Why assumption of normality about the distribution of wages : What is the probability that a random sample of 49 different one-hour shopping periods will yield a sample mean between 441 and 446 shoppers and interpret your answer in words.
Provider database-ms access : As you recall, data is a collection of facts (numbers, text, even audio and video files) that is processed into usable information. Much like a spreadsheet, a database is a collection of such facts that you can then slice and dice in various ways ..
Identify the persuasive language and positioning : Memo to the marketing staff regarding the company's introduction of a new diet supplement. identify the persuasive language and positioning needed to attract three different target audiences: Baby Boomers, Gen Xers, and Gen Y-ers
What is present value of your windfall-discount rate : You have just received notification that you have won the $1 million first prize in the Centennial Lottery. However, the prize will be awarded on your 100th birthday (assuming you’re around to collect), 65 years from now. What is the present value of..
Use of basic and advanced sql queries : This laboratory provides practice in the creation and use of basic and advanced SQL queries involving one table in a DB schema.
A significant period of suffering : Describe a time when you experienced a significant period of suffering. How did you deal with that experience? How did you find comfort in the midst of suffering?
How does boeing market its planes : Write a minimum of two or three pages of research based paper on Boeing's strategy for new / emerging market. How does Boeing market its planes
Annual coupon bond with a required return : Consider a 10-year, 12 percent annual coupon bond with a required return of 8 percent. The bond has a face value of $1,000. Which of the following is correct?
Discuss the ethical issues in the observed case : Discuss the ethical issues in the observed case - Identify the facts of the observed case and illustrate the relevant law relating to the observed case

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Replacing a lower rpm disk

Is it true that replacing a lower RPM disk with a higher RPM disk would always result in disk performance improvements? Why?

  Suggest a change to the closest-pair algorithm

Suggest a change to the closest-pair algorithm that avoids presorting the Y array but leaves the running time as O(n lg n). (Hint: Merge sorted arrays YL and YR to form the sorted array Y .)

  Print the list after each value is inserted into the list

Generate 10 random numbers between in the range of 25 to 50. Insert them into a list, keeping the list in order as each value is inserted. Print the list after each value is inserted into the list.

  Using a competitive ratio measure

Imagine you are standing next to a long fence, extending as far as you can see in both directions. You want to cross the fence and you know that somewhere it has a hole you can go through. But, you don't know whether the hole is to your right or..

  Presentation about application and its ui or user interface

In this assignment, you will create a PowerPoint presentation that includes slides and a voice recording that presents your information. You need to present your information as if you were presenting to the organization/person that developed the a..

  Use strong induction to show that every positive

Use strong induction to show that every positive integer n can be written as a sum of distinct powers of two, that is.

  What does it mean if they are public or private

When creating classes you have member functions and member variables. What are they and what data types can you use for member variables? What does it mean if they are public or private

  Determine the standard deviation and variation

Determine the standard deviation and variation, and explain their importance in statistical analysis of a data set.

  Determine throughput for file transfer form one host-another

Assume Host A wishes to send the large file to Host B. Suppose no other traffic in network, Determine the throughput for the file transfer?

  Multiplexors whose control bit allows

Multiplexors whose control bit allows you to select between one of two modes right shift or left shift. Include logic to perform arithmetic shift left and arithmetic shift right . This means you must include logic to perform sign extension in ..

  Create a list containing union of elements of two lists

Create a list containing the union of the elements of the two lists? Insert an element after the nth element of the list?

  Calculate the area of the two-dimensional shape

Implement a Shape hierarchy where Each TwoDimensional Shape should contain the method getArea to calculate the area of the two-dimensional shape.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd