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

arpit practical file (4)

The document outlines a series of programming practicals and SQL commands, including tasks such as reading and manipulating text files, creating and updating binary files, generating random numbers, and performing database operations. Each practical is numbered and includes a brief description of the task, with additional sections dedicated to SQL commands for database management. The document serves as a guide for programming exercises and SQL query execution.

Uploaded by

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

arpit practical file (4)

The document outlines a series of programming practicals and SQL commands, including tasks such as reading and manipulating text files, creating and updating binary files, generating random numbers, and performing database operations. Each practical is numbered and includes a brief description of the task, with additional sections dedicated to SQL commands for database management. The document serves as a guide for programming exercises and SQL query execution.

Uploaded by

Panav Bora
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

1|P ag e

2|P ag e
S Name of practicals PAGE signature
no. NO.
Read a text file line by line and display each word
1. 6
separated by a#.
Read a text file and the no. of
2. 7
vowels/consonants/uppercase/lowercase characters
Remove all the lines that contains the character ’a’ in a
3. 8
file and write it to another file.
Create a binary file with roll no., name and marks. Input
4. a roll no. & update the marks 9
Create a binary file with name and roll no. Search for a given
5. roll no. & display the name, if not found display appropriate 10
message.
Write a random number generator that generate
6. random numbers between 1 and 6(simulates a dice). 11
Create a CSV file by entering user-id & password, read
7. & search the password for given user-id. 12
Take a simple of ten phishing e-mails (or any text file)
8. and find most commonly occurring words. 13
Write a program to calculate square root of a number if
9. it is even, otherwise calculate its cube root… 14
10. Write a program to print a table of the given no…. 15
11. Write a program to find sum of the series…. 16
12. Write a program to print Fibonacci series… 17
13. A Program to extract data from result set… 18
14. A program for creating a table. 19
15. A program for inserting record in a table… 20
16. Program for deleting a record… 21
A program to push element from a list those are divisible by 5 and
17. also display the stack if it has atleast one element otherwise 22
display appropriate error message..
18. A program to use push& pop function as per user choice.. 23
Program to push multiple element in a single stack
19. column….. 24
A program to show the elements which are poped out
20. from the stack and add it to another stack…. 25
SQL QUERIES 26
21.

3|P ag e
4|P ag e
Program 1: Read a text file line by line and
display each word separated by a#.

5|P ag e
Program 2: Read a text file and the number of
vowels/consonants/uppercase/lowercase characters.

6|P ag e
Program 3: Remove all the lines that contains the
character ’a’ in a file and write it to another file.

7|P ag e
Program 4: Create a binary file with roll no.,name
and marks. Input a rollno. & update the marks

8|P ag e
Program 5: Create a binary file with name and roll
no. Search for a given roll no. & display the name, if not
found display appropriate message.

9|P ag e
Program 6: Write a random number generator
that generate random numbers between 1 and
6(simulates a dice).

10 | P a g e
Program 7: Create a CSV file by entering user-id &
password, read & search the password for given user-id.

11 | P a g e
Program 8: Take a simple of ten phishing e-mails (or
any text file) and find most commonly occurring words.

12 | P a g e
Program 9:Write a program to calculate square root of a
number if it is even, otherwise calculate its cube root…

13 | P a g e
Program 10:Write a program to print a table of the
given no….

CODE

OUTPUT

14 | P a g e
Program 11:Write a program to find sum of the
series…..

15 | P a g e
Program 12: Write a program to print Fibonacci series…

16 | P a g e
Program 13: A Program to extract data from result set…

CODE

OUTPUT

17 | P a g e
Program 14: A program for creating a table..

CODE

OUTPUT

18 | P a g e
Program 15: A program for inserting record in a table…

CODE

OUTPUT

19 | P a g e
Program 16:Program for deleting a record…

CODE

OUTPUT

20 | P a g e
Program 17:A program to push element from a list those
are divisible by 5 and also display the stack if it has atleast one
element otherwise display appropriate error message..

CODE

OUTPUT

21 | P a g e
Program 18: A program to use push and pop function
as per user choice..
CODE

OUTPUT

22 | P a g e
Program 19:Program to push multiple element in a
single stack column…..
CODE

OUTPUT

23 | P a g e
Program 20:A program to show the elements which are
poped out from the stack and add it to another stack….
CODE

OUTPUT

24 | P a g e
25 | P a g e
Command 1: For creating Database ..

_______________________________________________
Command 2: For using database..

_______________________________________________
Command 3: For creating table ‘Employee’..

Output:

_______________________________________________

26 | P a g e
Command 4: To show tables in database..

_______________________________________________
Command 5: Alter Command
(a) To add a column..

Output :

_______________________________________________

27 | P a g e
(b) To modify column

Output:

_______________________________________________
©: To drop attribute.

Output:

28 | P a g e
Command 6: To insert records in a table..

Output :

_______________________________________________

29 | P a g e
Command 7: To create a column aliases..

_______________________________________________
Command 8: Using WHERE clause in SELECT
command .

Output:

*******************************

30 | P a g e

You might also like