Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id C73241336FA7 for ; Tue, 14 Dec 2010 12:23:47 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 98991-10 for ; Tue, 14 Dec 2010 16:23:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-px0-f174.google.com (mail-px0-f174.google.com [209.85.212.174]) by mail.postgresql.org (Postfix) with ESMTP id 6C9951337BC4 for ; Tue, 14 Dec 2010 12:23:40 -0400 (AST) Received: by pxi15 with SMTP id 15so159303pxi.33 for ; Tue, 14 Dec 2010 08:23:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=N+xPL4N5GH4qjB11SiPQynYTo4AjvttjY/zm6JhH9PM=; b=wQZWUvO4+6r6C+q5FCWd5uGnNyJFE8/1B//h3KIP3pTpEQUc7qonP403399kOYUN+0 Kcj3ryb9LXM+3/VtX7uDAz+wmgFdV1MzZbN+tSwfM94iMZHg2xC6SHFZ6/CfFNDf3IFJ ohzLuQFNKpH1frhw9Ids7y673eVkcAiZgsjiQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=nU10r37GHT/D3YTa8LE9IuAkXvDY0GgTlC0omhgfm7imh34KpH4xayiniF4wbK68h7 jVyk6NCLxIgwJ+GskhJQ98OLLfNvkqizWw7fKJHJOMaPCVZJi72bhPkRva/yUGx9IP9T ObCrk8IVCpZm/fdxb+S5ioSG6eFHyKcNk2xzc= Received: by 10.142.128.2 with SMTP id a2mr4543758wfd.386.1292343819538; Tue, 14 Dec 2010 08:23:39 -0800 (PST) Received: from [192.168.113.2] ([208.187.158.94]) by mx.google.com with ESMTPS id b11sm268305wff.21.2010.12.14.08.23.31 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 14 Dec 2010 08:23:33 -0800 (PST) Message-ID: <4D0799F7.9050206@gmail.com> Date: Tue, 14 Dec 2010 09:23:19 -0700 From: Rob Sargent User-Agent: Thunderbird 2.0.0.24 (X11/20101027) MIME-Version: 1.0 To: emaratiyya CC: pgsql-sql@postgresql.org Subject: Re: Using count on a join, group by required? References: <1292311156150-3304147.post@n5.nabble.com> In-Reply-To: <1292311156150-3304147.post@n5.nabble.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7 X-Spam-Level: X-Archive-Number: 201012/69 X-Sequence-Number: 34905 Shouldn't you be doing your own homework? emaratiyya wrote: > Hi,Please help me solving this problem. I appreciate..Thankyou. > > Create the following table and insert few arbitrary records. > Product (product_id, product_name, supplier_name, quantity, price_per_unit) > You are required to create PL/SQL package that achieves the following > functionalities: > > • Obtaining the product supplier name by using the product_id > • Changing the price_per_unit by using the product_id > • When changing the price of the product, you have to have PL/SQL code that > keeps the history of the prices. For this functionality you need to create > audit table: product_audit(product_id, old_price, new_price, date_of_change) > • Updating the quantity by using the product_id > • Get warning when the product level of stock (quantity) goes below certain > threshold (e.g. 10) > >