w3resource

SQLite Exercise: Get first name from employees table after removing white spaces from both side

Write a query to get first name from employees table after removing white spaces from both side.

Sample table : employees


SQLite Code :

SELECT TRIM(first_name)
FROM employees;

Output:

TRIM(first_name)
----------------
Steven
Neena
Lex
Alexander
Bruce
David
Valli
Diana
Nancy
Daniel
John
Ismael
Jose Manuel
Luis
Den
Alexander
Shelli
Sigal
Guy
Karen
Matthew
Adam
Payam
Shanta
Kevin
Julia
Irene
James
Steven
Laura
Mozhe
James
TJ
Jason
Michael
Ki
Hazel
Renske
Stephen
John
Joshua
Trenna
Curtis
Randall
Peter
John
Karen
Alberto
Gerald
Eleni
Peter
David
Peter
Christopher
Nanette
Oliver
Janette
Patrick
Allan
Lindsey
Louise
Sarath
Clara
Danielle
Mattea
David
Sundar
Amit
Lisa
Harrison
Tayler
William
Elizabeth
Sundita
Ellen
Alyssa
Jonathon
Jack
Kimberely
Charles
Winston
Jean
Martha
Girard
Nandita
Alexis
Julia
Anthony
Kelly
Jennifer
Timothy
Randall
Sarah
Britney
Samuel
Vance
Alana
Kevin
Donald
Douglas
Jennifer
Michael
Pat
Susan
Hermann
Shelley
William

Practice SQLite Online


Model Database

Employee Model  Database - w3resource online SQLite practice

Structure of 'hr' database :

hr database

Improve this sample solution and post your code through Disqus.

Previous: Write a query to get the names (for example Ellen Abel, Sundar Ande etc.) of all the employees from employees table.
Next: Write a query to get the length of the employee names (first_name, last_name) from employees table.

What is the difficulty level of this exercise?



Share this Tutorial / Exercise on : Facebook and Twitter