0% found this document useful (0 votes)
17 views20 pages

Shashank DBP

The document outlines a series of programming tasks and assignments related to PL/SQL and Python, focusing on database operations, triggers, and data manipulation. It includes creating and managing tables, writing scripts for data validation, and generating reports from databases. The tasks are structured for students at Vimal Tormal Poddar BCA College, with specific requirements for each assignment.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views20 pages

Shashank DBP

The document outlines a series of programming tasks and assignments related to PL/SQL and Python, focusing on database operations, triggers, and data manipulation. It includes creating and managing tables, writing scripts for data validation, and generating reports from databases. The tasks are structured for students at Vimal Tormal Poddar BCA College, with specific requirements for each assignment.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 20

Shree Mahavir Vidyamandir Trust

Vimal Tormal Poddar BCA College

INDEX
Sr.No Questions Page Sign
No
1 Write a PL/SQL block of code that will read balance from Account 3
table and update table with fine if balance is less than Rs. 500
2 Create a Trigger on the Employee Table which checks whether the 4
FirstName and the LastName provided by the user is Alphabetic or
not.
3 Create a DELETE TRIGGER which will respond whenever there is a 4
deletion operation happened on the Employee table. And also
create a different table in which we will store the values deleted
and the timestamp when they were deleted.
4 Write a PL/SQL block to validate Product table whenever Quantity 5
and Amount of product is added or updated. [Quantity & Amount
must be greater than zero].
5 Write a PL/SQL block that disallow DML (Insert, Update, Delete) 6
operations on Sunday.
6 Write a python script to do following on student. (Roll_no, Name, 6
Sub_1,Sub_2,Sub_3,Total) table: a. Create Table and Insert at least
5to 10 records b. Update the specific record value. c. Delete the
specific record. d. Display student detail who got highest total
marks.
7 Create COLLEGE database and perform following tasks. a. Create 7
following table using SQLite and then close the connection.
Student(roll_no integer Primary key,name text(20),city
text(20),age integer) b. Insert 10 students records for Student
table.
8 Create a customer table with (cid, cname, city, age must > 18). 10
Insert 10 records. Create user defined function disp_cust(con,
query). It contains two passing parameters: Connection and the
Query. Find all the details of customers whose name’s second
letter is ‘i’ and second last letter is ‘y’. Ex. Piya, Siya, Riya, … and
display records in table format.
9 Consider a table “emp” in database “MyDB.db” having fields like 11
emp_no, emp_name, age, salary, Write python code to generate
emp.csv file having employees whose age > 22.
10 Write python script to so the following on item.csv (item_no, 12
item_name, price, qty, total) a. Write item’s detail in item.csv file.
Calculate total from price and qty fields values. b. Using data
frame display item name and price whose price is between 1000
to 7000. c. Display alternate records from item.csv file. d. Display
item whose price is minimum, maximum. e. Sort the data
according to item name wise. f. Display items rows between 2nd

Name :JAY SHARMA 1 Roll No : 141


Shree Mahavir Vidyamandir Trust
Vimal Tormal Poddar BCA College

to 6th row. g. Display last 4 rows

11 Sales (sid, year,totalsales) create above table into a SQLite 14


database with appropriate constraints. a. Insert at least 5-10
records into the sales table. b. Export Sales table data into
sales.csv file. c. Write a python scripts that read the Sales.csv file
and plot a bar chart that shows total_sales of the year. Also
decorate the chart with appropriate title, labels and colors etc.
12 Write a python program to create database named “College” in 16
sqlite. Create table Teacher(t_id, t_name, salary, working_hours).
Insert minimum 10 records. Access Teacher table data and display
data in descending order of salary. Display name and working
hours of teacher whose salary is highest. Display name of teachers
whose salary is between 45000 to 65000. Display subplot bar
chart t_id vs working_hours and subplot line chart t_id vs salary
using subplot concept.

Name :JAY SHARMA 2 Roll No : 141


Shree Mahavir Vidyamandir Trust
Vimal Tormal Poddar BCA College

1. Write a PL/SQL block of code that will read balance from Account table and update table
with fine if balance is less than Rs. 500.

Name :JAY SHARMA 3 Roll No : 141


Shree Mahavir Vidyamandir Trust
Vimal Tormal Poddar BCA College

2. Create a Trigger on the Employee Table which checks whether the FirstName and the
LastName provided by the user is Alphabetic or not

3. Create a DELETE TRIGGER which will respond whenever there is a deletion


operation happened on the Employee table. And also create a different table in which
we will store the values deleted and the timestamp when they were deleted.

Name :JAY SHARMA 4 Roll No : 141


Shree Mahavir Vidyamandir Trust
Vimal Tormal Poddar BCA College

4. Write a PL/SQL block to validate Product table whenever Quantity and Amount of
product is added or updated. [Quantity & Amount must be greater than zero].

Name :JAY SHARMA 5 Roll No : 141


Shree Mahavir Vidyamandir Trust
Vimal Tormal Poddar BCA College

5. Write a PL/SQL block that disallow DML (Insert, Update, Delete) operations on
Sunday.

Name :JAY SHARMA 6 Roll No : 141


Shree Mahavir Vidyamandir Trust
Vimal Tormal Poddar BCA College

6. Write a python script to do following on student. (Roll_no, Name,


Sub_1,Sub_2,Sub_3,Total) table: a. Create Table and Insert at least 5to 10 records b.
Update the specific record value. c. Delete the specific record. d. Display student
detail who got highest total marks.

Name :JAY SHARMA 7 Roll No : 141


Shree Mahavir Vidyamandir Trust
Vimal Tormal Poddar BCA College

7. Create COLLEGE database and perform following tasks. a. Create following table
using SQLite and then close the connection. Student(roll_no integer Primary
key,name text(20),city text(20),age integer) b. Insert 10 students records for Student
table. c. Add column course and display all records of student having city Surat and
course BCA using python cursor/execute. d. Dump Student table query to sql file with
name student_table.sql e. Export the Student table to CSV file and display in python
IDLE

Name :JAY SHARMA 8 Roll No : 141


Shree Mahavir Vidyamandir Trust
Vimal Tormal Poddar BCA College

Name :JAY SHARMA 9 Roll No : 141


Shree Mahavir Vidyamandir Trust
Vimal Tormal Poddar BCA College

Name :JAY SHARMA 10 Roll No : 141


Shree Mahavir Vidyamandir Trust
Vimal Tormal Poddar BCA College

8. Create a customer table with (cid, cname, city, age must > 18). Insert 10 records.
Create user defined function disp_cust(con, query). It contains two passing
parameters: Connection and the Query. Find all the details of customers whose name’s
second letter is ‘i’ and second last letter is ‘y’. Ex. Piya, Siya, Riya, … and display
records in table format.

Name :JAY SHARMA 11 Roll No : 141


Shree Mahavir Vidyamandir Trust
Vimal Tormal Poddar BCA College

9 .Consider a table “emp” in database “MyDB.db” having fields like emp_no, emp_name,
age, salary, Write python code to generate emp.csv file having employees whose age > 22.

Name :JAY SHARMA 12 Roll No : 141


Shree Mahavir Vidyamandir Trust
Vimal Tormal Poddar BCA College

10. Write python script to so the following on item.csv (item_no, item_name, price, qty, total)
a. Write item’s detail in item.csv file. Calculate total from price and qty fields values. b. Using
data frame display item name and price whose price is between 1000 to 7000. c. Display
alternate records from item.csv file. d. Display item whose price is minimum, maximum. e.
Sort the data according to item name wise. f. Display items rows between 2nd to 6th row. g.
Display last 4 rows.

Name :JAY SHARMA 13 Roll No : 141


Shree Mahavir Vidyamandir Trust
Vimal Tormal Poddar BCA College

Name :JAY SHARMA 14 Roll No : 141


Shree Mahavir Vidyamandir Trust
Vimal Tormal Poddar BCA College

Name :JAY SHARMA 15 Roll No : 141


Shree Mahavir Vidyamandir Trust
Vimal Tormal Poddar BCA College

11. Sales (sid, year,totalsales) create above table into a SQLite database with appropriate
constraints.

a. Insert at least 5-10 records into the sales table.

b. Export Sales table data into sales.csv file.

c. Write a python scripts that read the Sales.csv file and plot a bar chart that shows total_sales
of the year.

Also decorate the chart with appropriate title, labels and colors etc.

Name :JAY SHARMA 16 Roll No : 141


Shree Mahavir Vidyamandir Trust
Vimal Tormal Poddar BCA College

Name :JAY SHARMA 17 Roll No : 141


Shree Mahavir Vidyamandir Trust
Vimal Tormal Poddar BCA College

12. Write a python program to create database named “College” in sqlite. Create table
Teacher(t_id, t_name, salary, working_hours). Insert minimum 10 records. Access Teacher
table data and display data in descending order of salary. Display name and working hours of
teacher whose salary is highest. Display name of teachers whose salary is between 45000 to
65000. Display subplot bar chart t_id vs working_hours and subplot line chart t_id vs salary
using subplot concept.

Name :JAY SHARMA 18 Roll No : 141


Shree Mahavir Vidyamandir Trust
Vimal Tormal Poddar BCA College

Name :JAY SHARMA 19 Roll No : 141


Shree Mahavir Vidyamandir Trust
Vimal Tormal Poddar BCA College

Name :JAY SHARMA 20 Roll No : 141

You might also like