19. Explain the terms Web page and Home Page.
Ans: Web Page: A Web Page is a part of a website and is commonly written in HTML. It can be accessed through a web browser.
Home Page: It is the first web page you see when you visit a website.
OR
Mention any four networking goals.
Ans: (i) Resource sharing
(ii) Reliability
(iii) Cost effective
(iv) Fast data sharing
20. Rashmi, a database administrator needs to display house wise total number of records of ‘Red’ and ‘Yellow’ house. She is encountering an error while executing the following query:
SELECT HOUSE, COUNT (*) FROM STUDENT GROUP BY HOUSE WHERE HOUSE=’RED’ OR HOUSE= ‘YELLOW’;
Help her in identifying the reason of the error and write the correct query by suggesting the possible correction (s).
Ans: The problem with the given SQL query is that WHERE clause should not be used with Group By clause.
To correct the error, HAVING clause should be used instead of WHERE.
Corrected Query:
SELECT HOUSE, COUNT(*) FROM STUDENT GROUP BY HOUSE HAVING HOUSE= ‘RED’ OR HOUSE=’YELLOW’;
21. What is the purpose of Order By clause in SQL? Explain with the help of suitable example.
Ans: Order By clause:
The ORDER BY command is used to sort the result set in ascending or descending order.
The following SQL statement displays all the customer’s names in alphabetical order:
SELECT Cname FROM Customers ORDER BY Cname;
22. Write a program to create a series object using a dictionary that stores the number of students in each house of class 12D of your school.
Note: Assume four house names are Beas, Chenab, Ravi and Satluj having 18, 2, 20, 18 students respectively and pandas library has been imported as pd.
Ans: St={‘Beas’ :18, ‘Chenab’ :20 , ‘ Ravi’ :20, ‘ Satluj’ :18}
S1=pd.Series(St)
23. List any four benefits of e-waste management.
Ans: (i) Saves the environment and natural resources
(ii) Allows for recovery of precious metals
(iii) Protects public health and water quality
(iv) Saves landfill space
OR
Mention any four net etiquettes.
Ans: (i) No copyright violation
(ii) Share the expertise with others on the internet
(iii) Avoid cyber bullying
(iv) Respect other’s privacy and diversity
24. What will be the output of the following code:
import pandas as pd
A=pd.Series(data=[35,45,55,40])
print(A>45)
Ans:
0 False
1 False
2 True
3 False
25. Carefully observe the following code:
import pandas as pd
Year1={'Q1':5000,'Q2':8000,'Q3':12000,'Q4': 18000}
Year2={'A' :13000,'B':14000,'C':12000}
totSales={1:Year1,2:Year2}
df=pd.DataFrame(totSales)
print(df)
Answer the following:
i. List the index of the DataFrame df
Ans: The index labels of df will include Q1,Q2,Q3,Q4,A,B,C
ii. List the column names of DataFrame df.