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

Practical File Questions List (Xi) i.p.

The document contains a series of programming tasks and SQL queries related to various applications, including calculations, data handling, and flowchart creation. It covers programs for arithmetic operations, data input/output, and database management for hospital, student, teacher, club, graduate, sports, and lab data. Each program is designed to perform specific functions or queries, demonstrating basic programming and database concepts.
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)
15 views20 pages

Practical File Questions List (Xi) i.p.

The document contains a series of programming tasks and SQL queries related to various applications, including calculations, data handling, and flowchart creation. It covers programs for arithmetic operations, data input/output, and database management for hospital, student, teacher, club, graduate, sports, and lab data. Each program is designed to perform specific functions or queries, demonstrating basic programming and database concepts.
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/ 20

PROGRAM : 1

# Program to obtain three numbers and print their sum.

PROGRAM : 2

# Program to obtain length and breadth of a rectangle


and calculate its area.

PROGRAM : 3

# Program to get selling price and GST rate and then


print Invoice along with both CGST and SGST values.

PROGRAM : 4
# Program to calculate profit percentage from the sales
of goods that you made.

1
PROGRAM : 5

# Program to display output of following coding.

A,B,C,D = 9.2,2.0,4,21

print(A/4)

print(A//4)

print(B**C)

print(D//B)

print(A%C)

PROGRAM: 6

# Program to display given code.

ch=5 #integer
i=2 #integer
fl=4 #integer
db=5.0 #floating point number

2
fd=36.0 #floating point number
A=(ch+i)/db #expression 1
B=fd/db*ch/2 #expression 2
print(A)
print(B)

PROGRAM : 7

# Program to display given code.

a=5

b = -3

c = 25

d = -10

a+b+c>a+c-b*d

str(a + b + c > a + c - b * d)=='true'

len(str(a + b + c > a + c - b * d))==len(str(bool(1)))

3
PROGRAM : 8

# Program to display given code.

a = 3 + 5/8

b = int(3 + 5/8)

c = 3 + float(5/8)

d = 3 + float(5)/8

e = 3 + 5.0/8

f = int(3 + 5/8.0)

print(a,b,c,d,e,f)

PROGRAM : 9

# Program to calculate average investment cost per


share.

4
PROGRAM :10
# Program to display given code.

#computing FV from given data

PV = 100000

r = 5/100 #5% means 5/100

n = 12

FV = PV * (1+r)**n

print("Present Value : ",PV)

print("Rate of Interest :",(r*100), "%per month")

print("Numbers of periods :", n)

print("Future Value :", FV)

PROGRAM :11
# make flowchart take two number and show it is
divisible by second number or not?

5
# hint for program 11

Start

Input first number (f)

Input second number (s)

Remainder = f%s

Is Display the first no. Is


Remainder == 0 not divisible by the
second number
?

Display the first no. IS


divisible by the
second number

STOP 6
PROGRAM :12

# Program that takes a no. and checks whether the


given number is ODD or EVEN and make flowchart of it
also.

PROGRAM :13

# Program to accept three integers and print the


largest of the three and flowchart also.

PROGRAM :14
# Program that inputs three no. & calculate two sums .

PROGRAM :15
# Program to calculate the amount payable after sales
discount, which 10% up to the sales amount of 20000
and 17.5% on amount above that. There is sales tax
payable (in range 5-12%)at the discount price.

PROGRAM :16
7
# Program to print invoice for the sale of item “Amul
Butter 100 gms”, quantity 4 with price of one item as 45
rupees. Add tax @ 5%.

PROGRAM :17
# Program to display a menu for calculating simple
interest or compound interest . Calculate compound
nt
interest use: A = P(1 + r/n ) .

PROGRAM :18
# Program that reads two numbers and an arithmetic
operator and displays the computed results.

PROGRAM :19
# Program that reads three numbers and prints them in
ascending order.

PROGRAM :20
# Program to calculate total selling price after levying
the gst . Do calculate central gst and state gst .

8
cgst:Central govt gst;sgst:Sate govt.gst
SP:Selling price;item code

PROGRAM :21

# Program to print table of a number, say 5.

num = 5
for a in range(1,11):
print(num,'*',a,'=',num*a)

PROGRAM :22

# Program to print sum of natural numbers between 1


to 7 . Print the sum progressively, i.e.,after adding each
natural numbers , print sum so far.

PROGRAM :23

# Program to print sum of natural numbers between 1


to 7 .

9
PROGRAM :24

# Program to accept transactions made in a day an


items sold in a day for a week and then print average
sals made per transaction .

trans = transaction made in a daty ; items = itema sold in a day

PROGRAM :25

# Program to illustrate the difference between break


and continue statements.

PROGRAM :26

# Program to input some numbers repeatedly and print


there sum. The program ends when the users say no
more to enter or program aborts when the numbers
entered is less than zero.
PROGRAM :27

10
# Program that’s reads a string and checks whether it is
a palindrome string or not.

PROGRAM :28

# Program that’s reads a string and display the longest


substring of the string having just the consonants.

PROGRAM :29

# Program that’s reads a string and then prints a string


that capitalizes every other letter in the string .

PROGRAM :30

# Program that’s reads e-mail ID of a person in a form


of a string and ensures that it belongs to domain
@edupillar.com.

MySQL Queries
HOSPITAL
11
1. Write a command to create a HOSPITAL table.

2. Write a command to describe the structure of above


table.
3. To select all the information of patients of Cardiology
department.
4. To list the names of females patients who are in ENT
department .
5. To list names of all patints with their dates of
admission in ascending order.

6. To display Patient’s Name, Charges, Age of only


female patients.

7. To count the number of patients with Age <30.


8. Display the department wise total charges.

12
9. Display the department wise total charges whose
maximum charges more than equal to 300.

10. ADD ONE MORE COLUMN IN THE ABOVE TABLE AS


ADDRESS OF TYPE CHAR(20).
11. MODIFY THE COLUMN ADDRESS AS CHAR(25).

12. CHANGE THE ANME OF THE COLUMN ADDRESS


HOME_ADDRESS.

13. DROP THE COLUMN HOME_ADDRESS.

14. SELECT COUNT (DISTINCT CHARGES) FROM


HOSPITAL.

15. SELECT MIN(AGE) FROM HOSPITAL WHERE SEX =’F’;

16. SELECT SUM(CHARGES) FROM HOSPITAL WHERE


DEPARTMENT ='ENT';

13
17. SELECT AVG(CHARGES) FROM HOSPITAL WHERE
DATEOFADM<'2008-02-12';

STUDENT

a) To show all information about the students of study


department.
b) To list the names of female students who are in Hindi
department.
c) To list names of all students with their dateofadmission in
ascending order.

d) To count the number of student with age>23.


e) To insert a new row in the student table with the
following data.
9,'Zaheer',36,'Computer','1997-03-12',230,'M'

f) Give the output of the following SQL staments.[Include


the last inserted values in part (f)]

14
i. SELECT COUNT(DISTINCT DEPARTMENT) FROM STUDENT;

ii. SELECT MAX(AGE)FROM STUDENT WHERE SEX=’F’;

iii. SELECT AVG(FEES)FROM STUDENT WHERE SEX=’M’;

iv. SELECT SUM(FEES)FROM STUDENT WHERE


DATEOFADM<’1998-01-01’;

Teacher

a) To show all information about the teacher of history


department.

b) To list the name of female teachers who are in Maths


department.

15
c) To list names of all teachers along with their date of
joining in ascending order.

d) To display teacher’s name , Salary , Age for male


teachers only.
e) To count the number of teachers with age >23.
f) To insert a new row in the TEACHER table with the
following data.
9,'Raja',26,'Computer','1995-05-13',2300,'M'.

g) Give the output of the SQL statement:[include the last


inserted values in part(f)].

(i) SELECT COUNT(DISTINCT department) FROM TEACHER;

(ii) SELECT MAX(Age)FROM TEACHER WHERE SEX = 'F';

(iii) SELECT AVG(Salary)FROM TEACHER WHERE SEX = 'M’;

(iv) SELECT SUM(Salary)FROM TEACHER WHERE


DATEOFJOIN <’1996-07-12’;
CLUB

16
a) To show all information about the swimming coaches in
the club.
b) To list names of all coaches with their date of
appointment(dateofapp)in descending order.
c) To display a report showing coach name,pay,age and
bonus(15% of pay) for all the coaches;

d) To insert a new row in the club table with the following


data:
11,'RAJIV',40,'HOCKEY','2000-05-27',2006,'MALE'.
e) Give the output of the sql statement:[include the last
inserted value in part(d)].

(i) SELECT COUNT(DISTINCT SPORTS) FROM CLUB;

(ii) SELECT MIN(AGE)FROM CLUB WHERE SEX = 'F';

17
(iii) SELECT AVG(PAY)FROM CLUB WHERE SPORT =
'KARATE';

Graduate

(a) List the names of those students who have obtained


DIVI = 1 sorted by NAME.
(b) display the report, listing NAME,STIPEND,SUBJECT an
amount of stipend received in a year assuming that
the STIPEND is paid every month.
(c) To count the number of students who are either
PHYSICS or COMPUTER SC graduates.
(d) To insert a new row in the graduate TABLE:
11,'KAJOL',300,'COMPUTER SC',75,1
(e) Give the output of the following SQL statement based
on table GRADUATE
[Include the last inserted values in part (d)]

(i) SELECT MIN(AVERAGE) FROM GRADUATE


WHERE SUBJECT='PHYSICS';

18
(ii) SELECT SUM(STIPEND) FROM GRADUATE
WHERE DIVI=2

(iii) SELECT AVG(STIPEND) FROM GRADUATE


WHERE AVERAGE>=65

(iv) SELECT COUNT (DISTINCT SUBJECT)FROM


GRADUATE;

sports

a) Display names of the students who have grade ‘c’ in


either Game1 or Game2 or both.
b) Display the number of students getting grade A in
Cricket.

c) display the names of students who have same game for


both Game1 and Game2.
d) display the games taken up by the students , whose
name starts with ‘A’.

19
e) Add a new column named ‘Marks’.
f) Assign a value 200 for Marks for all those who are getting
grade B or grade ‘A’ in both Game1 and Game2.
g) Arrange the whole table in alphabetical order of Name.
lab

a) To select the ItemName purchased after 2007-10-31.

b) To list the ItemName, which are within Warranty period


till present date.
c) to list the ItemName in ascending order of the date of
purchase where quantity is more than 3.
d) To display the ItemName , CostPerItem , and quantity
whose Warranty is over.
e) To count the number of items whose cost is more than
10000.
f) To insert a new record in the Lab table with the following
data: 8,’VCR’, 10000,2, ‘2010-02-02’, 1, 2 .
g) Give the output : SELECT MIN(DISTINCT QUANTITY) FROM LAB;

20

You might also like