Page 24 - IPP-12-2025
P. 24
Write the output of the following SQL queries:
(a) SELECT NAME, EXPERIENCE FROM TEACHERS WHERE EXPERIENCE > 5;
(b) SELECT LENGTH(NAME) FROM TEACHERS WHERE SUBJECT = 'English';
(c) SELECT NAME, SUBJECT FROM TEACHERS WHERE SALARY BETWEEN 40000 AND 60000;
(d) SELECT MIN(EXPERIENCE) FROM TEACHERS;
Ans. (a) Select TOTAL AMOUNT from ORDERS whree ORDER_DATE<'2014–12–25';
(b) Select ITEM NAME from ORDERS where TOTAL_AMOUNT = (SELECT MAX(TOTAL_AMOUNT)
FROM ORDERS);
(c) Select ITEM_NAME, ORDER_ID, CUSTOMER_NAME from ORDERS group by ITEM_NAME;
(d) Select SUM(TOTAL_AMOUNT) from ORDERS where ORDER_ID<'01203';
Or
(a)
Name Experience
Mr Mohit Sharma 10
Ms Vandana Gupta 8
Mr Santosh Yadav 6
(b)
LENGTH(NAME)
17
(c)
Name Subject
Mr Neelam Singh 45000
Ms Vandana Gupta 55000
Mr Santosh Yadav 50000
(d)
MIN(EXPERIENCE)
3
Section E (3 × 5 = 15 Marks)
35. The Innovation Hub, a multinational corporation, is establishing a new office in Bengaluru with an IT
department, Sales department, HR department and Engineering department. Additionally, a regional office
in Hyderabad will be connected to the Bengaluru office for seamless communication and data sharing. As
a network expert, you have to propose solutions for queries that follow: [5]
BENGALURU HYDERABAD
IT Sales
HR Engineering
The shortest distances between the departments are as follows:
IT TO SALES 45 m
IT TO HR 50 m
SALES TO HR 65 m
IT TO ENGINEERING 55 m
BENGALURU TO HYDERABAD 574 km
M.21 Informatics Practices with Python–XII
40