Shashank DBP
Shashank DBP
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
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.
2. Create a Trigger on the Employee Table which checks whether the FirstName and the
LastName provided by the user is Alphabetic or not
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].
5. Write a PL/SQL block that disallow DML (Insert, Update, Delete) operations on
Sunday.
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
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.
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.
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.
11. Sales (sid, year,totalsales) create above table into a SQLite database with appropriate
constraints.
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 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.