Learn From - Interactive SQL



Practice Simple SQL


You will find 7 Questions.

You will be using these questions to check your SQL Strength, by typing in the SQL yourself in the texteditor shown below and click the "View Result" button to view the output.

If you are new to SQL, we expect you to have gone through the Interactive SQL Basic and Interactive SQL Medium webpages.

You will be using the Employee Table "EmpInfo" shown below, for this practice.

EmployeeID EmployeeName City Designation Salary
1 Paul Henriot Madrid Sales Officer 5000.00
2 Hari Kumar Paris Sales Manager 7000.00
3 Yang Wang London HR 3500.00
4 Elizabeth Brown Seattle HR Manager 6500.00
5 Patricio Simpson London Software Engg 4500.00
6 Mary Smith Melbourne Software Engg 4500.00
7 Vinod Kumar Bangalore Software Engg 4500.00
8 Georg Pipps Madrid Sr. Software Engg 6500.00
9 Mary Brown San Francisco Sales Officer 5000.00

1. Display the EmployeeName, Designation, Salary from the EmpInfo Table.
Select EmployeeName, Designation, Salary from EmpInfo;
 
2. Display all the Employees who are from Madrid
Select * From EmpInfo where City = 'Madrid';
 
3. Display all the details for the Employees who are from London and Madrid
Select * From EmpInfo where City in ('London', 'Madrid');
 
4. Display all the details for the Employess who have salary 5000 and more
Select * From EmpInfo where salary >= 5000;
 
5. Display all the details for the Employees who have salary inbetween 3000 and 5500
Select * From EmpInfo where salary > 3000 and salary < 5500 ;
 
6. Display all the details for the Employess Names starting with Mary
Select * From EmpInfo where EmployeeName like 'Mary%';
 
7. Display all the details of the Employees for the Designation Ending with Manager
Select * From EmpInfo where Designation like '%Manager';
 

SQL in Text Editor: