SQL
SQL
Table – 2 : Product_master
Column Name Data Type Size
Product_no Varchar 6
Description Varchar 15
P_percent Numeric 4,2
U_measure Varchar 10
Qty_on_hand Numeric 8
Reorder_lvl Numeric 8
Sell_price Numeric 8,2
Cost_price Numeric 8,2
Table – 3 : Salesman_master
Column Name Data Type Size
S_no Varchar 6
S_name Varchar 20
City Varchar 20
Pincode Numeric 8
State Varchar 20
Sal_amt Numeric 8,2
Tgt_to_get Numeric 6,2
Ytd_sales Numeric 6,2
remarks Varchar 12
Table – 4 : Sales_order
Column Name Data Type Size
Order_no Varchar 6
Order_date Date
Client_no Varchar 6
S_no Varchar 6
Dely_type Char 1
Billed_yn Char 1
Dely_date Date
Order_status Varchar 10
6) Find the names of the salesman who have a salary equal to Rs. 3000
7) Delete from client_master where the column state holds the value ‘Tamil Nadu’.
10) Rename column telephone to new name as contact for client_master table.
11) Find the name of all clients having ‘a’ as the second letter in their names.
12) Find products whose selling price is greater than 2000 and less than or equal to
5000.
13) Determine the maximum and minimum product prices. Rename the output as
max_price and min_price respectively.
14) Change the city of client_no’C002’ to ‘Bombay’.
19) Find out the name of city whose second last character is ‘a’.
20) Find products whose selling price is more than 1500. Calculate a new selling price
as, original selling price * .15. Rename the new column in the above query as
new_price.