In PL/SQL, With a single query, display the average number of days that each part spent in transit. Round the answers to a whole day
the columns are ( PartNo, Shipdate, ArriveDate)
From below pl/sql , we can find average number of days each part spent in transit
declare
2 part_no ship.PartNo%type;
3 ship_date ship.Shipdate%type;
4 arrival_date ship.ArrivalDate%type;
5 avg_ship ship.PartNo%type;
6 CURSOR c_ship is
7 SELECT PartNo,Shipdate,ArrivalDate, AVG(ArrivalDate-Shipdate)
FROM ship;
8 BEGIN
9 OPEN c_ship;
10 LOOP
11 FETCH c_ship into part_no, ship_date, arrival_date;
12 EXIT WHEN c_ship%notfound;
13 dbms_output.put_line(avg_ship);
14 END LOOP;
15 CLOSE c_ship;
16 END;
17 /
In PL/SQL, With a single query, display the average number of days that each part spent in transit. Round the answers to...
1. Create an PL/SQL anonymous block. Using a “while” loop, display on the console those rows where a quantity of shipments for a project are greater than the average quantity of shipments for that project. 2. Repeat using a FOR loop. // TABLE INFO : SHIPMENTS(SUPPLIERNO, PARTNO, PROJECTNO, QUANTITY, SHIPDATE, ARRIVEDATE)
13 Write a query to display each department’s name, location,
number of employees, and the
average salary for all employees in that department. Label the
columns Department ,
Location, Number of Workers, and Average Salary, respectively.
Round the average salary to two decimal places
.
Tables (Filtered) + COUNTRIES DEPARTMENTS 0 DEPARTMENT_ID DEPARTMENT_NAME MANAGER_ID 1 LOCATION_ID 0 EMPLOYEES - EMPLOYEE_ID 1 FIRST_NAME LAST_NAME EMAIL IPHONE_NUMBER HIRE_DATE JOB_ID SALARY 0 COMMISSION_PCT " MANAGER_ID " DEPARTMENT_ID + JOB_GRADES - JOB_HISTORY + JOBS...
Express the following queries in SQL. Only standard SQL syntax is allowed. Each query should be answered in a single SQL statement: 1. Find the name of suppliers that are located in Mumbai. 2. Find the name of suppliers and the names of parts they sell. List the result in descending order suppliers name. 3. Find the names of parts that are sold by exactly two suppliers. 4. Find the names of parts that are sold by all suppliers. 5....
5. Query data from emp table for each non-deptno 20 employees to display the ename and calculate the number of months between today and the date the employee was hired. Label the column heading to Ename and Months_Worked. Order your results by the number of months employed. Round the number of months to a whole number.
emp table in bellow:
5. Query data from emp table for each non-deptno 20 employees to display the ename and calculate the number of months between today and the date the employee was hired. Label the column heading to Ename and Months_Worked. Order your results by the number of months employed. Round the number of months to a whole number. Months _Worked - - - - - - - - Ename MILLER KING JAMES MARTIN TURNER CLARK BLAKE WARD ALLEN...
Please help me on the SQL
queries, thank you so much.
Write a query to display the
title and publisher as well as the publisher contact for each book
using JOIN...USING clause.
Write a query to show the
first and last names of customers who have ordered cooking books.
Use the WHERE clause to join the tables.
Write a query to show the
title, cost and ISBN of each book in the books table. If the book
has been ordered,...
Write the query in SQL:
Sample output:
Table:
For customer and product, show the average sales before and after each month (e.g., for February, show average sales of January and March. For "before" January and "after" December, display NULL> The "YEAR" attribute is not considered for this query-for example, both January of 2007 and January of 2008 are considered January regardless of the year. 2. Report #2: CUSTOMER PRODUCT MONTH BEFORE AVG AFTER AVG Bloom 2434 325 Bread Milk <NULL>...
Please answer each question using these tables above, it is
SQL
Display the descriptions and prices of the 5 most expensive
parts, in descending order by price.
For each part, display the On Hand Value, which is calculated
by multiplying the quantity on hand by price.
Display a summary with part number, description, on hand and
warehouse for all parts in class HW or AP, and in warehouse 1 or
2.
Display the names of customers who do NOT live...
SQL MS Acess
1. Display cid, clast, and cfirst for customers whose (last name
starts with a “D” and has a “v” in the third position) or (first
name ends with an “a”).
2. Display all the columns in Invoice for those invoices that
have less than the average iprice.
3. Display all the columns in Customer for those customers who
purchased a vehicle that has the same date value in icontract and
isold. In other words, customers who signed...
Accounts Receivable Analysis A company reports the following:Net sales $1,272,390Average accounts receivable (net) 60,590Determine (a) the accounts receivable turnover and (b) the number of days' sales in receivables. Round interim calculations to the nearest dollar and final answers to one decimal place. Assume a 365-day year.a. Accounts receivable turnoverb. Number of days' sales in receivables days