<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[CS405 Assignment 2 Solution and Discussion]]></title><description><![CDATA[<pre><code>Assignment No. 02
</code></pre>
<p dir="auto">SEMESTER Fall 2019<br />
CS405- Database Programming Using Oracle 11g	Total Marks: 20<br />
Due Date: 29-11-19</p>
<p dir="auto">Objective:<br />
The assignment has been designed to enhance your knowledge about how to use / do:<br />
•	Subqueries in SQL<br />
•	SELECT INTO IN PL/SQL<br />
•	Implementing SELECT INTO<br />
•	DML in PL/SQL<br />
•	Implementing DML &amp; SQL into PL/SQL<br />
Instructions:<br />
Please read the note section and following instructions carefully before solving &amp; submitting assignment:</p>
<ol>
<li>The assignment will not be accepted after due date.</li>
<li>Assignment will not be accepted via email.</li>
<li>Zero marks will be awarded to the assignment that does not open or the file is corrupt.</li>
<li>The assignment file must be in MS word (.doc) file format; Assignment will not be accepted in any other format.</li>
<li>Zero marks will be awarded to the assignment if copied (from other student or copied from handouts or internet).</li>
</ol>
<p dir="auto">For any query about the assignment, contact at <a href="mailto:cs405@vu.edu.pk" target="_blank" rel="noopener noreferrer nofollow ugc">cs405@vu.edu.pk</a></p>
<pre><code>Marks: 20  
</code></pre>
<p dir="auto">Consider the following tables containing columns to answer the questions:<br />
SALESRESP (empl_num, name, age, designation, city, quota, joining_date, sal, commision)<br />
OFFICES (office_id, city, region, mgr, target, sales)</p>
<p dir="auto">Question 1:                                                    [Screenshot = 5 Marks, Code = 5 Marks]<br />
Write a SQL query to list the sales representatives, whose “quota” are equal to or higher than the “target” of the “Lahore” sales office.</p>
<p dir="auto">Question 2:                                                                 [Screenshot = 5 Marks, Code = 5 Marks]<br />
Write a PL/SQL block to decrease commission by 1% of all those sales representatives who have been working in the organization for less than two years and their salary is greater than 50,000.<br />
Lectures Covered: This assignment covers WEEK#  4-5<br />
Note: You are required to paste code and screenshots of your programs in a Word File,  and submit that file on or before November 29, 2019<br />
GOOD LUCK</p>
]]></description><link>https://community.secnto.com//topic/1120/cs405-assignment-2-solution-and-discussion</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 20:00:25 GMT</lastBuildDate><atom:link href="https://community.secnto.com//topic/1120.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 22 Jan 2020 09:25:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CS405 Assignment 2 Solution and Discussion on Wed, 22 Jan 2020 09:27:17 GMT]]></title><description><![CDATA[<p dir="auto"><strong>100% Solved:</strong><br />
<strong>Q.1 Solution</strong></p>
<pre><code>SELECT NAME FROM 
SALESRESP  
WHERE QUOTA &gt;= 
(SELECT TARGET  FROM OFFICES  WHERE CITY = 'LAHORE')
</code></pre>
<p dir="auto"><strong>Q.2 Solution</strong></p>
<pre><code>DECLARE
eno salesresp.empl_num%type; 
commission salesresp.commision%type; 
update_commision number(10):=0; 
BEGIN 
Select empl_num, commision from SALESRESP where months_between(sysdate, joining_date) &lt; 24 AND sal &gt; 50000; 
update_commision:=commission-commision*0.01;
update salesresp set commission = update_commision;
dbms_output.put_line('Updated Commision ' || commision);
END;
</code></pre>
]]></description><link>https://community.secnto.com//post/2976</link><guid isPermaLink="true">https://community.secnto.com//post/2976</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Wed, 22 Jan 2020 09:27:17 GMT</pubDate></item></channel></rss>