Ms. Veda created a table named Sports in a MySQL database, containing columns Game_id, P_Age, and G_name.
After creating the table, she realized that the attribute Category has to be added.
Help her to write a command to add the Category column.
Thereafter, write the command to insert the following record in the table: Game_id: G42 P\_Age: Above 18 G_name: Chess Category: Senior
-- Step 1: Add the Category column to the table
ALTER TABLE Sports ADD Category VARCHAR(20);
-- Step 2: Insert the given record into the table
INSERT INTO Sports (Game_id, P_Age, G_name, Category)
VALUES ("G42", "Above 18", "Chess", "Senior");
Explanation:
The ALTER TABLE statement is used to modify the structure of an existing table. The command ADD Category VARCHAR(20) adds a new column named Category with a data type of VARCHAR and a maximum length of 20 characters.
The INSERT INTO statement is used to add a new record to the table Sports. The column names and their corresponding values are specified.
The resulting table Sports will now include the record:
\[
\begin{array}{|c|c|c|c|}
\hline
\textbf{Game\_id} & \textbf{P\_Age} & \textbf{G\_name} & \textbf{Category} \\
\hline
G42 & Above 18 & Chess & Senior \\
\hline
\end{array}
\]
Write a Python program to accept 10 integers from the user. If the entered number is a three-digit even integer, push it onto a stack. After all inputs are taken, pop all the three-digit even integers from the stack and display them. For example, if the user enters 12, 31, 320, 457, 6, 92, 924, 220, 1, 218, then the stack should contain:
320, 924, 220, 218
and the output of the program should be:
218 220 924 320
A stack named FruitStack, implemented using list, contains records of some fruits. Each record is represented as a dictionary with keys 'Name', 'Origin', 'Price', and 'Expiry'. A sample record is given here:
{'Name':'Apple','Origin':'France','Price':120,'Expiry':'12-08-2025'}Write the following user-defined functions in Python to perform the specified operations on FruitStack:
(i) push_fruit(FruitStack, Fruit): This function takes the stack FruitStack and a new record Fruit as arguments and pushes the record stored in Fruit onto FruitStack if the Price is less than 100.
(ii) pop_fruit(FruitStack): This function pops the topmost record from the stack and returns it. If the stack is already empty, the function should display “UNDERFLOW”.
(iii) display(FruitStack): This function displays all the elements of the stack starting from the topmost element. If the stack is empty, the function should display 'EMPTY STACK'.
Sanjeevani is a big group of educational institutions with its head office in Hyderabad. It is planning to set up a new University in Amritsar. The Amritsar University Campus will have four blocks/buildings – ADMIN, ACADEMIC, HOSTEL, SPORTS. You, as a network expert, need to suggest the best network-related solutions for them to resolve the issues/problems mentioned in points (i) to (v), keeping in mind the distances between various blocks / buildings and other given parameters.
Block to Block distances (in Mtrs.):
| FROM | TO | DISTANCE |
|---|---|---|
| ADMIN | ACADEMIC | 60 M |
| ADMIN | HOSTEL | 160 M |
| ADMIN | SPORTS | 80 M |
| ACADEMIC | HOSTEL | 40 M |
| ACADEMIC | SPORTS | 120 M |
| HOSTEL | SPORTS | 150 M |
Distance of Hyderabad Head Office from Amritsar University Campus = 2000 km.
Number of computers in each block: ADMIN – 25, ACADEMIC – 600, HOSTEL – 120, SPORTS – 50.
NextStep is an organization which has a pool of resource persons to conduct training workshops on various topics related to ICT. The data of all its Resource Persons is stored in a binary file RESOURCES.DAT using the following record structure (each record is a tuple):
(R_ID, R_Name, R_Expertise, Charges)
where R_ID – Resource Person's ID (An integer); R_Name – Resource Person's Name (A string); R_Expertise – Area of expertise of the Resource Person; Charges – Charges (in rupees) per hour to conduct a workshop.
For example, a record in the file is:
(12, 'P. Velusami','Machine Learning',5000)In this context, write the following user defined functions in Python:
Assume that you are the Manager of the Loans department of a Finance House. To keep track of the loans you have created two tables: CUSTOMERS and LOANS. The sample data in these tables is given below:
Table: CUSTOMERS
| C_ID | C_Name | Phone |
|---|---|---|
| 00001 | Raj Malhotra | 1234567890 |
| 00003 | David Xavier | 3456789012 |
| 00004 | Damini Iyer | 3156789012 |
| 00008 | Abdul | 2345678901 |
Table: LOANS
| SNo | C_ID | L_Amt | L_Date | Terms | RoI |
|---|---|---|---|---|---|
| 1 | 00003 | 200000 | 2025-12-06 | 60 | 7.80 |
| 2 | 00008 | 2500000 | 2023-08-09 | 60 | 9.00 |
| 3 | 00001 | 500000 | 2025-08-13 | 48 | 6.00 |
| 4 | 00003 | 300000 | 2026-12-07 | 36 | 8.00 |
| 5 | 00004 | 600000 | 2026-12-07 | 60 | 6.00 |
Note: The tables may contain more records than shown here.
The management of the Finance House needs certain reports from you. Write the queries to extract the following data to create the reports:
Differentiate between 'w' and 'a' file modes in Python.
\[ \begin{array}{|c|c|c|c|} \hline \textbf{S\_id} & \textbf{S\_name} & \textbf{Address} & \textbf{S\_type} \\ \hline S001 & Sandhya & Rohini & Day Boarder \\ S002 & Vedanshi & Rohtak & Day Scholar \\ S003 & Vibhu & Raj Nagar & NULL \\ S004 & Atharva & Rampur & Day Boarder \\ \hline \end{array} \]
\[ \begin{array}{|c|c|c|} \hline \textbf{S\_id} & \textbf{Bus\_no} & \textbf{Stop\_name} \\ \hline S002 & TSS10 & Sarai Kale Khan \\ S004 & TSS12 & Sainik Vihar \\ S005 & TSS10 & Kamla Nagar \\ \hline \end{array} \]
Write a function, c_words(), in Python that separately counts and displays the number of uppercase and lowercase alphabets in a text file, Words.txt
Write a user-defined function in Python named Puzzle(W, N) which takes the argument W as an English word and N as an integer and returns the string where every Nth alphabet of the word W is replaced with an underscore ("_").
Example: If W contains the word "TELEVISION" and N is 3, then the function should return the string "TE_EV_SI_N". Likewise, for the word "TELEVISION" if N is 4, the function should return "TEL_VIS_ON".
Define the term web hosting.
Name any two web browsers.
(a) What is data protection?
(b) Mention any two precautionary measures one can take to avoid the risk of cybercrime.

The electric potential for various points in $x$-$y$ plane is given by $V = 1.0 x^2 - 2.0 y^2$, where $V$ is in volts and $x$, $y$ are in metres. The angle that the electric field at point $(2.0$ m$, 1.0$ m$)$ makes with the positive $x$-axis is: