SQL Coding Practice 2

 


The database consists of a

player
table that stores the
name
,
age
and
score
of players. In a real-world scenario, during a tournament, we often have to insert the details of multiple players at once, update already existing details, or retrieve specific player’s details to analyze.

This practice set helps you get a hang of all such queries. Let’s dive in!

1.

A new player has joined the tournament. Write an SQL query to add the the following details to the player table.

nameagescore
Raj26120

2.

Three new players have joined the tournament. Write a SQL query to add the the following details of players to the

player
table.

nameagescore
Ram28125
Charan25173
Ravan20152

3.

Get all the details of the players from the player table.

Expected Output Format:

nameagescore
Ram2410
Suresh219
---------

4.

Update the age of "Shyam" to 30 in the player table. Note: We can uniquely identify a player by name.


5.

Delete player "David" from the player table. Note: We can uniquely identify a player by name.


6.

We have to store the strike_rate of players in the database. Make necessary changes to the existing player table to store the data.

Note: Name the column as strike_rate. It is measured in decimals.


7.

Get name and ageof all the players from the player table.


8.

Rename the column name to full_name in the player table

9.

Delete player table from the database.

Post a Comment

Please Select Embedded Mode To Show The Comment System.*

Previous Post Next Post

Contact Form