0% found this document useful (0 votes)
5 views

SQL questions for Beginner

SQL questions for Beginner

Uploaded by

Nikhil Akula
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

SQL questions for Beginner

SQL questions for Beginner

Uploaded by

Nikhil Akula
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

SQL – Beginner

1. Create two tables:


a. Employee – (Columns: EmpId(PK), EmployeeName, DepartmentName, DOB, DOJ,
SalaryAmount, PhoneNumber, IsActive)
b. EmployeeAddress – (Columns: AddressId(PK), EmpId(FK), Address1, Address2, City, State,
Zipcode, Country)
2. Insert data to the tables.
3. Select all the data from a table.
4. Select the data from Employee table where SalaryAmount is greater than 25,000.
5. Select all the data from Employee table whose belong to ‘Accounts’ or ‘Marketing’ department
and SalaryAmount is less than 50,000.
6. Select EmpId, EmployeeName, DepartmentName from Employee table where EmployeeName
starts with the letter ‘S’ or end with letter ‘S’.
7. Select EmpId, EmployeeName, DepartmentName from Employee table order by EmployeeName
in descending order(like – Z to A)
8. Select all the data from Employee table where PhoneNumber is NULL.
9. Select the name of 5 employee having lowest salary.
10. Find employee who have the maximum and the minimum salary.
11. Find total number of employees currently working in the organization (i.e. Column IsActive = 1)
12. Find the average salary and the total salary in Employee table.
13. Find the employees whose salary is between 25,000 to 70,000
14. Find EmpId, EmployeeName, DepartmentName, City, State, Zipcode, Country for all the
employees. (Display in a single table)
15. Find sum of total salary of each Department.
16. Update a data in Address table.

You might also like