A Gift Gallery has different stores in India. Database Administrator Abhay wants to maintain database of their Salesmen in SQL to store the data, He has decided that
Name of the database: Gift Gallery
Name of the table: Salesman
Attributes of the tables: Scode – Numeric, Sname – Character 25, Address - Character 25, Do join - Date, Sales – Numeric and Area – Character 10
Consider the following records in ‘Salesman’ table and answer the given questions:
Table : Salesman
Scode |
Sname |
Address |
Dojoin |
Sales |
Area |
100 |
Amit |
Delhi |
2017/09/29 |
5000.90 |
East |
101 |
Sushant |
Gurgaon |
2018/01/01 |
7000.75 |
East |
102 |
Priya |
Noida |
2018/04/25 |
3450.45 |
West |
103 |
Mohit |
Delhi |
2018/11/03 |
6000.50 |
North |
104 |
Priyanshi |
Delhi |
2019/12/15 |
8000.62 |
North |
i. State the command that will give the output as :
a. Select Sname from Salesman Where Not Address =”Delhi”;
b. Select Sname from Salesman Where Address NOT IN(“Delhi”);
c. Select Sname from Salesman Where Address !=“Delhi”;
d. All of the above;
ii. Which of the following commands will display the details of all sales record of North Area, regardless of case (whether North / NORTH / north):
a. Select * from salesman where area like upper ‘north’;
b. Select * from salesman where area = ‘North’ or ‘NORTH’ or north;
c. Select * from salesman where upper(area)=’NORTH’;
d. Select * from salesman where area= =upper(’North”)’;
iii. Help Priya to display sname and sales of east and west areas
a. Select sname, sales from Salesman where area=”East” and area=”West”;
b. Select sname, sales from Salesman where area=”East” or area=”West”;
c. Select sname, sales from Salesman where area in ”East” and ”West”;
d. Select sname, sales from Salesman where area=”East” , ”West”;
iv. The command to display the name of the salesman along with the sales amount rounded off to one decimal point will be:
a. Select sname, round(sales,1) from salesman;
b. Select sname, round(sales,0.1) from salesman;
c. Select sname, trunc(sales,1) from salesman;
d. Select sname, trunc(sales,0.1) from salesman;
v. What will be the output of the following command?
Select Right(Sname,3), Round(Sales) from Salesman Where Sname Like “P%”;
a.
Right(Sname,3) |
Round(Sales) |
Pri |
3450 |
Pri |
8000 |
b.
Right(Sname,3) |
Round(Sales) |
iya |
3450 |
shi |
8000 |
c.
Right(Sname,3) |
Round(Sales) |
iya |
3450 |
shi |
8001 |
d.
Right(Sname,3) |
Round(Sales) |
Pri |
3450 |
Pri |
8001 |