Practical Solutions 2024-2025
Computer Science (083)
SET - 1
import pickle
def add_record():
f = open('Student.dat','wb')
while True:
rollno = int(input('Enter your RollNo. '))
name = input('Enter your Name: ')
marks = int(input('Enter your Marks: '))
rec = [rollno,name,marks]
pickle.dump(rec,f)
ch = input('Do you want to enter more records?(y/n) ')
if ch in 'Nn':
break
f.close()
def find_record():
f = open('Student.dat','rb')
rno = int(input('Enter roll no for search: '))
while True:
x = pickle.load(f)
if x[0] == rno:
print(x)
break
f.close()
add_record()
find_record()
a. Select * from TRANSACTION where Type = 'CREDIT';
b. Select Acc_No , Amount from TRANSACTION where DOTr BETWEEN '2023-04-01' AND '2023-04-
30';
c. Select Max(DOTr) from TRANSACTION where Acc_No = 103;
d. Select ACCOUNT.Acc_No, Acc_Name, DOTr from ACCOUNT A, TRANSACTION T where A.Acc_No =
T.Acc_No and Amount >= 3000;
Practical Solutions 2024-2025
Computer Science (083)
SET – 2
x = [12,13,34,56,21,79,38,22,45,98]
st=[]
def Push(x):
for i in x:
if i % 2 == 0:
st.append(i)
print('Given values are: ',x)
print("Stack created successfully!!")
print("Stack values are:", st)
def Pop(st):
if isEmpty(st):
print("Stack is Empty!!")
else:
print("POP OPERATION INITIATED")
print("Deleted element is: ", st.pop())
def Display(st):
if isEmpty(st):
print("Stack is Empty!!")
else:
y=st[::-1]
print("Stack values are: ")
for i in y:
print(i, end=' ')
def isEmpty(st):
if len(st) == 0:
return True
else:
return False
Push(x)
Pop(st)
Display(st)
a. SELECT * FROM FACULTY WHERE SALARY > 12000;
b. SELECT * FROM COURSES WHERE FEES BETWEEN 15000 AND 50000;
c. UPDATE COURSES SET FEES = FEES + 1100;
d. MIN(SALARY)
6000