<?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[CS403 Assignment 2 Solution and Discussion]]></title><description><![CDATA[<p dir="auto">EDU302 	Assignment No. 02<br />
SEMESTER Spring 2019<br />
CS403- Database Management System	<br />
Total Marks: 20</p>
<p dir="auto">Due Date: 02/12/2019<br />
Instructions<br />
Please read the following instructions carefully before solving &amp; submitting assignment:<br />
It should be clear that your assignment will not get any credit  if:<br />
•	The assignment is submitted after due date.<br />
•	The submitted assignment does not open or file corrupt.<br />
•	The assignment is full or partially copied from (other student or ditto copy from handouts or internet).<br />
•	Student ID is not mentioned in the assignment File or name of file is other than student ID.<br />
•	The assignment is not submitted in .doc or .docx format.<br />
Uploading instructions<br />
Your submission must include:</p>
<p dir="auto">•	Assignment should be in .doc or .docx format.<br />
•	Save your assignment with your ID (e.g. bx020200786.doc).<br />
•	Assignment submission through email is NOT acceptable.<br />
Objectives<br />
Objectives<br />
The objective of this assignment is to able the Students:<br />
•	To understand the relational database model<br />
•	To understand the Conversion of ERD into relational data model<br />
•	To understand the Cartesian product of two relations<br />
•	To understand the degree and cardinalities of relations</p>
<p dir="auto">Note:<br />
Your answer must follow the below given specifications.<br />
•	 Font style: “Times New Roman”<br />
•	 Font color: “Black”<br />
•	 Font size: “12”<br />
•	 Bold for heading only.<br />
•	 Font in Italic is not allowed at all.<br />
•	 No formatting or bullets are allowed to use.<br />
•	Your answer should be precise and to the point, avoid irrelevant detail.</p>
<p dir="auto">Lectures Covered: This assignment covers Lecture # 10 - 17<br />
Deadline<br />
Your assignment must be uploaded/submitted on or before 02/12/2019.</p>
<p dir="auto">Question  Statement</p>
<p dir="auto">Our second assignment is the continuation of the first assignment. In the first assignment an ERD was required for the given scenario, which is given below:<br />
<img src="https://i.imgur.com/RN2Q5Ix.png" alt="262aed16-698e-443d-a680-5959bf8d3808-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">You’re required to perform the following tasks:</p>
<ol>
<li>Convert the above Entity Relationship Diagram into Relational data model.</li>
</ol>
<p dir="auto">You have to convert all the components of the ERD into Relational Data model.</p>
<ol start="2">
<li>Consider the following two tables:</li>
</ol>
<p dir="auto">Order:</p>
<p dir="auto">order_id	order_status	delivery_date	btag_no	cust_id	sman_id<br />
od001	Completed	10/30/2019	bt001	cust001	sm001<br />
od002	Completed	10/30/2019	bt002	cust002	sm001<br />
od003	Completed	10/30/2019	bt003	cust003	sm001</p>
<p dir="auto">Bill:<br />
bill_id	cust_id	order_id	net_amount<br />
b001	cust001	od001	500<br />
b002	cust002	od002	550<br />
b003	cust001	od003	600</p>
<p dir="auto">And write the output of the following relational algebra operations:</p>
<p dir="auto">•	∏  order_id, cust_id, sman_id (Order)<br />
•	σ net_amount &gt; 500 (Bill)<br />
•	∏ order_status, delivery_date (σ btag_no= ‘bt002’ (Order))</p>
<ol start="3">
<li>Find the degree and cardinality of the relations (Order and Bill) given in the 2nd question.</li>
</ol>
<p dir="auto">====================================Ended=======================================</p>
<p dir="auto">For any query about the assignment, contact at <a href="mailto:CS403@vu.edu.pk" target="_blank" rel="noopener noreferrer nofollow ugc">CS403@vu.edu.pk</a></p>
<p dir="auto">GOOD LUCK</p>
]]></description><link>https://community.secnto.com//topic/713/cs403-assignment-2-solution-and-discussion</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 20:45:46 GMT</lastBuildDate><atom:link href="https://community.secnto.com//topic/713.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 29 Nov 2019 14:59:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CS403 Assignment 2 Solution and Discussion on Tue, 21 Jan 2020 11:43:31 GMT]]></title><description><![CDATA[<p dir="auto">You have to convert all the components of the ERD into Relational Data model.</p>
<p dir="auto"><strong>Solution:</strong><br />
Customer(Customer_ID, Name, Address, Contact_No, email)<br />
Order(Order_ID, Order_Status, Delivery_Date,  Customer_ID, Manager_ID,Sman_ID)<br />
Bill(Bill_ID, Order_ID, Amount, date)<br />
Bottle(Bottle_Tag_No, Fillling_Date, Expiry_Date, Capacity, Order_ID)<br />
Manager(Manager_ID, Name, Address)<br />
Salesman(Sman_ID, Name, Contact_No)<br />
SalesArea(Area_ID, Area_Name, Sman_ID)</p>
<ol start="2">
<li>Consider the following two tables:</li>
</ol>
<p dir="auto">Order:</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>order_id</th>
<th>order_status</th>
<th>delivery_date</th>
<th>btag_no</th>
<th>cust_id</th>
<th>sman_id</th>
</tr>
</thead>
<tbody>
<tr>
<td>od001</td>
<td>Completed</td>
<td>10/30/2019</td>
<td>bt001</td>
<td>cust001</td>
<td>sm001</td>
</tr>
<tr>
<td>od002</td>
<td>Completed</td>
<td>10/30/2019</td>
<td>bt002</td>
<td>cust002</td>
<td>sm001</td>
</tr>
<tr>
<td>od003</td>
<td>Completed</td>
<td>10/30/2019</td>
<td>bt003</td>
<td>cust003</td>
<td>sm001</td>
</tr>
</tbody>
</table>
<p dir="auto">Bill:</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>bill_id</th>
<th>cust_id</th>
<th>order_id</th>
<th>net_amount</th>
</tr>
</thead>
<tbody>
<tr>
<td>b001</td>
<td>cust001</td>
<td>od001</td>
<td>500</td>
</tr>
<tr>
<td>b002</td>
<td>cust002</td>
<td>od002</td>
<td>550</td>
</tr>
<tr>
<td>b003</td>
<td>cust001</td>
<td>od003</td>
<td>600</td>
</tr>
</tbody>
</table>
<p dir="auto">And write the output of the following relational algebra operations:</p>
<p dir="auto">•	∏  order_id, cust_id, sman_id (Order)</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>order_id</th>
<th>cust_id</th>
<th>sman_id</th>
</tr>
</thead>
<tbody>
<tr>
<td>od001</td>
<td>cust001</td>
<td>sm001</td>
</tr>
<tr>
<td>od002</td>
<td>cust002</td>
<td>sm001</td>
</tr>
<tr>
<td>od003</td>
<td>cust003</td>
<td>sm001</td>
</tr>
</tbody>
</table>
<p dir="auto">•	σ net_amount &gt; 500 (Bill)</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>bill_id</th>
<th>cust_id</th>
<th>order_id</th>
<th>net_amount</th>
</tr>
</thead>
<tbody>
<tr>
<td>b002</td>
<td>cust002</td>
<td>od002</td>
<td>550</td>
</tr>
<tr>
<td>b003</td>
<td>cust001</td>
<td>od003</td>
<td>600</td>
</tr>
</tbody>
</table>
<p dir="auto">•	∏ order_status, delivery_date, (σ btag_no=’bt002’ (Order))</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>order_status</th>
<th>delivery_date</th>
</tr>
</thead>
<tbody>
<tr>
<td>Completed</td>
<td>10/30/2019</td>
</tr>
</tbody>
</table>
<ol start="3">
<li>Find the degree and cardinality of the relations (Order and Bill) given in the 2nd question.</li>
</ol>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Table</th>
<th>Degree</th>
<th>Cardinality</th>
</tr>
</thead>
<tbody>
<tr>
<td>Order</td>
<td>6</td>
<td>3</td>
</tr>
<tr>
<td>Bill</td>
<td>4</td>
<td>3</td>
</tr>
</tbody>
</table>
]]></description><link>https://community.secnto.com//post/2044</link><guid isPermaLink="true">https://community.secnto.com//post/2044</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Tue, 21 Jan 2020 11:43:31 GMT</pubDate></item><item><title><![CDATA[Reply to CS403 Assignment 2 Solution and Discussion on Tue, 03 Dec 2019 11:27:14 GMT]]></title><description><![CDATA[<p dir="auto">Idea Solution from book<br />
<img src="https://i.imgur.com/kSPj4KH.png" alt="e003ca23-416d-440a-a397-af7c0e8b7c3a-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.secnto.com//post/2114</link><guid isPermaLink="true">https://community.secnto.com//post/2114</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Tue, 03 Dec 2019 11:27:14 GMT</pubDate></item><item><title><![CDATA[Reply to CS403 Assignment 2 Solution and Discussion on Tue, 03 Dec 2019 11:25:21 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://youtu.be/KfQyg2AX1Uc" target="_blank" rel="noopener noreferrer nofollow ugc">https://youtu.be/KfQyg2AX1Uc</a></p>
]]></description><link>https://community.secnto.com//post/2113</link><guid isPermaLink="true">https://community.secnto.com//post/2113</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Tue, 03 Dec 2019 11:25:21 GMT</pubDate></item><item><title><![CDATA[Reply to CS403 Assignment 2 Solution and Discussion on Tue, 03 Dec 2019 11:25:00 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://youtu.be/Lteyheg2l6o" target="_blank" rel="noopener noreferrer nofollow ugc">https://youtu.be/Lteyheg2l6o</a></p>
]]></description><link>https://community.secnto.com//post/2112</link><guid isPermaLink="true">https://community.secnto.com//post/2112</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Tue, 03 Dec 2019 11:25:00 GMT</pubDate></item><item><title><![CDATA[Reply to CS403 Assignment 2 Solution and Discussion on Tue, 03 Dec 2019 11:22:50 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://www.youtube.com/watch?v=tzwlHKnRqYc" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.youtube.com/watch?v=tzwlHKnRqYc</a></p>
]]></description><link>https://community.secnto.com//post/2111</link><guid isPermaLink="true">https://community.secnto.com//post/2111</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Tue, 03 Dec 2019 11:22:50 GMT</pubDate></item><item><title><![CDATA[Reply to CS403 Assignment 2 Solution and Discussion on Tue, 21 Jan 2020 11:43:31 GMT]]></title><description><![CDATA[<p dir="auto">You have to convert all the components of the ERD into Relational Data model.</p>
<p dir="auto"><strong>Solution:</strong><br />
Customer(Customer_ID, Name, Address, Contact_No, email)<br />
Order(Order_ID, Order_Status, Delivery_Date,  Customer_ID, Manager_ID,Sman_ID)<br />
Bill(Bill_ID, Order_ID, Amount, date)<br />
Bottle(Bottle_Tag_No, Fillling_Date, Expiry_Date, Capacity, Order_ID)<br />
Manager(Manager_ID, Name, Address)<br />
Salesman(Sman_ID, Name, Contact_No)<br />
SalesArea(Area_ID, Area_Name, Sman_ID)</p>
<ol start="2">
<li>Consider the following two tables:</li>
</ol>
<p dir="auto">Order:</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>order_id</th>
<th>order_status</th>
<th>delivery_date</th>
<th>btag_no</th>
<th>cust_id</th>
<th>sman_id</th>
</tr>
</thead>
<tbody>
<tr>
<td>od001</td>
<td>Completed</td>
<td>10/30/2019</td>
<td>bt001</td>
<td>cust001</td>
<td>sm001</td>
</tr>
<tr>
<td>od002</td>
<td>Completed</td>
<td>10/30/2019</td>
<td>bt002</td>
<td>cust002</td>
<td>sm001</td>
</tr>
<tr>
<td>od003</td>
<td>Completed</td>
<td>10/30/2019</td>
<td>bt003</td>
<td>cust003</td>
<td>sm001</td>
</tr>
</tbody>
</table>
<p dir="auto">Bill:</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>bill_id</th>
<th>cust_id</th>
<th>order_id</th>
<th>net_amount</th>
</tr>
</thead>
<tbody>
<tr>
<td>b001</td>
<td>cust001</td>
<td>od001</td>
<td>500</td>
</tr>
<tr>
<td>b002</td>
<td>cust002</td>
<td>od002</td>
<td>550</td>
</tr>
<tr>
<td>b003</td>
<td>cust001</td>
<td>od003</td>
<td>600</td>
</tr>
</tbody>
</table>
<p dir="auto">And write the output of the following relational algebra operations:</p>
<p dir="auto">•	∏  order_id, cust_id, sman_id (Order)</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>order_id</th>
<th>cust_id</th>
<th>sman_id</th>
</tr>
</thead>
<tbody>
<tr>
<td>od001</td>
<td>cust001</td>
<td>sm001</td>
</tr>
<tr>
<td>od002</td>
<td>cust002</td>
<td>sm001</td>
</tr>
<tr>
<td>od003</td>
<td>cust003</td>
<td>sm001</td>
</tr>
</tbody>
</table>
<p dir="auto">•	σ net_amount &gt; 500 (Bill)</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>bill_id</th>
<th>cust_id</th>
<th>order_id</th>
<th>net_amount</th>
</tr>
</thead>
<tbody>
<tr>
<td>b002</td>
<td>cust002</td>
<td>od002</td>
<td>550</td>
</tr>
<tr>
<td>b003</td>
<td>cust001</td>
<td>od003</td>
<td>600</td>
</tr>
</tbody>
</table>
<p dir="auto">•	∏ order_status, delivery_date, (σ btag_no=’bt002’ (Order))</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>order_status</th>
<th>delivery_date</th>
</tr>
</thead>
<tbody>
<tr>
<td>Completed</td>
<td>10/30/2019</td>
</tr>
</tbody>
</table>
<ol start="3">
<li>Find the degree and cardinality of the relations (Order and Bill) given in the 2nd question.</li>
</ol>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Table</th>
<th>Degree</th>
<th>Cardinality</th>
</tr>
</thead>
<tbody>
<tr>
<td>Order</td>
<td>6</td>
<td>3</td>
</tr>
<tr>
<td>Bill</td>
<td>4</td>
<td>3</td>
</tr>
</tbody>
</table>
]]></description><link>https://community.secnto.com//post/2044</link><guid isPermaLink="true">https://community.secnto.com//post/2044</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Tue, 21 Jan 2020 11:43:31 GMT</pubDate></item><item><title><![CDATA[Reply to CS403 Assignment 2 Solution and Discussion on Tue, 21 Jan 2020 11:37:10 GMT]]></title><description><![CDATA[<p dir="auto"><a href="/assets/uploads/files/1575040096936-fall-2019_cs403_2_sol.docx">Fall 2019_CS403_2_SOL.docx</a></p>
<p dir="auto"><img src="https://i.imgur.com/pkbI0dq.png" alt="30c67624-0f8f-4e9e-a873-7569122d5280-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="https://i.imgur.com/oDjKLYv.png" alt="d82ce349-489c-4700-b32b-fc0b41809b24-image.png" class=" img-fluid img-markdown" /><br />
Question No 2:<br />
Order:<br />
order_id	order_status	delivery_date	btag_no	cust_id	sman_id<br />
od001	Completed	10/30/2019	bt001	cust001	sm001<br />
od002	Completed	10/30/2019	bt002	cust002	sm001<br />
od003	Completed	10/30/2019	bt003	cust003	sm001<br />
Bill:<br />
bill_id	cust_id	order_id	net_amount<br />
b001	cust001	od001	500<br />
b002	cust002	od002	550<br />
b003	cust001	od003	600</p>
<p dir="auto">And write the output of the following relational algebra operations:<br />
•	∏  order_id, cust_id, sman_id (Order)<br />
•	<br />
∏ Operator name is projection this is used to select all the colum in the table<br />
It will select three colums, order_id, sman_id and cust_id. It also delete the unwanted colums on the basis of condition<br />
•	σ net_amount &gt; 500 (Bill)<br />
σ is used for selection. it select the subset of rows from table answer will be second and third row from bill table  answer will be (550,600)<br />
•	∏ order_status, delivery_date (σ btag_no= ‘bt002’ (Order))<br />
In this it will first perform the selection and select the btag no row from order table then projection will be performed and in projection it will selct the colum order-status value and delivery date value where btag no is bt002.<br />
Answer will be              order status    delivery date<br />
Completed      10/30/2019</p>
<p dir="auto">Question no 3:</p>
<ol>
<li>Find the degree and cardinality of the relations (Order and Bill) given in the 2nd question.<br />
(a)<br />
Degree = number of attributes or colums in the table is his degree<br />
Order table have 6 colums/attributes so its degree will be 6<br />
Bill table have 4 colums/attributes so its degree will be 4<br />
Degree of the (Order and Bill) will be<br />
Degree -&gt; 6+4=10<br />
(b)<br />
Cardinality = numbers of tuples/rows in the table<br />
Number of rows in order table = 3<br />
Number of rows in bill table =3<br />
Cardinality of order and bill (rows<em>rows)<br />
Cardinality -&gt; 3</em>3 =9</li>
</ol>
]]></description><link>https://community.secnto.com//post/2043</link><guid isPermaLink="true">https://community.secnto.com//post/2043</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Tue, 21 Jan 2020 11:37:10 GMT</pubDate></item></channel></rss>