Posts

Showing posts from January, 2021

Learn SQL with Cricket Data

Image
Here is the Sample Dataset of the Indian Batsman Table Name: Batsman Let’s start with the Basic Queries in SQL 1.Write a SQL query to retrieve all the records from a table Select * from Batsman; Output: 2. Write an SQL query to fetch “Player” from the Batsman table in the upper case Select upper(player) From Batsman; output: 3. SQL query to find the maximum runs from table ‘Batsman’ Select max (Runs) From Batsman; Output: 4. SQL query to find the minimum runs from table ‘Batsman’ Select min (Runs) From Batsman; output: 5 . SQL query to find the Average runs from table ‘Batsman’ select avg(Runs) From Batsman; Output: 6. Write an SQL query to print the first 5 characters of ‘Player’ from Batsman . select substring(Player,1,5) From batsman; output: 7. Write an SQL query to find the position of the alphabet (‘a’) in the Player_name column ‘Yuvraj singh’ from the Batsman table select INSTR(player,BINARY’a’) from Batsman where player = ‘yuvraj singh’ output: Tip: The INSTR method is case-se...