XII_record programs
XII_record programs
EX.NO QUESTIONS
1 LIST MANIPULATION
Write a menu driven program to do the following functions in a list of integers
in ascending order.
• Add element
• Delete element
• Display in ascending order
• Display in descending order
• Display Reverse of elements
• Display list
2 WORD CHAIN
Write a function to check if the given string forms a word chain or not.
OUTPUT:
3 ACROUSTIC
Write a function to check if the given list of words is acroustic.
EXAMPLE:
OUTPUT:
4 STRING MANIPULATION
Write a program to do the following functions with a given sentence
• Display reverse of each word
• Display number of lowercase and uppercase characters.
• Display palindrome words.
5 STRING ALTERATION
Write a program to do the following functions with a given string
• Display the first largest and second largest word
• Display the first smallest and second smallest word
• Display the reverse of sentence
• Convert all words to title case
• Display words starting with the given character
• Exit
6 DICTIONARIES
Write a menu driven program using dictionary to do the following functions
[key:name, value:age]
• Add element
• Search by name
• Edit by name
• Delete element
• Display average age
7 NESTED TUPLES
Write a function to calculate the average of numbers from a given tuple of
tuples.
Example:
If the tuple is ((1,2,3),(2,3,4),(4,5,6)
Average of (1,2,3) is 2.0
Average of (2,3,4) is 3.0
Average of (4,5,6) is 5.0
8 NESTED LISTS
Write a program to create a nested list with [rollno, name, phoneno, email] and
do the following functions
• Search by roll
• Display details of names starting with “A” and “S”
9 TEXT FILE HANDLING - I
Write a program to write 5 proverbs in a text file and write only the lines
starting with a given word in another text file.
OUTPUT:
10 TEXT FILE HANDLING - II
Write a program to do the following in a text file
• Append a line
• Display number of words, characters and lines
• Edit a line
• Delete a line
• Display file content
OUTPUT:
16 IMPLEMENTATION OF STACKS
Write a menu driven program to do the following functions in a stack with
structure [flightno, flightname]
• Push
• Pop
• Traverse
• Peek
17 IMPLEMENTATION OF QUEUES
Write a menu driven program to perform the following functions in a queue
with structure [empno, empname]
• Enqueue
• Dequeue
• Peek
• Traverse
18 DDL COMMANDS
Write DDL Commands to
1) Create a table with following columns
1) Acno – int(6)
2) Acname – char(15)
3) Actype – char(15)
4) Bal – int(9)
2) Show structure of table
3) Add a column Remarks with char(40)
4) Rename column Actype to Account_type
5) Remove column Remarks
6) Increase width of Acname to 30 characters.
19 DML COMMANDS
Write DML commands to
1) Create a table with the following columns Acno, Acname, Acbalance,
Actype and Area.
2) Update balance of all account holders by Rs. 2000
3) Change the name of one account holder
4) Change Actype of any account holder to RD
5) Change balance of one Acno to 60000 and Area to “Velachery”
6) Remove one account holders details
7) Remove one record with Acname as criteria
8) Display Acno, Acname of SB accounts
9) Display details of accounts with balance in range 15000 to 1Lakh
10) Display details of all account holders in area “ Adyar ”
11) Display details of all account holders whose name ends with “r”.
12) Display distinct area.
13) Display name, Actype, balance in ascending order by balance.
14) Display account holder name and area in alphabetical order by name.
20 AGGREGATE FUNCTIONS
1) Display the number of accounts in each account type.
2) Find the maximum and minimum balance in each area.
3) Find the average balance of SB accounts
4) Find the total balance of accounts in “Chennai”
5) Find the average balance amount of SB and FD accounts.
6) Find the number of account holders with balance more than 1 lakh in each
area.
7) Find the average balance of each account holder type with more than one
account holder.
21 CONSTRAINS AND GENERAL CALCULATIONS
1) Create a table students with fields
- Rollno as primary key
- USN as not NULL
- Name as unique
- Class and sec
2) Insert 5 records
3) Create a new table marks with fields – Eng, Mat, Phy, Chem, CS, Total.
4) Insert 5 records
5) Update table with total=Eng + Mat + Phy + Che + CS
6) Insert one more record into marks and students each.
7) General calculations
(i) Calculate area of cirle with radius 7cm
(ii) Calculate average of 73.7, 62.7, 68.9
(iii) Round 2365.367 off to single decimal place
(iv) Round 2365.367 off to 10th place
(v) Round 2365.367 to a whole number.
22 JOINT QUERIES
1) Create table student with fields – Admno, Name, Class, Sec, Scholarship,
Phone and insert 10 records
2) Create table sports with fields – Admno, game, coach, grade and insert 10
records.
3) Display Name, Class, sec from student corresponding to coach where
student.Admno = sports.Admno.
4) Count number of students with grade A
5) Display details of students whose game is cricket.
6) Count the number of students in class 12 where game is “Volleyball”
7) Count the number of students in class 11 where game is “Basketball”
23 MYSQL CONNECTIVITY – 1
Write a program to integrate SQL with python
1) Create table employee with empno, empname, salary
2) Insert 2 records
3) Display records
24 MYSQL CONNECTIVITY – 2
Write a program to integrate SQL with python and search a record using empno
as user input.
25 MYSQL CONNECTIVITY – 3
1) Update salary by empno
2) Delete record by empno