Cs Report File
Cs Report File
SAIL, RANCHI
REPORT FILE OF
“COMPUTER SCIENCE”
FOR THE YEAR 2023-2024
Presented By
Atharva Raj
Class:-XII “G” Roll No:-08
ACKNOWLEDGEMENT
I, Atharva Raj, would like to express my sincere gratitude to all those who
have helped me in completing my computer science report file. Without
their support and guidance, this project would not have been possible.
First and foremost, I would like to thank my parents for their unwavering
support and encouragement throughout the project. Their belief in me
gave me the confidence to pursue this project and overcome any
obstacles that came my way.
Additionally, I would like to thank the staff at the school library for
providing me with access to various books and online resources, which
helped me to gather information and research for the project.
Last but not least, I would like to thank my classmates and friends who
have always been there to support me and offer their help whenever I
needed it.
Once again, thank you all for your invaluable contribution in making this
project a success.
Sincerely,
ATHARVA RAJ
CERTIFICATE
This is to certify that Atharva Raj of class XII “G” has
completed his computer science report file under
the guidance of Mr. Gautam Chakraborty Sir for the
academic year 2023-2024. The certified student has
been dedicated throughout his research and
completed his work before the given deadline
without missing any important details from the
project. It is also certified that this project is the
individual work of the student and can be submitted
for evaluation.
1
List.
21. Write a program to connect with database and store record of
employee and display records.
22. Write a program to connect with database and search employee
number in table employee and display record, if empno not found
display appropriate message.
23. Write a program to connect with database and update the employee
record of entered empno.
24. Write a program to connect with database and delete the record of
entered employee number.
25. Create a student table and insert data. Implement the following SQL
commands on the student table: (a) ALTER table to add new
attributes / modify data type / drop attribute (b) UPDATE table to
modify data (c) ORDER By to display data in ascending / descending
order (d) DELETE to remove tuple(s) (e) GROUP BY and find the min,
max, sum, count and average.
26. Create a table STUDENT and write sql commands.
27. Consider the following table named “Soft drink”. Write commands
of SQL
28. Write an output for SQL queries (i) to (iii), which are based on the
table.
29. Write the output of the queries (a) to (d) based on the table, CLUB
given.
30. Write SQL commands for the following queries (i) to (iv) based on
the relations Product and Client given.
2
1. Write a program to enter two numbers and print the
arithmetic operations like +,-,*,/,// and % as per user choice.
Ans:-
3
2. Write a program to check entered number is Armstrong or
not.
Ans:-
4
3. Write a program to enter the number of terms and to
print the Fibonacci series.
Ans:-
5
4. Write a program to enter the string and display the
longest word present in the entered string.
Ans:-
6
5. Write a python function that takes a number as a
parameter and checks whether a number is prime or
not.
Ans:-
7
6. Write a python function to add the first ‘n’ terms of the
series:
1+1/2-1/3+1/4-1/5+………………………
Ans:-
8
7. Write a program that accepts a hyphen-separated
sequence of words as input and print the words in a
hyphen-separated sequence after storing them
alphabetically.
Sample Items: green-red-yellow-black-white
Expected Result: black-green-red-white-yellow
Output:-
9
8. Write a python function to calculate the factorial of a
number (a non-negative integer). The function accepts
the number whose factorial is to be calculated as the
argument.
Output:-
10
9. Write a program to remove all the lines that contain the
character “b” in a file and write it into another text file.
Output:-
11
10. Write a program to read a text file and display the
number of vowels/consonants/uppercase/lowercase
characters in the file.
Output:-
12
11. Write a program to create a binary file with name
and roll no. Search for a given roll number and display
the name, if not found display appropriate message.
Output:-
13
12. Write a program to create a binary file to store Roll
no, Name and Marks and update marks of entered Roll
no.
Output:-
14
13. Write a program to implement a stack using a list
data structure.
Output:-
15
14. Write a program to read a text file line by line and
display each word separated by #.
Output:-
16
15. Write a program to accept string/sentences from
the user till the user enters “END”. Save the data in a
text file and then display only those sentences which
begin with an uppercase alphabet.
Output:-
17
16. Write a program to read a file ‘Story.txt’ and create
another file, storing an index of ‘Story.txt’, telling which
line of the file each words appears in. If word appears
more than once, then index should show all the line
numbers containing the word.
Output:-
18
17. Write a program to display the size of the file after
removing EOL characters, leading and trailing white
spaces and blank lines.
Output:-
19
18. Raj has been asked to display all the students who
have secured less than 40 for Remedial Classes. Write a
user-defined function to display those students who
have secured less than 40 from the binary file
“Student.dat”.
Output:-
20
19. Write a program to create CSV file and store
empno, name, salary and search any empno and display
name, salary and if not found appropriate message.
Output:-
21
20. Write a menu driven program to implement Stack
in Python using List.
Output:-
22
21. Write a program to connect with database and
store record of employee and display records.
Output:-
23
22. Write a program to connect with database and
search employee number in table employee and display
record, if empno not found display appropriate
message.
Output:-
24
23. Write a program to connect with database and
update the employee record of entered empno.
Output:-
25
24. Write a program to connect with database and
delete the record of entered employee number.
Output:-
26
25. Create a student table and insert data. Implement
the following SQL commands on the student table:
(a) ALTER table to add new attributes / modify data
type / drop attribute
(b) UPDATE table to modify data
(c) ORDER By to display data in ascending / descending
order
(d) DELETE to remove tuple(s)
(e) GROUP BY and find the min, max, sum, count and
average.
27
To modify data type:
To drop column:
28
(b) To modify data:
29
(d) To delete tuple
30
26. Create a table STUDENT and write sql commands for (a) to (f)
and write the outputs for (e) and (g) on the basis of the table
STUDENT:
TABLE: STUDENT
31
(f) To display all the records in stored order of name.
32
(c) SELECT STREAM,COUNT(STREAM) FROM STUDENT GROUP BY STREAM;
33
(e) ALTER TABLE STUDENT ADD STIPEND INT;
UPDATE STUDENT SET STIPPEND=0.2*FEES;
34
27. Consider the following table named “Softdrink”. Write
commands of SQL for (i) to (iv).
TABLE:SOFTDRINK
DRINKCODE DNAME PRICE CALORIES
OUTPUTS:-
35
(i) SELECT DNAME, DRINKCODE FROM SOFTDRINK WHERE CALORIES>120;
36
(iv) UPDATE SOFTDRINK SET PRICE=PRICE+0.1*PRICE;
37
28. Write a output for SQL queries (i) to (iii), which are
based on the table : student given below:
Table: Student
ROLLNO NAME CLASS DOB GENDER CITY MARKS
38
(iv) To increase marks of all students by 20 whose class is
‘XII’.
OUTPUT:-
Write a SQL queries for (i) to (iv), which are based on the table:
student.OUTPUTS:-
39
(ii) To display Class, DOB and City whose marks is between
450 and 551.
SELECT CLASS,DOB,CITY FROM STUDENT WHERE MARKS BETWEEN 450 AND 551;
40
29. Consider the table CLUB given below.
Table: CLUB
COACH_NAM DATEOFAP
COACH_ID AGE SPORTS PAY SEX
E P
BASKETBAL
4 TARUN 33 01/01/1998 1500 M
L
BASKETBAL
10 39 19/02/1998 1700 M
L
Write the output of the queries (a) to (d) based on the table,
CLUB given above:
42
30. Write SQL commands for the following queries (i) to
(iv) based on the relations Product and Client given below:
Table: Product
Table: Client
43
i) Write SQL query to display Product Name and Price for all
products whose Price is in the range of 50 to 150.
ii) Write SQL query to display details of product whose
manufacturer is either XYZ or ABC
iii) Write SQL query to display Product Name, Manufacturer
and Price for all Products that are not given any discount.
iv) Write SQL query to display Client Name, City, and P_ID
for all clients whose city is Delhi.
OUTPUTS:-
(i) SELECT PRODUCTNAME,PRICE FROM PRODUCT WHERE PRICE BETWEEN
50 AND 150;
44
(iii) SELECT PRODUCT_NAME,MANUFACTURER,PRICE FROM PRODUCT
WHERE DISCOUNT IS NULL;
45