I have the following questions that i need the help of you guys to code in MS SQL:
Table Name: ABC
Order No. Product Quantity Price Date-Sold
A123 C0001 100 50.50 13-May-2008
A123 C0002 30 20.00 13-May-2008
A123 C0006 20 10.80 13-May-2008
A124 C0002 101 100.20 19-Jul-2008
A124 C0006 200 9.00 19-Jul-2008
A333 C0006 500 8.00 20-Aug-2008
(a) Create the above table defining the data type and length for each attribute.
(b) Add a new row of record for new order, product number C0002 and order number A124 and quantity 300 and date 30-Jan-2010.
(c) There is a change in quantity from 101 to 108 pieces and date sold from 19-Jul-2008 to 31-Dec-2010 for product number C0002 and order number A124.
(d) Retrieve all ABC table details where the quantity is over 100 and sort the records in descending order of quantity ordered.
Your help is greatly appreciated.
Table Name: ABC
Order No. Product Quantity Price Date-Sold
A123 C0001 100 50.50 13-May-2008
A123 C0002 30 20.00 13-May-2008
A123 C0006 20 10.80 13-May-2008
A124 C0002 101 100.20 19-Jul-2008
A124 C0006 200 9.00 19-Jul-2008
A333 C0006 500 8.00 20-Aug-2008
(a) Create the above table defining the data type and length for each attribute.
(b) Add a new row of record for new order, product number C0002 and order number A124 and quantity 300 and date 30-Jan-2010.
(c) There is a change in quantity from 101 to 108 pieces and date sold from 19-Jul-2008 to 31-Dec-2010 for product number C0002 and order number A124.
(d) Retrieve all ABC table details where the quantity is over 100 and sort the records in descending order of quantity ordered.
Your help is greatly appreciated.