Question

In: Computer Science

Provide SQL Statement for the ff queries: 1. List the total computer offer value in Stevens...

Provide SQL Statement for the ff queries:

1. List the total computer offer value in Stevens Point

2. List of the computer transactions ordered by transaction value in descending order

3. List of the number and average value of computer requests in Wausau

4. List the number and average value of computer transactions

Tables are :

Tb_Product

Prod_ID, Name, MU

Tb_Offers

Supp_ID, Prod_ID, Price, Quantity

Tb_Transactions

Tran_ID,Supp_ID, Con_ID, Prod_ID, Price, Quantity

Tb_Suppliers

Supp_ID, Name, City

Tb_Request

Con_ID, Prod_ID, Price, Quantity

Solutions

Expert Solution

If there is any issue , you can modify it as I dont have the details in Table and table structure in MySQL database ,

it is similar to all databases , might need some modifications

 1- SELECT SUM(TO.price*TO.Quatity) as total , TP.Name FROM Tb_Offers TO , Tb_Suppliers TS, Tb_Product TP where TO.Supp_ID = TS.Supp_ID and TP.Prod_ID=TO.Prod_ID and TP.Name="computer" where TS.city="Stevens Point"; 2- select SUM(TR.price*TR.Quatity) as total ,TP.Name as name from Tb_Product TP, Tb_Transactions TR where TP.Prod_ID=TR.Prod_ID and name="computer" order By total desc; 3- select count(*) as num , avg(TR.price*TR.Quatity) , TP.name as name , TS.city as city from Tb_Request TR, Tb_Suppliers TS, Tb_Product TP where city="Wausau" and name="computer" and TR.Prod_ID=TP.Prod_ID; 4- select count(*) as num , avg(TR.price*TR.Quatity) , TP.name as name from Tb_Transactions TR, Tb_Product TP where TP.Prod_ID=TR.Prod_ID and name="computer"

Related Solutions

Write SQL queries below for each of the following: List the names and cities of all...
Write SQL queries below for each of the following: List the names and cities of all customers List the different states the vendors come from (unique values only, no duplicates) Find the number of customers in California List product names and category descriptions for all products supplied by vendor Proformance List names of all employees who have sold to customer Rachel Patterson
Create the following SQL queries using the lyrics database below 1. List the first name, last...
Create the following SQL queries using the lyrics database below 1. List the first name, last name, and region of members who do not have an email. 2. List the first name, last name, and region of members who do not have an email and they either have a homephone ending with a 2 or a 3. 3. List the number of track titles that begin with the letter 's' and the average length of these tracks in seconds 4....
A. Project 1 case: DDL’s and Business Rules - The SQL queries for this project are...
A. Project 1 case: DDL’s and Business Rules - The SQL queries for this project are based on the business rules from PROJECT 1. Thus, the SQL queries will run against the tables from Project 1 (see section B below). The following is a list of the business rules derived from the Project 1 assignment: - A university is identified by its name and located in a particular city. - A university has many researchers, each of whom can only...
Using the below two SQL queries and comments below, provide explanation on why the output count...
Using the below two SQL queries and comments below, provide explanation on why the output count varies and which SQL yield correct result. (20 points) Both SQLs are joining two tables Both SQLs are syntactically correct Query #1 returns about 19614 rows versus Query #2 returns 3550134. Query #1: select * from person.Address addr inner join person.StateProvince prov on addr.StateProvinceID = prov.StateProvinceID Query #2: select * from person.Address addr,person.StateProvince prov
a) Write down the SQL Statement for the below Queries b) Supply sample tale output c)...
a) Write down the SQL Statement for the below Queries b) Supply sample tale output c) the database Used is the University Schema downloaded at lecture 1. Write a query to display the name for those Students who gets more Tot_Cred than the Student whose ID is 55739. 2. Write a query to display the name salary, department name, instructor id for those instructors who works in the same department as the instructor works whose id is 83821. 3. Write...
Write the following SQL queries and show the corresponding output of the DBMS: 1) Write an...
Write the following SQL queries and show the corresponding output of the DBMS: 1) Write an SQL statement to display all the information of all Nobel Laureate winners. 2) Write an SQL statement to display the string "Hello, World!". 3) Write an SQL query to display the result of the following expression: 2 * 14 +76. 4) Write an SQL statement to display the winner and category of all Laureate winners. 5) Write an SQL query to find the winner(s)...
Question 1: Part 1 Write SQL statements for the following queries from the ‘EMPLOYEE’ table in...
Question 1: Part 1 Write SQL statements for the following queries from the ‘EMPLOYEE’ table in the WPC Database in MySQL: Display all records from the Employee table for employees working in the “Marketing” department. Display all records from the Employee table for employees working in the “Marketing” department OR “Finance” Department. Display the Last Names of all employees such that each last name appears only once. Display all the attributes for employees whose employee number is less than 10....
For Problems 1–4, using the STORES Database, formulate SQL queries, Hand in a listing of each...
For Problems 1–4, using the STORES Database, formulate SQL queries, Hand in a listing of each query and its output. 1. (10 Points) For each customer, list each stock item ordered, the manufacturer, the quantity ordered, and the total price paid. Include the following columns in the order given below: From Customer Table:              Company From Stock Table:                      Description From the Manufact Table:        Manu_Name From the Items Table:                                Quantity, Total Price Order the output by Company and Description....
List the primary additional datatypes used in a spatial database and provide two example queries that...
List the primary additional datatypes used in a spatial database and provide two example queries that can be run against these datatypes. Explain the differences in data representation between key:value and document databases. In your answer describe the format of a JSON document, and give an example of a query in a document database
Tesco is a customer-orientated business. It aims to offer products that provide value for money for...
Tesco is a customer-orientated business. It aims to offer products that provide value for money for its customers and to deliver high-quality service. Tesco wants to attract new customers, but it also wants to keep its existing customers happy. Building customer loyalty is a cost-effective strategy to grow the business. This is because satisfied customers are a good advert for the business. Tesco has more than a 30% market share of the UK grocery market, nearly double that of its...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT