Home » SQL & PL/SQL » SQL & PL/SQL » help with pl/sql code
help with pl/sql code [message #183785] Sun, 23 July 2006 17:02 Go to next message
Sharaf
Messages: 62
Registered: September 2005
Location: U.K
Member
please I need help with this tables

i have a table called orderline and another one called stock

i have quantity as an attribute in my orderline table and i have price(unit.) in my stock table.

the problem is i want to be able to calculate the amount for multiple items (more than one quatity) and at the same time i want to calculate the total price for all items in the orderline.

I dont want to have both the amount and the total as attribute because they have to be derived.

Please how can i implement this.

orderline table
ordeline_id
stock_id
quantity
discount

stock table
stock_id
selling price

thanks

Re: help with pl/sql code [message #183786 is a reply to message #183785] Sun, 23 July 2006 17:23 Go to previous messageGo to next message
BlackSwan
Messages: 25037
Registered: January 2009
Location: SoCal
Senior Member
I'd like some clarification.
You are hoping/expecting us to to complete your homework assignment
so you avoid the problem of figuring out how to do it your self.
Why are you bothering to go to class anyways since you don't want to learn how to do this yourself?
Re: help with pl/sql code [message #183911 is a reply to message #183785] Mon, 24 July 2006 06:29 Go to previous message
JSI2001
Messages: 1016
Registered: March 2005
Location: Scotland
Senior Member
Sharaf, it has to be said, this does sound a bit like a homework assignment. We can and will help you, but you have to put in some effort. Show us that you have done at least some work.

1. Supply create table scripts.
2. Supply insert scripts to populate those tables.
3. Provide the code that you have tried.
4. Provide the expected output based on the sample data that you have provided in the insert scripts.
5. Provide any error messages or problems that you have incurred in you failed attempts to write the code.

Jim
Previous Topic: How I avoid the duplicate record and show only one record for every etudend from query
Next Topic: Getting a ranked element from an array
Goto Forum:
  


Current Time: Mon Dec 05 11:12:19 CST 2016

Total time taken to generate the page: 0.08367 seconds