Write a python code to input three numbers and display the smallest number.
2. Write a python code to find the difference between Simple Interest and Compound Interest taking
principal, rate and time as inputs.
CI=A-P , where A = P(1+r/100)t
3. Write a python code to enter the three sides of a scalene triangle and calculate the area of the
scalene triangle by using the formula.
Area = 𝑠(𝑠 − 𝑎)(𝑠 − 𝑏)(𝑠 − 𝑐) where s= (a+b+c)/2
4 Write a python code to enter three sides of a triangle and check whether a triangle is possible or
not. If possible, then display whether the triangle is an equilateral, an isosceles or a scalene
triangle, other wise display ‘Triangle is not possible”.
5. In an examination, the grades are awarded to the students in ‘Science’ according to the average
marks obtained in the examination.
Marks Grades
80 per and above Distinction
Above 60 and less than 80 First Division
Above 45 and Less than 60 Second Division
Above 35 and less than 45 Third Division
Less than 35 Essential Repeat
Write a python code to input name of the student and his/her marks in physics, chemistry,
biology, English, hindi and social marks and grades obtained.
6 The electricity Board charges for electricity from their consumers according to the units consumed
(per month) as per the following tariff.
Units Consumed Charges
Up to 100 units Rs.4.80/- per unit
More than 100 units and upto 300 units Rs.6.30/- per unit
More than 300 and upto 500 units Rs.7.80/- per unit
More than 500 units 8.50/- per unit.
Write a python code to input the name of the consumer, consumer number, month and units
consumed. Calculate and display the electricity bill with all the details.
7. Write the codes in python to display the Sum of Series :-
1. 1, 4, 9, 16 ……………….. n
2. 0, 3, 8, 15, …………… n
3. 4, 8, 16, 32, ………………..n
4. 2, 5,10, 17, ………………n
8. Write a python code input any 50 numbers (including positive and negative) perform the following
tasks using menu driven program.
a) Count and display the positive numbers
b) Count and display the negative numbers.
c) Display the sum of positive numbers.
d) Display the sum of negative numbers.
e) Display the sum of all the numbers.
f) Display the sum of all odd numbers.
g) Display the sum of all even numbers.
h) EXIT
i)
9. Write a code in python to display the given pattern :-
1
12
123
1234
12345
10 Write a code in python to display the given pattern :-
1
35
579
7 9 11 13
9 11 13 15 17
11 Write a code in python to display the given pattern :-
1
12
123
1234
12345
12 Write a code in python to display the given pattern :-
1
10
101
1010
10101
13 What do you understand by DBMS?
14 Differentiate between the primary key and the candidate key.
15 What do you mean by
a) One-to- One Relation
b) One-to-Many Relation
c) Many-to-Many Relation
16 What do you mean by DDL, DML, DQL
17 A table ‘Employee’ is already created in a database and few records are also entered in the table.
The details of the table are shown below:-
Emp_Code Name Dept Salary Phone_No DOB
E001 Goutam Modak Elect 42000.00 01123537833 2002-05-04
E002 Ashim Das IT 48000.00 01127484673 2001-12-06
E003 Shivam IT 38000.00 01126534536 2001-07-11
E004 Vikram Jana Mech 41000.00 01123437454 2003-07-19
E005 Deepak Bhalla Elect 35000.00 01127443546 2002-03-11
Now, Perform the given tasks as directed :
a) Create a Database named ‘NMDC’.
b) Open a Database
c) Create the above table Name ‘Employee’.
d) Insert the above records.
e) Modify name of the employee with Emp_Code ‘E003’ to Shivam Gupta.
f) Increase the salary of all the employees who get less than Rs.40000 by Rs.2000.
g) Add the field Father Name after Name.
h) Display all the records.
i) Display all the records whose name is Deepak.
j) Display all the records whose name starts with “A”;
k) Display all the records whose salary in between 40000 to 60000.
l) Change the size of field Salary to double 14,2.
m) Delete the record whose date of birth is ‘2001-07-11’
n) Who to remove the database and table.
o) Display all the records whose names second letter ‘e’.
p) Display Name, Dept, Salary whose names second last letter is ‘a’.
q) Add the Field PF and calculate the PF is 12.5% of salary and add in the table.