Relational schema of a firm database - write a sql query

Assignment Help PL-SQL Programming
Reference no: EM13192347

Consider the relational schema of (part of) a firm database below. Write a SQL query for each of the following requirement. Run the queries using the database uploaded with the assignment and display the results.

1115_Relational schema.png

1. List the Vend_ID, Vend_Name, Vend_Contact of all vendors whose LAST name begins with 'C'. List them in descending order of Vend_City. (Query should return 2 rows)

2. List the vendor city and the number of vendors in each city where the number of vendors is greater than 2. Use the alias TotalVendors for the number of vendors.(Query should return 2 rows)

3. Display Ord_ID, Ord_Date of all orders where condition (c) is met and simultaneously either one of conditions (a) and (b) are met

a) Vend_ID starts with the letter "P"

b) Ord_Status is "Rec"

c) Ord_Tot_Cost is greater than or equal to $2000 but less   than or equal to $5500

(Query should return 4 rows)

4. Display the loc_description and item_id of all items whose storage quantity is greater than 15. (Query should return 4 rows)

5. Display the Rep_ID, Rep_Date and Item_ID of all items where either the Rep_Cost is less than $50 or the Item_Buy_Datedate is between 1/1/1910 and 1/1/1915.(Query should return 4 rows)

6. Display the ID and name of vendors who have NOT placed any order.(Query should return 3 rows)

7. Display the item ID, store quantity and location description of the items having the lowest store quantity. Note: there are three such items.(Query should return 3 rows)

8. Display the vendor ID and vendor name of the items whose item quantity is the largest. (Query should return 2 rows)

9. Display the item ID and item quantity of all items whoseitem quantity is less than the average quantity. Also display the average quantity.(Query should return 6 rows)

10. How many times the vendor has placed an order for the item ID = 1 (rename it as NUMORD)? Also display the vendor name and the location description for the item_ID = 1? Write a single query to obtain the results.

Attachment:- Relational schema.accdb

Reference no: EM13192347

Questions Cloud

Compute the overall enthalpy change for the reaction : C3H8(g) + 5 O2(g) ? 3 CO2(g) + 4 H2O(g) Calculate the overall enthalpy change for this reaction using standard bond enthalpies.
Which best represents this distance : TO stop a base runner standing on first base from stealing second base, the catcher must throw the ball directly from home plate to second base. Which best represents this distance?
Will the early release policy increase or decrease the costs : California prisons are overcrowded. The State has the choice between building new prisons and relaxing parole standards (so that prisoners are released on parole earlier). Due to the budget crisis, it has chosen to relax parole standards.
Describe the distribution of proportion of pink jelly beans : A class of students opens several bags, counts the various colors of jelly beans, and calculates the proportion that are pink in each bag. Is it appropriate to use a Normal model to describe the distribution of the proportion of pink jelly beans?
Relational schema of a firm database - write a sql query : Display the vendor ID and vendor name of the items whose item quantity is the largest and display the item ID and item quantity of all items whoseitem quantity is less than the average quantity. Also display the average quantity
Calculate monthly deposits necessary to accumulate : Calculate monthly deposits necessary to accumulate $13,800 after 5 years in account earning 6.75% compounded monthly?
Estimate true population of student attending private school : a random sample of 450 students from a wide geographic area indicated that 55 attended private schools. Estimate the true population of students attending private schools with 90% ci.
Hydrothermal mineral deposits of copper-gold-silver : Many hydrothermal mineral deposits of copper, gold, silver, and other metals have been found in the countries bordering the Pacific Ocean. Can you offer an explanation for this remarkable concentration? If you were part of a team of exploration geolo..
Find the work done in pumping out all the water over : A tank full of water is in the shape of a box 2 deep, 2 long, and 8 wide. Find the work done in pumping out all the water over one of its sides.

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Trigger named products_update

Create a trigger named Products_UPDATE. This trigger should insert the old data about the product into the ProductsAudit table after the row is updated. Then, test this trigger with an appropriate UPDATE statement.

  Create report to display scr courses in alphabetical order

Create the detail report which will display all SCR courses in alphabetical order, with a course name and instructor name in the group header.

  Write select statement to return those rows with due balance

Write SELECT statement which returns those rows with the balance due greater than 1000. Sort result set by InvoiceTotal, with largest invoice first.

  Query that uses cube operator to return lineitemsum

Write summary query which uses CUBE operator to return LineItemSum (which is the sum of InvoiceLineItemAmount) group by Account(an alias for AccountDesciption).

  Write sql statement to add new record to part table

Write SQL statement which creates the stored procedure which adds new record to the Part table, and returns value of newly created PartID PK value in out parameter.

  Sql statement which select names and owners of great danes

Write SQL statement which would select each of the following: names and owners of all Great Danes and all attributes of poodles whose balance is no greater than $50.

  Business transaction that involves multiple tables

Write a business transaction that involves multiple tables and implement it using PL/SQL. Use at least one Function or Procedure in your code. The transaction may retrieve data from the database and display the result, or it may insert/update data in..

  Write a select statement

Write a SELECT statement that returns these columns from the CustomerAddresses view that you created in exercise 1: CustomerID, LastName, FirstName, BillLine1.

  Script that creates and calls a function named

Write a script that creates and calls a function named fnDiscountPrice that calculates the discount price of an item in the OrderItems table (discount amount subtracted from item price). To do that, this function should accept one parameter for th..

  Write statement which creates table named part

Write the statement which creates table named Part, with Id field as an int idendity PK, a SupplierId int field, a Description string field of size 25, a Count int field, a Class string field

  Write a pl-sql block

Write a PL/SQ block - Select the average salary of all employees in department number 20.

  Give me a list of all the proposed prices

Give me a list of all the proposed prices for the next year from the l_foods table.  Sort your results by proposed_price.  (Note that proposed price, is price + price_increase.)

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