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

  Write a java for file processing according to rules

The file is read into memory, all of it in one buffer, and the buffer is reversed, then the file is overwritten. For simplicity, we may assume that the maximum size of the file is 200000 bytes. If no file was selected an error message is displayed..

  Write a code using greedy best first search

Write a code using Greedy Best First Search and A* in Java language to find the shortest path in Romania path to Bucharest

  Transform g to an equivalent g'' that has no

Let G be a context free grammar with productions S->ABAC , A->aA|? , B->bB|? , C->d Transform G to an equivalent G' that has no ? productions and no unit productions

  Determine how to diagnose and reseat the ram

A user complains that her computer is responding very slowly. She also says that when booting the PC, it reports a lower value for memory than she assumed is available. You investigate and consider the idea that one of the RAM sticks in her PC may..

  Create a banner for your new business

Scenario: As you peruse various websites on the Internet, looking to create a banner for your new business, you notice that many places charge you by the letter. You want to be able to quickly count the letters on the various banners you design, so y..

  Questions related to mcqs

The quality of a language that allows a programmer to express a computation clearly, correctly, concisely, and quickly is called _____.

  What are some factors or requirements

What are some factors or requirements when designing an Active Directory Infrastructure. How do you gather the requirements for the design? Please explain in approximately in two paragraphs.

  Reflect upon the it strategies

Reflect upon the IT strategies that are used to encourage economic development. Select two strategies and discuss how economic factors affect the strategies that a government may use to facilitate economic development.

  Design a prototype for a standalone desktop

Design a prototype for a standalone desktop OR mobile/tablet application called EILA

  Describe semi-supervised classification

(a) Describe semi-supervised classification, active learning, and transfer learning. Elaborate on applications for which they are useful, as well as the challenges of these approaches to classification.

  Write down sructured english for clyde-s narrative

On a trip lasting more than one day, we permit hotel, taxi, and airfare also meal allowances. Same times apply for meal expenses. Write down sructured English for Clyde's narrative of the reimbursement policies.

  Apply the dynamic programming algorithm

Apply the dynamic programming algorithm to find all the solutions to the change-making problem for the denominations 1, 3, 5 and the amount n = 9

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