0% found this document useful (0 votes)
3 views

cs record

The document outlines a series of MySQL commands and programming tasks aimed at executing basic database operations, including creating databases and tables, inserting and retrieving data, and performing various queries. It also includes sections on handling exceptions in Python and connecting Python with MySQL using parameterized queries. Each task is presented with a specific aim and expected output, guiding users through practical applications of MySQL and Python integration.

Uploaded by

chanikran404
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

cs record

The document outlines a series of MySQL commands and programming tasks aimed at executing basic database operations, including creating databases and tables, inserting and retrieving data, and performing various queries. It also includes sections on handling exceptions in Python and connecting Python with MySQL using parameterized queries. Each task is presented with a specific aim and expected output, guiding users through practical applications of MySQL and Python integration.

Uploaded by

chanikran404
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 32

EXP NO: BASIC COMMANDS IN MySQL

DATE:

AIM: To execute basic commands in MySQL

PROGRAM:

1) Write a command to create a student_12A database.

2) Write a command to display all the databases

3) Write a command for using the database.

4) Create a table s1 with rno, s_name, age, dob, stream, fees

5) Write a command to show structure of the table.

6) Write a command to insert 5 rows in a table.


7) Write a command to view contents of the table.

8) Write a command to retrieve rno, s_name and stream from the relation s1.

9) Write a command to display stream of the students in a distinct manner.

10) Write a command to display s_name and stream of the students whose stream is equal to cs.

11) Write a command to display name and stream in the ascending order of name.
12) Write a command to display name and stream in the descending order of

13) Write a command to add new column marks to the table s1.

14) Write a command to display name, stream and marks of the students who are in stream
cs and have marks greater than 90.

15) Write a command to make rno as primary key.


16) Write a command to increase cs student’s marks by

17) Write a query to display the name of the students whose name is starting with ‘A’

18) Write a query to delete the details of rno is 5

19) Write a query to display name of all students whose fees contains null

20) Write a query to display max, min, sum, avg, count(*), count(marks),
count(distinct(marks)) of each stream
21) Write a query to display stream where the number of students is more than

22) Write a query to display rno, s_name, address and phone_no of tables s1 and s2.

23) Write a query to delete marks column from the table.

24) Write a query to delete the table

25) Write a query to delete the database


EXPT TEXT

DAT

AIM: To the number of lines that start with uppercase letter in a text

PROGRA

TEXTFILE:

OUTPUT:
EXPT TEXT

DAT

AIM: To display two letter words from the text

PROGRA

TEXTFILE:

OUTPUT:
EXPT TEXT

DAT

AIM: To copy all five letter words from a text file and display it in other text

PROGRA

TEXTFILE:

OUTPUT:
EXPT TEXT

DAT

AIM: To count and display the number of vowels and consonants present in a text

PROGRA

TEXTFILE:

OUTPUT:
EXPT BINARY

DAT

AIM: To display the employees whose salary is greater than

PROGRA

OUTPUT:
EXPT BINARY

DAT

AIM: To display the number of names starting with s or

PROGRA

OUTPUT:
EXPT BINARY

DAT

AIM: To display the details of the students who have D or E

PROGRA

OUTPUT:
EXPT BINARY

DAT

AIM: To display the details of students who have scored above

PROGRA

OUTPUT:
EXPT CSV

DAT

AIM: To count and display the number of employees

PROGRA

EXEL SHEET:

OUTPUT:
EXPT CSV

DAT

AIM: To display details of furniture which has price greater than

PROGRA

EXEL SHEET:

OUTPUT:
EXPT CSV

DAT

AIM: To copy details of employee whose employee id is greater than 10 from one csv file to

PROGRA

EXEL SHEET:
EXPT EXCEPTION

DAT

AIM: To handle Zerodivisionerror exception when dividing a number by

PROGRA

OUTPUT:
EXPT EXCEPTION

DAT

AIM: To prompt the user to input an integer and raise a value error exception if the input is not

valid
PROGRAM:

OUTPUT:
EXPT EXCEPTION

DAT

AIM: To open a file and handle a Filenotfounderror exception if file does not

PROGRA

OUTPUT:
EXPT EXCEPTION

DAT

AIM: To open a file and handle a permissionerror exception if there is a permission

PROGRA

OUTPUT:
EXPT STACK

DAT

AIM: To create a stack with attributes (Name,age,dept,salary) and push, pop, peek, display

element in

PROGRA

OUTPUT:
EXPT STACK

DAT

AIM: To perform push and pop operations with a stack of list containing integers and to push

even numbers into the

PROGRA

OUTPUT:
EXPT STACK

DAT

AIM: To push all strings which has no vowels in it into the list novowel to delete the last element

display "stack empty" if there's no element to

PROGRA

OUTPUT:
EXPT STACK

DAT

AIM: To push the keys (names,mark) into a stack where corresponding value is greater than

and to pop and display the content of the

PROGRA

OUTPUT:
EXPT INTERFACE OF PYTHON WITH

DAT

AIM: To create a program python and connect it to

PROGRAM:

(i) Create and display database:-

OUTPUT:

(ii) Create and insert values in a table:-


(ii) Display table using:-

(a) fetchall()

OUTPUT:

(b) fetchmany()

OUTPUT:

(c) fetchone()

OUTPUT:

(iv)alter table:-
EXPT NO: INTERFACE OF PYTHON WITH MYSQL-II

DATE:

AIM: To create a database and table and perform various SQL queries using python-MySQL

connect

PROGRAM:

(i) create and display database:-

OUTPUT:

(ii) create table and insert values:-


(iii) display table:-

OUTPUT:

(iv) update a value:-

OUTPUT:

(v) delete a value:-

OUTPUT:
EXPT NO: INTERFACE OF PYTHON WITH

MYSQL (parameterized queries)-I

DATE:

AIM: To create a database and table and perform various SQL queries using parameterized queries

PROGRAM:

(i) create database:-

(ii) create table:-

(iii) insert values into table:-

OUTPUT:
(iv) show table:-

OUTPUT:

(v) update and show table:-

OUTPUT:

(vi) delete and show table:-

OUTPUT:
EXPT NO: INTERFACE OF PYTHON WITH

MYSQL (parameterized queries)-II

DATE:

AIM: To write a program to connect python with MySQL using parameterized queries

PROGRAM:
OUTPUT: insert values

OUTPUT: update values

OUTPUT: delete values

You might also like