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}
\]
The SELECT statement when combined with \(\_\_\_\_\_\_\) clause, returns records without repetition.
In SQL, the aggregate function which will display the cardinality of the table is \(\_\_\_\_\_\).
myStr = "MISSISSIPPI" print(myStr[:4] + "#" + myStr[-5:])
Read the following characteristics of retail trading carefully and choose the correct option:
I. This is concerned with the sale of goods directly to the consumers.
II. Most of the retail trading takes place in fixed establishments or stores.
III. It is formed by many middlemen, traders, and suppliers.
IV. Hawkers, street peddling, automatic vending machines, etc., are its examples.
Read the programmes related to the proposed Bharatmala umbrella scheme carefully and choose the correct option:
I. Backward areas, religious and tourist places connectivity programme
2. To interconnect the four metropolitan cities of the country
3. To develop State roads in adjoining coastal areas
4. To connect non-major ports in coastal states