0% found this document useful (0 votes)
3 views

Student_ip_file

The document outlines various programming tasks and SQL queries performed by a student named Bhavya H. Patel in Class 11 Science. It includes SQL queries on Employee and Student tables, as well as Python programs for mathematical operations and data handling. The document serves as a practical exercise in database management and programming skills.

Uploaded by

larefer842
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Student_ip_file

The document outlines various programming tasks and SQL queries performed by a student named Bhavya H. Patel in Class 11 Science. It includes SQL queries on Employee and Student tables, as well as Python programs for mathematical operations and data handling. The document serves as a practical exercise in database management and programming skills.

Uploaded by

larefer842
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Name: Bhavya .H.

Patel
th
Class: 11 Science
Roll Number: 4
Batch: 2024-2025
Index
Sr Name of program Page
No. No.

Q1 Perform SQL query on Employee Table 3-4


Q2 Perform SQL query on Student Table 1 4-6
Q3 Perform SQL query on Student table2
Q4 Program to find numbers that are divisible by 7 and
multiples of 5 between 1200 and 2200

Q5 Program to accept radius of circle and give area


Q6 Program to take input and add the two numbers
Q7 Program to Take input and check positive/negative and
odd/even
Q8 Program to take name, class, age and print 2 times in
one line and different respectively
Q9 Program to take input in km and convert to miles
Q10 Program to take input and swap 2 variables
Q11 Program to take input and find max number out of 3
SQL
Q1.Employee Table

mysql> desc bemp;

| Field | Type | Null | Key | Default | Extra |

| EmpNum | int(11) | YES | | NULL | |


| EmpNM | varchar(20) | YES | | NULL | |
| EmpADD | varchar(25) | YES | | NULL | |
| DEpartment | varchar(15) | YES | | NULL | |
1) Ascending Order

mysql> select EmpNM from bemp order by EmpNM;

| EmpNM |
| Dhanraj |
| Mahesh |
| Mamta |

2) 2 Columns
mysql> select EmpNM,DEpartment from bemp;

| EmpNM | DEpartment |
| Mahesh | RND |
| Dhanraj | Helper |
| Mamta | Politics |

3) Specific details

mysql> select * from bemp where EmpNum=101;

| EmpNum | EmpNM | EmpADD | DEpartment |


| 101 | Mahesh | Gurukul | RND
Q2.Student Table 1
mysql> desc student;
| Field | Type | Null | Key | Default | Extra |

| StudentID | int(11)| NO | PRI | NULL| |


| Class | varchar(20) | YES | | NULL| |
| Section | varchar(20) | YES | | NULL||
| Gender | varchar(20) | YES | | NULL||
| Name | varchar(20) | YES | | NULL| |
| DOB | date | YES | | NULL| |
| Marks | int(11) | YES | | NULL|

1)Entire table

mysql> select * from student;

| StudentID | Class | Section | Gender | Name | DOB |Marks|


|1 | 11 | Science | F | Ank | 2008-12-09 |80 |
|2 | 11 | Science | M | Bhavya | 2009-05-13 |90 |
|3 | 11 | Commerce | F | Divya | 2008-02-12 | 50 |
2) Marks>50
mysql> select Section, Marks from student where Marks>50;
| Section | Marks |
| Science | 80 |
| Science | 90 |

Q3.Student table2
mysql> desc student2;
| Field | Type | Null | Key | Default | Extra |

| StudentNO | int(11) | NO | PRI | NULL | |


| Class | int(11) | YES | | NULL | |
| Name | varchar(20) | YES | | NULL | |
| Game | varchar(20) | YES | | NULL | |
| Grade1 | varchar(1) | YES | | NULL | |
| SUPW | varchar(30) | YES | | NULL | |
| Grade2 | varchar(1) | YES | | NULL | |

1)Grade C

mysql> select Name from student2 where Grade1='C' or


Grade2='C';
| Name |

| Ank |
| Divya |
2)Games Offered
mysql> select Game from student2;
| Game |

| Tennis |
| Football |
| Cricket |

Python

Q1.program to find numbers that are divisble by 7 and


multiplesof 5 between 1200 and 2200

code:

for i in range(1200,2201,5):
if i % 7==0:
print(i)

output:
1225
1260
1295
1330
1365
1400
1435
1470
1505
1540
1575
1610
1645
1680
1715
1750
1785
1820
1855
1890
1925
1960
1995
2030
2065
2100
2135
2170
Q2. Accept radius of circle and give area

Code:

r=int(input("Enter radius of circle: "))


area= r*r*3.14
print("Area of circle is ",area)

Output:

Enter radius of circle:1


Area of circle is 3.14

Q3.Take input and add the two numbers

Program:

no1=int(input("Enter 1st number: "))


no2=int(input("Enter 2nd number: "))
sum = no1+no2
print("Sum is ",sum)

Output:
Enter 1st number: 1999
Enter 2nd number: 1
Sum is 2000

Q4.Take input and check positive/negtaive and odd/even

program:

n=int(input("Enter your number: "))


if n==0:
print("It is even but neither postive nor negative")
elif n>0 and n%2==1:
print(f"{n} is postivie odd")
elif n<0 and n%2==0:
print(f"{n} is negative even")
elif n>0 and n%2==0:
print(f"{n} is postivie even")
elif n<0 and n%2==1:
print(f"{n} is negative odd")
else:
print("Incoorect Input")

output:
Enter your number: 15
15 is postivie odd

Enter your number: -17


-17 is negative odd

Enter your number: 16


16 is postivie even

Enter your number: -290


-290 is negative even

Enter your number: 0


It is neither postive nor negative

Q5.take name,class,age and print 2 times in one line and


diffrent respectively

Code:
name=str(input("Enter Name: "))
Class=str(input("Enter Class: "))
age=int(input("Enter Age: "))
list=[name,Class,age]
print(f"Name is {name} of class {Class} and {age} years old")
for i in list:
print(i)

output:

Enter Name: Bhavya


Enter Class: 11
Enter Age: 15
Name is Bhavya of class 11 and 15 years old
Bhavya
11
15

Q6.covert input km to miles

Code:

km=float(input("Enter value in km(s): "))


print("Miles is ",km*0.621371)
Output:

Enter value in km(s): 10


Miles is 6.21371

Q7.Swap 2 variables

Code:

a,b=10,20
print("Before swap ",a," ",b)
a,b=b,a
print("After swap ",a,b)

Output:

Before swap 10 20
After swap 20 10
Q8.Max number out of 3

Code:

num1=int(input("Enter number 1: "))


num2=int(input("Enter number 2: "))
num3=int(input("Enter number 3: "))
if num1>num2 and num1>num3:
print(f"{num1} is maximum")
elif num2>num1 and num2>num3:
print(f"{num2} is maximum")
elif num3>num1 and num3>num2:
print(f"{num3} is maximum")
else:
print("Invalid input")

Output:

Enter number 1: 10
Enter number 2: 20
Enter number 3: 30
30 is maximum

You might also like