100% found this document useful (1 vote)
449 views

Sample Table - Worker: Perform Following SQL Queries

The document contains 20 SQL queries to retrieve various information from a sample worker table with columns for worker ID, first name, last name, salary, joining date, and department. The queries include selecting specific columns, filtering rows by criteria on columns, aggregating results, sorting output, and retrieving metadata like current date and time.

Uploaded by

Neeraj Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
449 views

Sample Table - Worker: Perform Following SQL Queries

The document contains 20 SQL queries to retrieve various information from a sample worker table with columns for worker ID, first name, last name, salary, joining date, and department. The queries include selecting specific columns, filtering rows by criteria on columns, aggregating results, sorting output, and retrieving metadata like current date and time.

Uploaded by

Neeraj Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Sample Table – Worker

WORKER_ID FIRST_NAME LAST_NAME SALARY JOINING_DATE DEPARTMENT

001 Monika Arora 100000 2014-02-20 HR

002 Niharika Verma 80000 2014-06-11 Admin

003 Vishal Singhal 300000 2014-02-20 HR

004 Amitabh Singh 500000 2014-02-20 Admin

005 Vivek Bhati 500000 2014-06-11 Admin

006 Vipul Diwan 200000 2014-06-11 Account

007 Satish Kumar 75000 2014-01-20 Account

008 Geetika Chauhan 90000 2014-04-11 Admin

Perform following SQL Queries:

Q-1. Write An SQL Query To Fetch “FIRST_NAME” From Worker Table Using
The Alias Name As <WORKER_NAME>.
Q-2. Write An SQL Query To Fetch “FIRST_NAME” From Worker Table In
Upper Case.

Q-3. Write An SQL Query To Fetch Unique Values Of DEPARTMENT From


Worker Table.

Q-4. Write An SQL Query To Print The First Three Characters Of FIRST_NAME
From Worker Table.
Q-5. Write An SQL Query That Fetches The Unique Values Of DEPARTMENT
From Worker Table And Prints Its Length.
Q-6. Write An SQL Query To Print The FIRST_NAME From Worker Table After
Replacing „A‟ With „A‟.
Q-7. Write An SQL Query To Print The FIRST_NAME And LAST_NAME From
Worker Table Into A Single Column COMPLETE_NAME. A Space Char Should
Separate Them.
Q-8. Write An SQL Query To Print All Worker Details From The Worker Table
Order By FIRST_NAME Ascending.
Q-9. Write An SQL Query To Print All Worker Details From The Worker Table
Order By FIRST_NAME Ascending And DEPARTMENT Descending.
Q-10. Write An SQL Query To Print Details For Workers With The First Name As
“Vipul” And “Satish” From Worker Table.
Q-11. Write An SQL Query To Print Details Of Workers Excluding First Names,
“Vipul” And “Satish” From Worker Table.
Q-12. Write An SQL Query To Print Details Of Workers With DEPARTMENT
Name As “Admin”.
Q-13. Write An SQL Query To Print Details Of The Workers Whose
FIRST_NAME Contains „A‟.
Q-14. Write An SQL Query To Print Details Of The Workers Whose
FIRST_NAME Ends With „A‟.
Q-15. Write An SQL Query To Print Details Of The Workers Whose
FIRST_NAME Ends With „H‟ And Contains Six Alphabets.
Q-16. Write An SQL Query To Print Details Of The Workers Whose SALARY
Lies Between 100000 And 500000.
Q-17. Write An SQL Query To Print Details Of The Workers Who Have Joined In
Feb‟2014.
Q-18. Write An SQL Query To Fetch The Count Of Employees Working In The
Department „Admin‟.
Q-19. Write An SQL Query To Fetch Worker Names With Salaries >= 50000 And
<= 100000.
Q-20 Write An SQL Query To Show The Current Date And Time.

You might also like