0% found this document useful (0 votes)
16 views37 pages

My Document

Uploaded by

Milan Dhara
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views37 pages

My Document

Uploaded by

Milan Dhara
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

INDEX

SIGNATURE
SL.NO PROGRAMS PAGE DATE OF TEACHER
IN CHARGE
1. To count and display the total number of vowels

2. Fibonacci series using recursive function

3. To check whether the given string is palindrome or not

4. Factorial of a number using recursive function

Menu driven program to calculate the area of different


5. shapes using functions
6. Sum of first n natural numbers using recursive function

7. Read a text file line by line and display each word


separated by ‘#’
8. Read the text file and count the number of occurrences
of ‘is’ and ‘and’ in that file
9. Store and retrieve student information using CSV file

10. Copy the contents of the CSV file into another file using
different delimiter
11. Create a binary file to store member number and
member name
12. Create a menu driven program to write, read, update and
append data onto a binary file
SL.NO PROGRAM SIGNATURE
PAGE DATE OF
TEACHER
IN CHARGE
13. To implement stack as a list
14. To display unique vowels using
stack
15. To implement employee stack

16. SQL queries relation stock and dealers

17. SQL queries relation employee and stack

18. Python-MySQL connectivity


programs-create & insert record into table

19. Python-MySQL connectivity programs-search a


record
20. Python-MySQL connectivity programs-update a
record
21. Python-MySQL connectivity programs-sort records
in order
PROGRAM:1
AIM
Program to accept string as an input and to count and display the total number of
vowels present in it using function.

CODE

OUTPUT
PROGRAM:2
AIM
To print Fibonacci series using function.

CODE

OUTPUT
PROGRAM:3
AIM
To check whether the given string is a palindrome or not using solutions.

CODE

OUTPUT
PROGRAM:4

AIM
Recursive function to calculate the factorial of a number.

CODE

OUTPUT
PROGRAM:5

AIM
Program to calculate the area of different shapes using function.

CODE
OUTPUT
PROGRAM:6
AIM
Calculate the sum of first “n” natural numbers using recursion.

CODE

OUTPUT
PROGRAM:7
AIM

Program to read a text file line by line and display each word separated by ‘#’.

CODE

OUTPUT
PROGRAM:8
AIM
Program to read a text file and count the number of occurrence of “is” and ”and” in
that file.

CODE

OUTPUT
PROGRAM:9
AIM

Program to store and retrieve student’s information using csv file.

CODE
OUTPUT
PROGRAM:10
AIM
Program to copy the contents of a csv file into another file using different
delimiter.

CODE

OUTPUT
PROGRAM:11

AIM
Program to create a binary file to store member no and member name. Given a
member no display its associated name else display appropriate error message.

CODE
OUTPUT
PROGRAM:12

AIM
To create a menu driven program to write, read, update and append data on to a
binary file.

CODE
OUTPUT
PROGRAM: 13

AIM

Program to implement stack as a list.


CODE

OUTPUT
PROGRAM: 14

AIM

Program to display vowels using stock


CODE

OUTPUT
PROGRAM: 15

AIM

Program to implement employee stack.

CODE
OUTPUT
PROGRAM: 16

AIM

Program to perform the functions based upon the questions given below on the
table stock and dealer
QUESTIONS

Consider the following tables: Stock and


Dealer Table Stock:

Table Dealer:

Give SQL statements for the queries 1 to 4 and output for 5 and 6.
1. To display details of all the items in the stock in ascending order of stockdate.
2. To display details of those items in stock table whose dealer Code (Dcode) is
102 or quantity in Stock (Qty) is more than 100.
3. to insert a record in the stock table with the values :( 5010,’Pencil HB’, 102,
500, 10, ’2010-01-26’)
4. To display Dcode, DName from Dealer table and Item, Unit Price from stock
table of all the
Dealers (including the dealer details that have not sold any item)
5. SELECT count (distinct Dcode) FROM Stock;
6. SELECT Qty*from UnitPrice FROM stock WHERE Itemno= 5006;
OUTPUT

1)

2)
3)

4)

5)
6)
PROGRAM: 17

AIM

To perform the functions based upon the questions given below on the
EMPLOYEE and SALGRADE.
QUESTIONS

Consider the table given below and answer the questions


Table: EMPLOYEE

Table: SALGRADE

A) Give SQL command for the following


1. To display the details of all EMPLOYEE’s in descending order of DOJ.

2. To display NAME and DESIG of those EMPLOYEEs whose SALGRADE is


either

S02 or S03.
3. To display the content of the entire EMPLOYEEs table, whose DOJ is in
between

‘2006-02-09’ and ‘2009-08-08’.


4. To add a new row with the following content (109,’Harish

Roy’,’HEAD-IT’,’S02’,’2007-09-09’,’1983-04-21’).

B) Give the output for the following


1. SELECT COUNT (SGRADE), SGRADE FROM EMPLOYEE GROUP BY
SGRADE;
2. SELECT MIN (DOB), MAX (DOJ) FROM EMPLOYEE.

3. SELECT SGRADE, SALARY+HRA FROM EMPLOYEE WHERE


SGRADE=’S02’;

OUTPUT

A.1)

A.2)
A.3)

A.4)

B.1)
B.2)

B.3)
PROGRAM: 18

AIM

To create a python-MySQL connectivity program to create and insert values into a


table.

CODE
OUTPUT
PROGRAM: 19

AIM

To create a python-MySQL connectivity program to search a record.


CODE

OUTPUT
PROGRAM: 20

AIM

To create a python MySQL connectivity program to update a record.


CODE
OUTPUT
PROGRAM: 21

AIM

To create python-MySQL connectivity program to sort records in order.


CODE

OUTPUT

You might also like