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

Practical Assignment3

Uploaded by

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

Practical Assignment3

Uploaded by

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

Narmada College of Science And Commerce,

Zadeshwar, Bharuch.
BCA Sem– 3 (2024-25)
Subject: Database Handling Using Python Practical
Date :13/08/2024 Date of Submission :27/08/2024
Assignment-3
CSV Lab Exercises
1. Write a Python program to read each row from a given csv file and print a list of strings.
2. Write a Python program to read a given CSV file having tab delimiter.
3. Write a Python program to read a given CSV file as a list.
4. Write a Python program to read a given CSV file as a dictionary.
5. Write a Python program to read specific columns of a given CSV file and print the content of the
columns.
6. Write a Python program that reads each row of a given csv file and skip the header of the file. Also print
the number of rows and the field names.
7. Write a Python program to write a Python list of lists to a csv file. After writing the CSV file read the
CSV file and display the content.
8. Write a Python program to write a Python dictionary to a csv file. After writing the CSV file read the
CSV file and display the content.
Sqlite3 Lab Exercises
1. Write a Python program to create a SQLite database and connect with the database and print the version
of the SQLite database.
2. Write a Python program to create a SQLite database connection to a database that resides in the memory.
3. Write a Python program to connect a database and create a SQLite table within the database.
4. Write a Python program to list the tables of given SQLite database file.
5. Write a Python program to create a table and insert some records in that table. Finally selects all rows
from the table and display the records.
6. Write a Python program to insert a list of records into a given SQLite table.
7. Write a Python program to insert values to a table from user input.
8. Write a Python program to count the number of rows of a given SQLite table.
9. Write a Python program to update a specific column value of a given table and select all rows before and
after updating the said table.
10. Write a Python program to update all the values of a specific column of a given SQLite table.
11. Write a Python program to delete a specific row from a given SQLite table.
12. Write a Python program to alter a given SQLite table.
Note: Take the tables Student, Employee, Product with at least 6 columns and perform the above
operations.
13. Prepare a Marksheet of a student by considering the following tables.
Student_Table
Sr.No. Column Name Datatype Description
1 SeatNo Number Examination Seat Number
2 SName Text Name of the Student
3 Course Text Student Course like BBA , BCA etc.
Exam_Detail
Sr.No. Column Name Datatype Description
1 SeatNo Number Examination Seat Number Reference Key to Student Tabel
2 Exam_Id Text Exam Id Primary Key
3 Semester Number Semester Number
4 Exam Text Month and Year e.g. March-24
5 Sub1 Number Marks of Subject 1
6 Sub2 Number Marks of Subject 2
7 Sub3 Number Marks of Subject 3
8 Sub4 Number Marks of Subject 4
Consider the following points in preparing results:
(a) Student must score more than 35 marks in each subjects. (out of 100 marks)
(b) Percentage and Class also be calculated.
(c ) Result of the student should be displayed as per user’s choice semester.

14. Consider the following tables and perform the operation as per requirement of the user by writing code
in Python.
Account_Table
Sr.No. Column Name Datatype Description
1 Acno Number Account number of the user
2 AcHolder_Name Text Name of the customer
3 Account_type Text Account type like savings , recurring, Current
4 Balance Real Account Balance
Transaction_table:
Sr.No. Column Name Datatype Description
1 TransactionNo Number Inputted by user
2 Transaction_Type Text Either ‘D’ for Deposit or ‘W’ for Withdraw
3 Tr_Amount Real Transaction Amount
4 Tdate Date Transaction Date (Automatically the system date)
5 TTime Date/time Transaction Type(Automatically the system time)
Write Python code by considering the user’s choice the following operations:
1. Opening of Account (Min Balance for Current A/c. Rs. 5000 and Savings and Recurring Account Rs.
1000)
2. Perform the Depositing or Withdrawal Transaction as per the customer’s choice.
3. Perform the closing of the Account Operation.

15. Consider the following tables and perform the operation as per requirement of the user by writing code
in Python.
Item_Table
Sr.No. Column Name Datatype Description
1 ItemId Number Item number
2 Item_Name Text Name of the Product
3 Quantity Real Account type like savings , recurring, Current
Transaction_table:
Sr.No. Column Name Datatype Description
1 TransactionNo Number Inputted by user
2 Transaction_Type Text Either ‘I’ for Inward or ‘O’ for Outward
3 Quantity Real Quantity of Items
4 Tdate Date Transaction Date (Automatically the system date)
5 TTime Date/time Transaction Type(Automatically the system time)
Write Python code by considering the user’s choice the following operations:
1. Adding New Item.
2. Perform the Inward or Outward Transaction as per the customer’s choice.
3. Perform the Deletion of the product from the Item table.

You might also like