Documente Academic
Documente Profesional
Documente Cultură
Table Description To Store the details about the Customers for the C
# Field Name Data Type Length Nullable
1 CustomerId Integer 4 No
2 CustomerName VarChar 50 No
3 CustomerAddress1 VarChar 50 No
4 CustomerAddress2 VarChar 50 Yes
5 CustomerAddress3 VarChar 50 Yes
6 CustomerCity VarChar 20 No
7 CustomerCreditLimit Money No
1 SalesRepresentativeId Integer 4 No
2 SalesRepresentativeName VarChar 50 No
3 SalesRepresentativeAddress1 VarChar 50 No
4 SalesRepresentativeAddress2 VarChar 50 Yes
5 SalesRepresentativeAddress3 VarChar 50 Yes
6 SalesRepresentativeCity VarChar 20 No
7 Incentive Bit 1 No
1 IncentiveSlabId Integer 4 No
2 Upto500 Money No
3 501to1000 Money No
4 1001to2500 Money No
5 2501to5000 Money No
6 5001andabove Money No
Table Name Products_T
Table Description To Store the details about the Products of the Com
# Field Name Data Type Length Nullable
1 ProductId Integer 4 No
2 ProductGroup VarChar 25 No
3 ProductDescription VarChar 50 No
4 StockInHand Numeric No
5 ReOrderLevel Numeric No
6 MSL(Maximum Stock Level) Numeric No
7 CostPrice
1 RateId Integer 4 No
2 ProductId Integer 4 No
3 UnitPrice Money No
1 OrderId Integer 4 No
2 OrderDate DateTime 8 No
3 SalesRepresentativeId Integer 4 No
4 CustomerId Integer 4 No
5 SalesValue Money No
6 InvoicedYN Bit 1 No
Table Name OrderDetais_T
Table Description To Store the Item details of the Order for the Com
# Field Name Data Type Length Nullable
1 OrderItemId Integer 4 No
2 OrderId Integer 4 No
3 ProductId Integer 4 No
4 Quantity Numeric No
5 RateId Integer 4 No
6 ItemValue Money No
s about the Customers for the Company/Organization
Constraints
ves_T
s about the Sales Representative for the Company/Organization
Constraints
Default Value - 0
s about the Incentive Slabs for the Sales Representative of the Company/Organization
Constraints
Default Value - 0
Default Value - 0
Default Value - 0
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Questions
Write a procedure to get the character as input parameter and Display the name starts with that character
Write a procedure to get the month as input parameter and display the sales value of that month as output parameter
Write a procedure to display the product where the stock in hand is below the reorder level
Write a procedure to display the profit while comparing to the previous year from the given year. (get the year as input paramet
Write a procedure to Display the count of sales representatives who get the <500,>500 to <1000, and more than 1000 as their
Write a procedure to get the product name as input parameter, Display the product description,rate and the number of custome
it
Write a procedure to get the customer name as input parameter and display the date and the Sales value of his purchases
Write a procedure to get the city as input parameter and display the Sales representative who belong to that city
Write a procedure to get the customer name and date. Display the corresponding itemname,Quantity and item value for his pur
particular date
Write a trigger to calculate the item value
Write a trigger to calculate the sales value by adding the item value of that particular order number
Write a trigger for order master table not to delete the value if it has the corresponding values in order details
Write a trigger for customer master table not to delete the value if it has the corresponding values in order master
Write a trigger for Sales Representative master table not to delete the value if it has the corresponding values in order master
Write a trigger to insert and update only non redundant product id in rate master.
Write a triger for customer master to not insert or update only non redundant data. Check the redundancy with the customer na
redundance occurs throw the error.
Write a triger for sales representative master to not insert or update only non redundant data. Check the redundancy with the s
name and address.
Write a cursor to display the ProductId,ProductGroup,ReorderStatus as 'Below the MSL' (stock in hand < msl) or 'Above the MS
msl )or 'Attained the MSL' (stock in hand = msl). And display the comments accordingly
Write a cursor to Display the product name and display the customer name and sales representative name who purchased tha
Write a cursor to check the number of products sold and increase the price based on the sales of a product
Display the customer name and Followed by the orderid, date,sales value and corresponding order details beneath it .
Write a cursor to display the sales rep name and His corresponding insentives based on the number of orders. (Incentive shou
on the incentive slab table and check whether that rep is capable of getting the incentive. Else don’t display their names)
Write a cursor to update the credit limit for the customer, based on number of times he/she purchased
Write a cursor to display the order id and the corresponding order details beneath it.
Write a cursor to display the product name and beneath it display the sum of quantities of that products sold each month