Get the step-by-step solution for this question inside the Vidyadip app.
Get the answer in the appGenerate a complete, print-ready paper with questions like this in minutes — across 16+ boards, with answer keys.
Answer the (a) and (b) on the basis of the following tables STORE and ITEM:
Table: STORE
| SNo | SName | AREA |
| S01 | ABC Computronics | GK II |
| S02 | All Infotech Media | CP |
| S03 | Tech Shoppe | Nehru Place |
| S05 | Hitech Tech Store | CP |
Table: ITEM
| INo | IName | Price | SNo |
| T01 | Mother Board | 12000 | S01 |
| T02 | Hard Disk | 5000 | S01 |
| T03 | Keyboard | 500 | S02 |
| T04 | Mouse | 300 | S01 |
| T05 | Mother Board | 13000 | S02 |
| T06 | Key Board | 400 | S03 |
| T07 | LCD | 6000 | S04 |
| T08 | LCD | 5500 | S05 |
| T09 | Mouse | 350 | S05 |
| T10 | Hard disk | 4500 | S03 |
(a) Write the SQL queries (1 to 4):
(i) To display IName and Price of all the items in the ascending order of their Price.
(ii) To display the SNo and SName or all stores located in CP.
(iii) To display the minimum and maximum price of each IName from the table Item.
(iv) To display the IName, price of all items and their respective SName where they are available.
(b) Write the output of the following SQL commands (i) to (iv):
(i) Select distinct iname from item where price >= 5000;
(ii) Select area, count(*) from store group by area;
(iii) Select count(distinct area) from store;
(iv) Select iname, price*0.05 discount from item where sno in (‘s02 ’, ‘s03 ’);
Write a script to create an empty list and then
(a) Input the names of 10 students and store them in the list using concatenation operator
(b) Display this list of names in reverse order
Write a program that accepts a comma separated sequence of words as input and prints the words in a comma-separated sequence after sorting them alphabetically.
Suppose the following input is supplied to the program:
hi,we,are,learning
Then, the output should be:
are,hi,learning,we