SQL Training Data
SQL Training Data
be training_db)
3. to “SQL_Latin1_General_CP1_CI_AS”
columns column name “EID”, data type “int” should not allow null ,
9. WAQ to create a table with age field(column) which allows age values ranging
21 to 35.
table(tbl_empmaster).
tbl_empmaster.
14. WAQ to alter a table (tbl_empmaster) for adding Foreign key from
(tbl_departmentmaster) .
16. Write a query for combine FirstName and LastName and display it as "Name"
(also include white space between first name & last name)
17. Get all employee details from EmployeeDetail table whose "FirstName" contains
'k'
18. Get all employee detail from EmployeeDetail table whose "FirstName" start with
19. Get all employee detail from EmployeeDetail table whose "FirstName" not start
20. Get all employee detail from EmployeeDetail table whose "Gender" end with 'le'
23. Show "JoiningDate" in "dd mmm yyyy" format, ex "15 Feb 2013"
24. Get the first name, current date, joiningdate and diff between current date and
25. Get all employee details from EmployeeDetail table whose joining year is 2013.
26. Get all employee details from EmployeeDetail table whose joining date between
27. Select all employee detail with First name "Vikas","Ashish", and "Nikhil".
28. Display first name and Gender as M/F.(if male then M, if Female then F)
30. Write the query to get the department and department wise total(sum) salary,
31. Write the query to get the department, total no. of departments, total(sum) salary
32. Get department wise maximum salary from "EmployeeDetail" table order by
salary ascending
33. Write down the query to fetch Project name assign to more than one Employee
34. Get employee name, project name order by firstname from "EmployeeDetail" and
"ProjectDetail" for all employee even they have not assigned project
35. Write down the query to fetch EmployeeName & Project who has assign more
36. List each country name where the population is larger than that of 'Russia'.
37. Show the countries in Europe with a per capita GDP greater than 'United
Kingdom'.
38. List the name and continent of countries in the continents containing either
40. Which countries have a GDP greater than every country in Europe? [Give the
41. Find the largest country (by area) in each continent, show the continent, the name
42. List each continent and the name of the country that comes first alphabetically.
43. Find the continents where all countries have a population <= 25000000. Then find
the names of the countries associated with these continents. Show name,
44. Some countries have populations more than three times that of any of their
neighbours (in the same continent). Give the countries and continents.
45. Germany (population 80 million) has the largest population of the countries in
Germany.Show the name and the population of each country in Europe. Show the
46. show the matchid and player name for all goals scored by Germany. To identify
47. Show id, stadium, team1, team2 for just game 1012
48. Modify it to show the player, teamid, stadium and mdate and for every German
goal.
49. Show the team1, team2 and player for every goal scored by a player called Mario
50. Show player, teamid, coach, gtime for all goals scored in the first 10 minutes
51. List the the dates of the matches and the name of the team in which 'Fernando
52. List the player for every goal scored in a game where the stadium was 'National
Stadium, Warsaw'
53. Instead show the name of all players who scored a goal against Germany
55. Show the stadium and the number of goals scored in each stadium.
56. For every match involving 'POL', show the matchid, date and the number of goals
scored.
57. For every match where 'GER' scored, show matchid, match date and the number
58. Get First_Name from employee table using alias name “Employee Name”
64. Get FIRST_NAME from employee table after removing white spaces from right
side
65. Get FIRST_NAME from employee table after removing white spaces from left side
68. Get First_Name and Last_Name as single column from employee table separated
by a '_'
69. Get FIRST_NAME ,Joining year,Joining Month and Joining Date from employee
table
70. Get employee details from employee table whose employee name are “John”
and “Roy”
71. Get employee details from employee table whose employee name are not “John”
and “Roy”
72. Get employee details from employee table whose first name starts with 'J'
73. Get employee details from employee table whose first name contains 'o'
74. Get employee details from employee table whose first name ends with 'n'
75. Get employee details from employee table whose first name ends with 'n' and
76. Get employee details from employee table whose first name starts with 'J' and
77. Get employee details from employee table whose Salary in between 500000 and
800000
78. Get employee details from employee table whose joining year is “2013”
79. Get employee details from employee table who joined before January 1st 2013
80.