You are on page 1of 34

COMPUTER SCIENCE

PRACTICAL FILE

TERM 2

Anugya Chaubey
12 F
04
CERTIFICATE

This is to certify that ANUGYA


CHAUBEY, student of Class
XII-F, New Era Public School,
Mayapuri has completed the
practical file during the
academic year 2020-21 for the
computer science evaluation of
CBSE 2021 and submitted
satisfactory report as compiled
in the following pages under
my supervision.
ACKNOWLEDGEMENT
I would like to express my deep
gratitude to my teacher Ms Gurjeet
Kaur who was a constant source of
encouragement and valuable advices.
I would like to thank my parents for
being there with continuing support
morally and financially.

THANKYOU
CONTENT

▪ Python Programs implementing


stacks (1-4)

▪ Python and mysql connectivity


(5-6)

▪ SQL queries (Q1-Q2)


[1] Write a python program to
implement stack operation.

OUTPUT:
[2] Write a python program to check whether
a string is a palindrome or not using stack.

OUTPUT:
[3]Python program to write
push(book) and pop(book) to add
books and remove books from list
OUTPUT:
[4] Write a program to implement a
stack for the employee
details(empno, name).
OUTPUT:
[5] Write a python program that display
first 8 rows fetched from student table of
MySQl database student_dbl
OUTPUT:
[6] Perform all the operations with reference to
table ‘students’ through MySQL-Python
connectivity.
OUTPUT:
SQL QUERIES
[1] Create a student table and insert
data. Implement the following MySQL
commands on the student table:

-ALTER table to add new add new


attributes/modify data types/drop
attribute

-UPDATE table to modify data


ORDER BY to display data in ascending
/descending order

-DELETE to remove tuple(s)


GROUP BY and find min,max,sum,count
and average
• Creating the table

• Inserting 10 values
• Altering table

• Updating table

• Sorting result
• Delete student details from above
table

• Grouping record
[Q1]. Consider the GARMENT
database and answer the following
SQL queries based on it
1. To create table garment
using given data
2. To insert rows into
garment table
3.To display contents of
garment table
4. To display names of those
garments that are available in “L”
Size.
5. To display codes and names of
those garment that have their
names starting with “Ladies”.
6. To display garment names,codes and
prices of those garment that have price
in range 1000.00 to 1500.00 (both
1000.00 and 1500.00 included)
7. To change the colour of garment with
code as 116 to “Orange”.
8. To display garment code ,names
and prices of all garments in
descending order of prices.
9. Increase the price of all
garments in the given table by
15%.
10. Remove tuples from garment tables
that have price less than 1300.00
[Q2.] Consider the following
STUDENT and DEPT tables. Write
SQL queries for following
• TABLE :STUDENT

• TABLE: DEPT
1] To display student name,department
name ,section,marks of only female
students
2] To Display the student
name,department name,section,gender
and marks of those student who are
scoring marks more than 75
3] To display all information about the
students of Computer department

You might also like