Podcast
Questions and Answers
What SQL command would you use to combine the FIRST_NAME and LAST_NAME into a single column?
What SQL command would you use to combine the FIRST_NAME and LAST_NAME into a single column?
Which SQL query correctly retrieves the count of employees in the 'Admin' department?
Which SQL query correctly retrieves the count of employees in the 'Admin' department?
What will be the output of the query 'SELECT FIRST_NAME FROM Worker WHERE FIRST_NAME LIKE '%a%';'?
What will be the output of the query 'SELECT FIRST_NAME FROM Worker WHERE FIRST_NAME LIKE '%a%';'?
Which SQL statement correctly orders all workers by FIRST_NAME ascending and DEPARTMENT descending?
Which SQL statement correctly orders all workers by FIRST_NAME ascending and DEPARTMENT descending?
Signup and view all the answers
Which SQL query fetches details for workers excluding first names 'Vipul' and 'Satish'?
Which SQL query fetches details for workers excluding first names 'Vipul' and 'Satish'?
Signup and view all the answers
Signup and view all the answers
Study Notes
SQL Queries for Worker Table
-
Query 1: Select the first name from the
Worker
table, aliased asWORKER_NAME
.-
SELECT FIRST_NAME AS WORKER_NAME FROM worker
-
-
Query 2: Select the first name from the
Worker
table in uppercase.-
SELECT UPPER(FIRST_NAME) FROM Worker
-
-
Query 3: Select unique department values from the
Worker
table.-
SELECT DISTINCT DEPARTMENT FROM Worker
-
-
Query 4: Concatenate first and last name into a single column
COMPLETE_NAME
, separated by a comma.-
SELECT CONCAT(FIRST_NAME, ', ', LAST_NAME) AS COMPLETE_NAME FROM Worker
-
-
Query 5: Select all worker details, ordered by first name ascending.
-
SELECT * FROM Worker ORDER BY FIRST_NAME ASC
-
-
Query 6: Select all worker details, ordered by first name ascending and department descending.
-
SELECT * FROM Worker ORDER BY FIRST_NAME ASC, DEPARTMENT DESC
-
-
Query 7: Select worker details where first name is "Vipul" or "Satish".
-
SELECT * FROM Worker WHERE FIRST_NAME = 'Vipul' OR FIRST_NAME = 'Satish'
-
-
Query 8: Select worker details excluding first names "Vipul" and "Satish".
-
SELECT * FROM Worker WHERE FIRST_NAME != 'Vipul' AND FIRST_NAME != 'Satish'
-
-
Query 9: Select worker details where first name contains "a".
-
SELECT * FROM Worker WHERE FIRST_NAME LIKE '%a%'
-
-
Query 10: Select worker details where salary is between 100000 and 500000.
-
SELECT * FROM Worker WHERE SALARY BETWEEN 100000 AND 500000
-
-
Query 11: Count employees in the "Admin" department.
-
SELECT COUNT(*) FROM Worker WHERE DEPARTMENT = 'Admin'
-
-
Query 12: Select the top 10 records from the
Worker
table.-
SELECT * FROM Worker LIMIT 10
-
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Test your knowledge of SQL with this quiz focusing on various queries related to the Worker table. Cover essential SELECT statements, including unique selections, string manipulation, and sorting. Challenge yourself with practical examples and improve your database skills.