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...
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...
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
Questions in this part ask you to write SQL queriesthat would retrieve certain information from the tables. For each question, write the SQL query that would display the information asked by the question. Display information about parts that have their weights greater than the average weight of all parts. PNO PNAME P2 BOLT P3 SCREW Find supplier numbers who supply any screws (i.e., such that the part name is ‘screw’). The constraint is that you may not use any join or...
Each business day, on average, a company writes checks totaling $13,600 to pay its suppliers. The usual clearing time for the checks is four days. Meanwhile, the company is receiving payments from its customers each day, in the form of checks, totaling $24,600. The cash from the payments is available to the firm after two days. a. Calculate the company’s disbursement float, collection float, and net float. (A negative answer should be indicated by a minus sign. Do not round...
Each business day, on average, a company writes checks totaling $13,400 to pay its suppliers. The usual clearing time for the checks is four days. Meanwhile, the company is receiving payments from its customers each day, in the form of checks, totaling $24,400. The cash from the payments is available to the firm after two days. a. Calculate the company’s disbursement float, collection float, and net float. (A negative answer should be indicated by a minus sign. Do not round...