Professional Documents
Culture Documents
XII File Programmeidkdnd
XII File Programmeidkdnd
XII File Programmeidkdnd
Topic Question
1 Pattern Read a list and print as follows:
Let the list is [1,5,7,8]
Output:
1
55
777
8888
2 List Input a list of numbers and test if a number is equal to the sum of the cubes of its
digits. Find the smallest such numbers.
3 String Read a line and capitalize the first and last letter of each word.
8 Function 3 Define a function my_pow() with x and n as parameters. It calculates the value of
xn. In case of absence of the value of n during function call, instead of showing
error it will calculate the value of x2.
10 Function 5 Enter ten different numbers in a tuple. Pass the tuple to a function to arrange in
ascending order using bubble sort technique. Take necessary assumptions if
required.
11 Modules In the game of tossing a coin, you want to know the number of times you get
“Head” and “Tail”. You keep the record as “1” for getting “head” and “0” for
“Tail”. Write a programme to perform the above task assuming that you have
tossed a coin for 10 times in this game.
12 Exception Write a program to print the reciprocal of a number. Any kind of possible error
Handling should be handled.
3. To display the ItemNo of all items in the STOCK table in descending order of
quantity.
4. To insert a new record without UnitPrice and StockDate as follows :
(5010, ‘Classic Note Book’, 102, 120)
5. To display the name and unitprice of those items whose dealer code is 103 or
quantity in stock is more than 150 from STOCK table.
6. To display average UnitPrice of items for each dealer individually as per Dcode
from the STOCK table.
7. To add a new column Phone with 10 characters in Dealers table.
8. To display the Item No of those item names that contain ‘C/c’.
9. To display UnitPrice of Item No 5004 and 5005.
10. To create a view to store ItemNO, Qty and dealers name.
11. To increase the Qty of item Eraser by 10.
12. Remove the record of 5010.
Give the output of the following SQL queries :
13. Select Count(Distinct Dcode) From Stock;
14. Select Qty*Unitprice From Stock Where Stockdate=’01-Jan-09’;
15. Select Min(Stockdate) From Stock;