Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS403 Database Management Systems Assignment No. 04 Semester Spring 2011
#1
Assignment No. 04
Semester Spring2011
Database Management Systems-CS403
Total Marks: 15

Due Date: 20/06/2011

Objective:
To learn and understand basic concepts of SQL statements with the emphasis on “where” clause.
Instructions:
Please read the following instructions carefully before solving & submitting assignment:
It should be clear that your assignment will not get any credit (marks) if:

o The assignment is submitted after due date.
o The submitted assignment does not open or file corrupt.
o The submitted assignment is in the format other than MS Word (doc).
o The assignment is copied (from other student or copy from handouts).
o Student ID is not mentioned in the assignment File or name of file is other than student ID.




Q 1: Write SQL statements/queries to show the data for each of individual scenario given below from the given tables on the next page. 15 marks (3+3+3+3+3)



1. Show all the Category names with their Supplier names.


2. Show all the names of Products with their IDs.


3. Show all the products of “Bumper & Components” Category.


4. Show all the Product names and their Supplier names.


5. Show all those Product IDs supplied by “S & S corporations”.


“You will have to give the reason, If the query for any of above statement cannot execute”





Product
Product ID Product Name Category ID
PID-1 Bumper Cover CT-1
PID-2 Bumper CT-1
PID-3 Fender CT-2
PID-4 Mirrors CT-3
PID-5 Hood CT-4




Category
Category ID Category Name Supplier ID
CT-1 Bumper & Components SP-1
CT-2 Fenders & Components SP-2
CT-3 Mirrors & Components SP-2
CT-4 Hoods & Components SP-3




Supplier
Supplier ID Supplier Name
SP-1 S & S corporations
SP-2 AB Hardwares
SP-3 CG Brothers






Guidelines / Instructions
• Understand the scenario on the basis of given data only.
• Write only SQL statements, don’t show any data.


“Try to upload the assignment before BONUS day”









Attached Files
.zip   Spring 2011_CS403_4.zip (Size: 128.83 KB / Downloads: 349)

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply
#2
this is a assignment but not a idea solution
Reply
#3
Create table product (product_id varchar(10), product_name varchar(20) , category_id varchar(20) )

Create table category(category_id varchar(10), category_name varchar(20) , supplier_id varchar(20) )

Create table supplier(supplier_id varchar(10), supplier_name varchar(20) )

INSERT INTO `category` (`category_id`, `category_name`, `supplier_id`) VALUES
('CT-1', 'Bumper & Components', 'SP-1'),
('CT-2', 'Fenders & Components', 'SP-2'),
('CT-3', 'Mirrors & Components', 'SP-2'),
('CT-4', 'Hoods & Components', 'SP-3');

INSERT INTO `product` (`product_id`, `product_name`, `category_id`) VALUES
('PID-1', 'Bumper Cover', 'CT-1'),
('PID-2', 'Bumper', 'CT-1'),
('PID-3', 'Fender ', 'CT-2'),
('PID-4', 'Mirrors', 'CT-3'),
('PID-5', 'Hood', 'CT-4');

INSERT INTO `product` (`product_id`, `product_name`, `category_id`) VALUES
('PID-1', 'Bumper Cover', 'CT-1'),
('PID-2', 'Bumper', 'CT-1'),
('PID-3', 'Fender ', 'CT-2'),
('PID-4', 'Mirrors', 'CT-3'),
('PID-5', 'Hood', 'CT-4');


Above steps are not Required as part of assignment Its just for you to create and populate the table data to verify the commands

Show all the Category names with their Supplier names.
SELECT Category_Name, Supplier_Name
FROM Category, Supplier
WHERE category.supplier_id = supplier.supplier_id;



Show all the names of Products with their IDs.
SELECT Product_Name, Product_ID
FROM Product;

Show all the products of “Bumper & Components” Category.
SELECT product_name
FROM product, category
WHERE product.category_id = category.category_id
AND category_name = "Bumper & Components"


Show all the Product names and their Supplier names.
SELECT product_name, supplier_name
FROM product, category, supplier
WHERE product.category_id = category.category_id
AND category.supplier_id = supplier.supplier_id


Show all those Product IDs supplied by “S & S corporations”.
SELECT product_ID, supplier_name
FROM product, category, supplier
WHERE product.category_id = category.category_id
AND category.supplier_id = supplier.supplier_id
AND supplier_name = "S & S corporations"

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply
#4
ok thanks a lot
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  CS301 Assignment # 4 Due Date: 02-Feb-2016 Vuhelper 0 2,319 02-03-2016, 05:38 PM
Last Post: Vuhelper
  CS703 – Advanced Operating Systems Assignment No.3 solution January 2016 Vuhelper 0 5,904 01-23-2016, 09:58 PM
Last Post: Vuhelper
  CS601 Data Communication Assignment No. 03 Solution 23rd January 2016 Vuhelper 1 1,924 01-23-2016, 06:09 PM
Last Post: Vuhelper
  CS403 Assignment No. 03 Solution 23rd January 2016 Vuhelper 2 1,159 01-23-2016, 03:18 PM
Last Post: Vuhelper
  CS506 Web Design and Development Assignment no 3 Solution 3rd January 2016 Vuhelper 0 2,237 01-23-2016, 03:16 PM
Last Post: Vuhelper
  CS724 Software Process Improvement Assignment No 01 Solution 20th January 2016 Vuhelper 0 1,962 01-20-2016, 06:26 PM
Last Post: Vuhelper
  CS711 Software Design Assignment No 01 Solution Due Date Feb 12, 2016 Vuhelper 0 1,658 01-20-2016, 06:24 PM
Last Post: Vuhelper
  CS709 Formal Methods for Software Engineering Assignment No 01 Solution January 2016 Vuhelper 0 1,793 01-20-2016, 06:22 PM
Last Post: Vuhelper
  cs703 assignment no 3 Solution 20th January 2016 Vuhelper 0 1,695 01-20-2016, 06:20 PM
Last Post: Vuhelper
  CS704 Assignment No. 01 Solution January 2016 Vuhelper 0 4,794 01-20-2016, 06:19 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)