0% found this document useful (0 votes)
14 views43 pages

Champ Harsh

Uploaded by

valzok1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views43 pages

Champ Harsh

Uploaded by

valzok1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

ASSIGNMENT -1

Q1) Create the database loans.

Q2)USE THE DATABASE LOANS.

Q3) create the table_ACCOUNTS and insert tuples in it.

Q4) display the details of account


Q5) Display the accno,cust_name,andloan_amount of all
the loans.

Q6) Display the details of all the loans with less than 40
installment.

Q7) Display the accno and loan amount of all the loans
started before 01-04-2009

Q8) Display the Int_rate of all the loans started after 01-04-
2009.
Q9) Display the details of the loans whose rate of interest is
null.

Q10)Display the details of all the loans whose rate of


interest is not null.

Q11)Display the number of installment of various loans


from the table account. A loan should be appear only once.

Q12) Display the number of installment of various loans


from the table account. An installment should be appear
only once
Q13)Display the details of all the loans started after
31-12-2008 for which number of installment are more
than 36.

Q14)Display the cust_name and loan_amount for all


the loans which donot have number of installment 36

Q15)Display the cust_name and loan_amount of all the


loans for which the loan amount is less than 500000 or
int_rate is more than 12
Q16)Display the details of loans which started in the
year 2009.

Q17)Display the details of all the loans whose


loan_amount is in the range 400000 to 500000

Q18)Display the details of all the loans whose int_rate


is in the range 11% to 12%

Q19)Display the cust_name and loan_amount of all the


loans for which the number of installments are
24,36,48
Q20)Display the details of all the loans whose
loan_amount is in the range 400000 to 500000
(using between operator)

Q21))Display the details of all the loans whose int_rate


is in the range 11% to 12%.(using between operator)

Q22)Display the accno,cust_name,andloan_amount of all


the loans for which cust_name ends with “Sharma”
Q23)Display the accno,cust_name,andloan_amount of all
the loans for which cust_name ends with “a”

Q24)Display the accno,cust_name,andloan_amount of all


the loans for which cust_namecontain with “a”

Q25)Display the accno,cust_name,andloan_amount of all


the loans for which cust_name does not contain with “p”.
Q26) Display the accno,cust_name,andloan_amount of all
the loans for which cust_name contains a as the second last
character.

Q27)Display the details of all the loans in ascending


order of their loan amount.

Q28) Display the details of all the loans in descending


order of their start date.
Q29) Display the details of all the loans in ascending
order of their loan amount and within loan amount in
the descending order of the start date.

Q30) Put the intrest rate 11.5% for all the loans for
which intrest rate is null.

Q31) Increase intrest rate by 0.5% for all the loans for
which the loan amount is more the 400000.

Q32) For each loan replace intrest (loan amount*int


rate *installment)12*100
Q33) Delete the record of all the loans who start date
is before 2007.

Q34) delete the record of all the loans of k.p. jain

Q35)Add another column category of type CHAR(1) in


the loan table

Q36)Display the sum of loan amount whose int rate is


greater than 10.
Q37)Display the max. interest from loan table.

Q38)Display the count of all loan holder whose name


ends with Sharma.

Q39)Display the count of all loan holder whose int.rate


is null
Q40)Display the interest wise detail of loan account
holder.

Q41)Display the interest wise detail of loan account


with atleast 10 installment remaining
ASSIGNMENT-2
Q)Consider the following table homework and write
answers for below given questions:

1)selectlcase(pname) from products where pname=’LED TV’;

2) selectsqrt(price) from products where price>5000;


3) select mod(qty,3) from homework;

4) select substr(company,1,4) from homework;

5) select concat(concat(pname,”-“),qty)from homework


where company=’Apple’;
6) selectpname,truncate(mod(price,103)) from homework
where qty>100;

7)selectpcode,round(qty) from homework wehere company


in(“sony”,”mi”);

8)select right(pname,4) from homework where qty=10 or


qty=20;
9) select substr(pname,2,3) ,left(pname,3), right(pname,3)
from homework;

10)select count(*),max(price),min(price) from homework


group by pname;

11)selectavg(price),sum(price),count(*) fromhomework
group by company;
12)select count(*),sum(price) from homework group
by company having company=”sony”;

13)select now(),curdate(),sysdate();

14)select year(“2024/04/20”), month(“2024/04/20”)


,day(“2024/04/20”);

15)selectdayofyear(“2024/04/20”),
dayname(“2024/04/20”) ,dayofweek(“2024/04/20”);
ASSIGNMENT 3
Q) Consider the following table named GYM with
details about fitness products being sold in the store.

a) Display the names of all the products in the store.

Ans)
b) Display the names of all the products with unit
price less than Rs.20000.

Ans)
c) Display the details of all the products with
unitprice in range 20000 to 30000.

Ans)
d) Display the names of all the products by the
manufacturer “avon fitness” in descending order
of unit price.

Ans)
e) Change the unit price data of all the rows by
applying a 10% increased on all the products.

Ans)
f) Remove all the products rows manufactured by
avon fitness.

Ans)
g) Display the details of all the products with
manufacturer name starting with A.

Ans)
PYTHON QUESTIONS
1)Write a program to create a listA a containg positive and
negative from the console.Also create two separate list called
PosNum and NegNum to store positive and negative numbers
respectively.Also, Calculate and print the total of all positive
and negative numbers
2)Write a program to shift the first element to the last
position.
Q3. Given an array named AList with the following elements
[2, 3, 4, -5, 6, -8, 11, -9]
Write a python program to shift the negative to left and the
positive numbers to right so that the resultant list will look like :
[-5, -8, -9, 2, 3, 4, 6, 11]
Q4. Write a menu driven program to perform the
following operations on a list/array.
Q5)WRITE A PROGRAM TO CALCULATE SIMPLE
INTEREST WITH AND WITHOUT USING FUNCTION.

WITHOUT FUNCTION:

WITH FUNCTION:
Q6) WRITE A MENU DRIVEN PROGRAM TO CREATE
PATTERN
OUTPUT:
DATA FILE HANDLING
Q)WRITE A FUNCTION TO COUNT ME/MY IN PYTHON PRESENT IN A FILE.

Q2)WRITE A FUNCTION TO COUNT A OR M IN THE FILE.


Q3) Write a function in python to count the number of lines in a
text file '

Q4)Write a method/function DISPLAYWORDS() in python to read


lines from a text file, and display those words, which are less than
4 characters.
Q5. Write a function RevText() to read a text file " "
and Print only word starting with 'I' in reverse order

>>>Virat Kohli si an naidnI lanoitanretni cricketer who plays


Test and ODI cricket for the naidnI national team. A former
captain ni all formats of the game, Kohli retired from the T20I
format following s'aidnI win at the 2024 T20 World Cup. He's
a right-handed batsman and an occasional unorthodox right
arm quick bowler.
Q6. Write a function in python to count the number of lowercase
alphabets present in a text file .

Q7. Write a user-defined function named count() that will read


the contents of text file named and count the number of lines
which starts with either "I" or "M".
Q8. Write a function countmy() in Python to read the text file and
count the number of times "my" or "My" occurs in the file.

Q9. Write a user defined function countwords() in python to


count how many words are present in a text file named.
Q10)WRITE A USEER DEFINED FUNCTION TO REPLACE MY/ME
WITH MINE IN THE TEXT FILE.
11)Write a function result() to open a file "Student.txt" in write
mode. Store names of the five students along with the marks in
English, Maths and Computer Science in this file.
Q12. Write a function Multiple() in Python to create a text file
'Note.txt' to write few lines into it. If you don't want more lines
then enter 0(zero) to quit the function
Q13)Write a program that reads characters from the keyboard
one by one. All lower case characters get stored inside the file
LOWER, all upper case characters get stored inside the file UPPER
and all other characters get stored inside file OTHERS.
Q14. Write a program that copies a text file "notes.txt" onto
"target.txt" barring the lines starting with "@" sign.

You might also like