0% found this document useful (0 votes)
20 views6 pages

indexcsprac

Uploaded by

Coding Tracker
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)
20 views6 pages

indexcsprac

Uploaded by

Coding Tracker
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/ 6

INDEX

Sr Topic Pag Dat Sig


No e e n
. No.
PYTHON PROGRAMS
1. Program to print a square multiplication table from 1 to 10
2. Program to check whether the given character is alphabet or
digit
3. Program that reads a string and checks whether it is palindrome
or not
4. Define two variables first and second so that first = ‘jimmy’ and
second=’johny’. Write a short python code segment that swaps
the values assigned to these two variables and prints the results.
5. Program using function that takes a number as an argument and
calculates cube for it.
6. Program For Factorial Of A Number
7. Program to find the Fibonacci series of a given number
8. Program to read a text file line by line and display each word
separated by a #
9. Program to read a text file and display the number of
vowels/consonants/uppercase/lowercase characters in the fifile
10. Program to remove all the lines that contain the character 'a' in a
file and write it to another file
11. Program to create a binary file with name and roll number.
Search for a given roll number and display the name, if not found
display appropriate message
12. Create a binary file with roll number, name and marks. Input a
roll number and update the marks
13. Write a function to count the number of lines in a text file
“My_Story.txt” that are starting with an alphabet “A”
14. Program to create a CSV file by entering user_id and password,
read and search the password for given user_id
15. Write A Python Program To Implement A Stack Using A List

MySQL Programs
1. Create table Employee having EmpID, Name, Gender, DOB with
EmpID as
Primary key.
Write queries for the following:
a. Display the Table Structure
b. Add a Column department varchar(10), Emp_Address(25)
c. Change the data type of the field Emp_Address to varchar(50)
and allow
Null values.
d. Delete the column DOB
e. Display all the records
2. Create table Customer as per following Table Instance Chart.

a. Add one column Email of data type VARCHAR and size 30 to


the table
Customer.
b. Add one column Email of data type VARCHAR and size 30 to
the table
Customer.
c. Insert few records with relevant information, in the table.
d. Drop the column CustomerIncomeGroup from table Customer.
3. Create the following tables ‘Watches’ and ‘Sale’.
Write SQL queries for (a) to (d) and the output of SQL commands
for (e) to (h):
TABLE WATCHES

TABLE SALE

a. Display all the details of those watches whose name end with
“Time”
b. Display the name and price of those watches, which have a
price range in
between 5000 – 15000.
c. Display the total quantity in store of ‘Unisex’ type watches.
d. Display the watch names and the quantity sold in the first
quarter.
e. SELECT MAX(PRICE), MIN(Qty_Store) FROM WATCHES;
f. SELECT MAX(PRICE), MIN(Qty_Store) FROM WATCHES;
g. SELECT WATCH_NAME, Qty_Store,
SUM(Qty_Sold),
QTY_Store-SUM(Qty_Sold) ‘’Stock’’ FROM WATCHES W, SALE S
WHERE W.WATCHID = S.WATCHID
GROUP BY S.WATCHID;
4. Create the following tables for the database Library:
Table : BOOKS

Table : ISSUED

Write SQL queries for (a) to (f):


a. To show Book name, Author name and Price of books of First
Publ. publishers.
b. To list names from books of Text type.
c. To display the names and price from books in ascending order
of their price.
d. To increase price of price of all books of EPB and Publishers by
50.
e. To display the Book_Id, Book_Name, and Quantity_Issued for all
books which
have been issued.(The query will require contents from both the
tables.)
f. To insert a new row in the table Issued having the following
data: “F003”, 1
g. Give the output of the following queries based on the above
tables:
(i). SELECT COUNT(*) FROM BOOKS;
(ii). SELECT MAX(Price) FROM Books WHERE QUANTITY >=15;
(iii). SELECT Book_Name, Author_Name FROM Books WHERE
Publishers=”EBP”;
(iv). SELECT COUNT(DISTINCT Publishers) FROM Books WHERE
Price>=400;
5. Consider the following DEPT and WORKER tables. Write SQL
queries for (i)
to and (iv) find outputs for SQL queries (v) to (viii) :
TABLE DEPT

TABLE WORKER

(i). To display Wno, Name, Gender from table WORKER in


descending order of
Wno.
(ii). To display the Name of all the FEMALE workers from the table
WORKER.
29 28.10.22
(iii). To display the Wno and Name of those workers from the
table WORKER who
are born between ‘1987-01-01’ and ‘1991-12-01’.
(iv). To count and display MALE workers who have joined after
‘1986-01-01’.
(v). SELECT COUNT(*), DCODE FROM WORKER
GORUP BY DCODE HAVING COUNT(*)>1;
(vi). SELECT DISTINCT DEPARTMENT FROM DEPT;
(vii). SELECT NAME, DEPARTMENT, CITY FROM WORKER W, DEPT D
WHERE
W.DCODE = D.DCODE AND WNO<1003;
(viii). SELECT MAX(DOJ), MIN(DOB) FROM WORKER;
Python Connectivity Programs
1. Write the code checking Python connectivity with MySQL
database namely,
School, and then fetch all the records from table Employee.
2. Write a program for creating a database Student table using
Interface python with
MySQL.
3. Write a program to insert 10 records in above table and display
the same.
4. Program showing all Fetch commands

You might also like