Last active
August 23, 2022 15:01
-
-
Save theabhayprajapati/3ad03272a3d92713241a79ab033ea3cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT Empno,FirstName,LastName, DeptId FROM Employee ORDER BY FirstName; | |
SELECT Empno,FirstName,LastName, DeptId FROM Employee ORDER BY LastName, FirstName; | |
SELECT Empno,FirstName,LastName, DeptId FROM Employee WHERE LastName LIKE '%H%'; | |
SELECT Empno,FirstName,LastName, DeptId FROM Employee WHERE SUBSTR(LastName,3,1) = 'H'; | |
SELECT DISTINCT City FROM Employee; | |
SELECT Empno,FirstName,LastName, DeptId FROM Employee WHERE Salary BETWEEN 30000 AND 45000; | |
SELECT Empno,FirstName,LastName, City FROM Employee WHERE City NOT IN ('Mumbai','Pune'); | |
SELECT DeptId, SUM(Salary), AVG(Salary), MAX(Salary), MIN(Salary) FROM Employee GROUP BY DeptId; | |
SELECT Empno, LOWER(FirstName), UPPER(LastName), SUBSTR(LastName,3,4) FROM Employee; | |
SELECT Empno, CONCAT(FirstName, ' ', LastName) AS Name FROM Employee; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Practical 3
Title : Working with Queries & Functions
Using already created employee and department tables write the following queries
arrange it in ascending order on the first name of the employee.
arrange it ascending order on the Last Name and then on First name of the
employee.
employees whose last name contain ‘H’.
employees whose 3rd character of the last name contain ‘H’.
employees whose salary is between 30000 and 45000.
employees who live in Mumbai or Pune.
employees who does not live in Mumbai or Pune.
and minimum salary.
capital letters and from last name 4 characters starting from 3rd character.
with the heading Name.