PL/SQL Stored Procedure

Q1.Write a PL/SQL procedure that given an order id, first check whether this order exists. If not, print an error message no such order. Then compute the total cost equals the sum of each item’s price * quantity in the order plus a 10% delivery fee. The procedure finally updates the g_order table to set the total column to the computed value (the initial total column has null value).

Q2.Write a PL/SQL procedure which takes a time interval x as input, and print out names of employees and IDs of deliveries whose actual delivery time is within plus or minus x of the planned delivery time. E.g., if planned delivery time is timestamp ‘2020-6-10 12:00:00.00’ and actual delivery time is timestamp ‘2020-6-10 12:10:00.00′, and x is interval ’15’ minute, then this delivery satisfies the condition.

create table G_emp

(eid int,

ename varchar(50),

primary key(eid));

insert into g_emp values(1, ‘Alice’);

insert into g_emp values(2, ‘David’);

insert into g_emp values(3, ‘Susan’);

insert into g_emp values(4, ‘Nathan’);

create table g_customer

(cid int,

cname varchar(50),

phone varchar(20),

address varchar(100),

zip varchar(10),

primary key (cid));

insert into g_customer values(1, ‘Nancy’, ‘1234567890’,’123 west springs drive, Ellicott City’, ‘21043’);

insert into g_customer values(2, ‘Ryan’, ‘2334561234’,’123 Hilltop Road’, ‘21022’);

insert into g_customer values(3, ‘Ann’,’7653451010′,’11110 Baltimore National Pike’, ‘21042’);

create table g_item

(iid int,

iname varchar(50),

unit varchar(20),

price number,

primary key(iid));

insert into g_item values(1,’egg’,’dozen’, 4.00);

insert into g_item values(2,’milk’,’gallon’, 4.50);

insert into g_item values(3, ‘ground beef’, ‘pound’, 3.50);

insert into g_item values(4,’chicken drum sticks’,’2 pound pack’,3.00);

insert into g_item values(5,’French bread’,’1 pack’,3.00);

create table g_order

(oid int,

cid int,

otime timestamp,

total number,

primary key(oid),

foreign key (cid) references g_customer);

insert into g_order values(1,1,timestamp ‘2020-6-2 11:00:00.00’, null);

insert into g_order values(2,1,timestamp ‘2020-6-3 16:00:00.00’, null);

insert into g_order values(3,2,timestamp ‘2020-6-4 20:00:00.00’, null);

insert into g_order values(4,3,timestamp ‘2020-6-4 21:00:00.00’, null);

create table g_order_line

(oid int,

iid int,

quantity number,

primary key(oid,iid),

foreign key(oid) references g_order,

foreign key(iid) references g_item);

— order 1, egg, milk, bread

insert into g_order_line values(1, 1, 2);

insert into g_order_line values(1, 2, 1);

insert into g_order_line values(1, 5, 2);

— order 2, beef and chicken

insert into g_order_line values(2, 3, 2);

insert into g_order_line values(2, 4, 2);

— order 3, milk, bread, chicken

insert into g_order_line values(3, 2, 2);

insert into g_order_line values(3, 4, 1);

insert into g_order_line values(3, 5, 2);

— order 4, milk, bread,

insert into g_order_line values(4, 2, 1);

insert into g_order_line values(4, 5, 2);

create table g_delivery

(did int,

oid int,

eid int,

planned_time timestamp,

actual_time timestamp,

primary key(did),

foreign key(oid) references g_order,

foreign key(eid) references g_emp);

— two delivery for order 1

insert into g_delivery values(1, 1, 1, timestamp ‘2020-6-3 11:00:00.00’, timestamp ‘2020-6-3 11:10:00.00’);

insert into g_delivery values(2, 1, 2, timestamp ‘2020-6-4 16:00:00.00’, timestamp ‘2020-6-4 15:50:00.00’);

— one delivery for order 2

insert into g_delivery values(3, 2, 1, timestamp ‘2020-6-4 15:00:00.00’, timestamp ‘2020-6-4 15:40:00.00’);

— two delivery for order 3

insert into g_delivery values(4, 3, 3, timestamp ‘2020-6-5 16:00:00.00’, timestamp ‘2020-6-5 16:10:00.00’);

insert into g_delivery values(5, 3, 2, timestamp ‘2020-6-6 14:00:00.00’, timestamp ‘2020-6-6 14:10:00.00’);

create table g_delivery_item

(did int,

iid int,

primary key(did, iid),

foreign key(did) references g_delivery,

foreign key(iid) references g_item);

insert into g_delivery_item values(1,1);

insert into g_delivery_item values(1,2);

insert into g_delivery_item values(2,5);

insert into g_delivery_item values(3,3);

insert into g_delivery_item values(3,4);

insert into g_delivery_item values(4,2);

insert into g_delivery_item values(4,4);

insert into g_delivery_item values(5,5); Q1.Write a PL/SQL procedure that given an order id, first check whether this order exists. If not, print an error message no such order. Then compute the total cost equals the sum of each item’s price * quantity in the order plus a 10% delivery fee. The procedure finally updates the g_order table to set the total column to the computed value (the initial total column has null value).

Q2.Write a PL/SQL procedure which takes a time interval x as input, and print out names of employees and IDs of deliveries whose actual delivery time is within plus or minus x of the planned delivery time. E.g., if planned delivery time is timestamp ‘2020-6-10 12:00:00.00’ and actual delivery time is timestamp ‘2020-6-10 12:10:00.00′, and x is interval ’15’ minute, then this delivery satisfies the condition.

create table G_emp

(eid int,

ename varchar(50),

primary key(eid));

insert into g_emp values(1, ‘Alice’);

insert into g_emp values(2, ‘David’);

insert into g_emp values(3, ‘Susan’);

insert into g_emp values(4, ‘Nathan’);

create table g_customer

(cid int,

cname varchar(50),

phone varchar(20),

address varchar(100),

zip varchar(10),

primary key (cid));

insert into g_customer values(1, ‘Nancy’, ‘1234567890’,’123 west springs drive, Ellicott City’, ‘21043’);

insert into g_customer values(2, ‘Ryan’, ‘2334561234’,’123 Hilltop Road’, ‘21022’);

insert into g_customer values(3, ‘Ann’,’7653451010′,’11110 Baltimore National Pike’, ‘21042’);

create table g_item

(iid int,

iname varchar(50),

unit varchar(20),

price number,

primary key(iid));

insert into g_item values(1,’egg’,’dozen’, 4.00);

insert into g_item values(2,’milk’,’gallon’, 4.50);

insert into g_item values(3, ‘ground beef’, ‘pound’, 3.50);

insert into g_item values(4,’chicken drum sticks’,’2 pound pack’,3.00);

insert into g_item values(5,’French bread’,’1 pack’,3.00);

create table g_order

(oid int,

cid int,

otime timestamp,

total number,

primary key(oid),

foreign key (cid) references g_customer);

insert into g_order values(1,1,timestamp ‘2020-6-2 11:00:00.00’, null);

insert into g_order values(2,1,timestamp ‘2020-6-3 16:00:00.00’, null);

insert into g_order values(3,2,timestamp ‘2020-6-4 20:00:00.00’, null);

insert into g_order values(4,3,timestamp ‘2020-6-4 21:00:00.00’, null);

create table g_order_line

(oid int,

iid int,

quantity number,

primary key(oid,iid),

foreign key(oid) references g_order,

foreign key(iid) references g_item);

— order 1, egg, milk, bread

insert into g_order_line values(1, 1, 2);

insert into g_order_line values(1, 2, 1);

insert into g_order_line values(1, 5, 2);

— order 2, beef and chicken

insert into g_order_line values(2, 3, 2);

insert into g_order_line values(2, 4, 2);

— order 3, milk, bread, chicken

insert into g_order_line values(3, 2, 2);

insert into g_order_line values(3, 4, 1);

insert into g_order_line values(3, 5, 2);

— order 4, milk, bread,

insert into g_order_line values(4, 2, 1);

insert into g_order_line values(4, 5, 2);

create table g_delivery

(did int,

oid int,

eid int,

planned_time timestamp,

actual_time timestamp,

primary key(did),

foreign key(oid) references g_order,

foreign key(eid) references g_emp);

— two delivery for order 1

insert into g_delivery values(1, 1, 1, timestamp ‘2020-6-3 11:00:00.00’, timestamp ‘2020-6-3 11:10:00.00’);

insert into g_delivery values(2, 1, 2, timestamp ‘2020-6-4 16:00:00.00’, timestamp ‘2020-6-4 15:50:00.00’);

— one delivery for order 2

insert into g_delivery values(3, 2, 1, timestamp ‘2020-6-4 15:00:00.00’, timestamp ‘2020-6-4 15:40:00.00’);

— two delivery for order 3

insert into g_delivery values(4, 3, 3, timestamp ‘2020-6-5 16:00:00.00’, timestamp ‘2020-6-5 16:10:00.00’);

insert into g_delivery values(5, 3, 2, timestamp ‘2020-6-6 14:00:00.00’, timestamp ‘2020-6-6 14:10:00.00’);

create table g_delivery_item

(did int,

iid int,

primary key(did, iid),

foreign key(did) references g_delivery,

foreign key(iid) references g_item);

insert into g_delivery_item values(1,1);

insert into g_delivery_item values(1,2);

insert into g_delivery_item values(2,5);

insert into g_delivery_item values(3,3);

insert into g_delivery_item values(3,4);

insert into g_delivery_item values(4,2);

insert into g_delivery_item values(4,4);

insert into g_delivery_item values(5,5);

Sample Solution

The post PL/SQL Stored Procedure appeared first on homework handlers.

The RN to BSN program

Describe the teaching experience and discuss your observations.
The RN to BSN program at Grand Canyon University meets the requirements for clinical competencies as defined by the Commission on Collegiate Nursing Education (CCNE) and the American Association of Colleges of Nursing (AACN), using nontraditional experiences for practicing nurses. These experiences come in the form of direct and indirect care experiences in which licensed nursing students engage in learning within the context of their hospital organization, specific care discipline, and local communities.

Note: This is an individual assignment. In 1,500-2,000 words, describe the teaching experience and discuss your observations. The written portion of this assignment should include:

Summary of teaching plan
Epidemiological rationale for topic
Evaluation of teaching experience
Community response to teaching
Areas of strengths and areas of improvement
Prepare this assignment according to the APA guidelines found in the APA Style Guide, located in the Student Success Center. An abstract is not required.

This assignment uses a rubric. Please review the rubric prior to beginning the assignment to become familiar with the expectations for successful completion.

Sample Solution

The post The RN to BSN program appeared first on homework handlers.

Managing a gelato franchise shop

A microentrepreneur decided to open a gelato franchise in a space in the corridor of a shopping center, allocating R $ 250,000.00 of own resources in this venture. The franchise, in kiosk format, has the price of your product fixed by the franchisor and presents the following cost structure:

explicit costs

fixed costs – rent and others

R $ 12,000.00

variable costs – four employees

R $ 1,500.00 per employee

variable costs – labor charges

37.5% on wages

variable costs – inputs, raw materials, etc.

R $ 19,000.00

implicit costs

owner’s salary, with charges

R $ 6,000.00

return on invested equity

1% per month

average price

R $ 15.00

estimated profit

8% of total costs

A. Calculate the amount of gelato that the kiosk must sell in order for the supernormal profit to be achieved:

A MONTH:

PER DAY:

B. Calculate the average cost (Cme), considering that the supernormal profit has been achieved.

C. Calculate the profit, assuming the supernormal profit has been achieved.

d. Calculate the profit margin, assuming that the supernormal profit has been achieved.

Admit that the owner decides to withdraw only 50% of his “market” salary.

E. Calculate the quantity of items to be sold so that the supernormal profit is achieved in this situation.

F. Calculate the average cost (Cme), considering the owner’s decision.

G. Calculate the profit, considering the owner’s decision.

H. Calculate the profit margin, assuming that the supernormal profit has been achieved.

i. Calculate the marginal cost (CMg) value.

Sample Solution

The post Managing a gelato franchise shop appeared first on homework handlers.

The current world situations.

ESSAY 2
Your thesis, and the bulk of your essay, will focus on the primary assigned reading (that is, the readings we did in class and for which you responded to the posted questions). Back up the promise of your thesis in the body of the essay with specific details/quotes from these primary readings. In general, the more specific your thesis and the examples, the stronger the essay will be.

Criteria for Essay 2

  1. Essay must be double-spaced, with one-inch margins, 12-point type, and Times New Roman or Ariel font
  2. Include a creative title
  3. Essay must at least 1500 words.
  4. This essay requires no outside sources (other than the literature we have read for the class). However, if you do choose to utilize outside sources in any way at all, make sure they are clearly identified in the body of the essay, and that you give full citations at the end of the essay.
  5. Use quotes! But not super long ones—don’t let them take over the essay! Set them up so they are in context (so we know who’s speaking, to whom, in what circumstances…) and explain them (make clear connection between the ideas in the quote and the main argument in your thesis).
  6. Please use language appropriate for college-level essays. No overly-conversational tones
  7. Please use proper spelling, grammar, citation—this definitely counts! Proofread!!!!

Essay Prompt:
Current Affairs
Choose three of the readings we have completed thus far (excluding the readings you chose for the first essay ).

Write an essay, which makes a claim (or claims) about any occurrences/situations that are currently making the news. Then, make an argument regarding each of your three readings, telling us where you see connections between the reading/character/scene… and in the current world situation(s). Note that you are not required to consult outside sources, as I’m more interested in your reading/analysis of the class readings. If you do use them (sparingly), however, please nee note above on referencing them.

Possible Organization:

  1. An intro, which begins by discussing the current world situations. Then, introduce the stories you’ve chosen to compare to that event (or those events), and conclude with a thesis that makes a specific claim regarding each of the stories and how they relate to the current world situation(s).
  2. In as many paragraphs as necessary, discuss your first story and its related current world situation. Using specific details (quotes, etc.) from the class reading, make a direct comparison to the situation in the world.
  3. Do the same for your second story.
  4. Do the same for your third story.
  5. A conclusion that ties together the main ideas of the essay.

Sample Solution

The post The current world situations. appeared first on homework handlers.