Write a postgre sql query that displays the first name and the character length of the first name for all employees whose name starts with the letters 'A', 'J' or 'M'. Give each column an appropriate label
All Answers
total answers (1)
total answers (1)
Sample table: employees
Output:
pg_exercises=# SELECT first_name "Name", pg_exercises-# LENGTH(first_name) "Length" pg_exercises-# FROM employees pg_exercises-# WHERE first_name LIKE 'J%' pg_exercises-# OR first_name LIKE 'M%' pg_exercises-# OR first_name LIKE 'A%' pg_exercises-# ORDER BY first_name ; Name | Length -------------+-------- Adam | 4 Alana | 5 Alberto | 7 Alexander | 9 Alexander | 9 Alexis | 6 Allan | 5 Alyssa | 6 Amit | 4 Anthony | 7 Jack | 4 James | 5 James | 5 Janette | 7 Jason | 5 Jean | 4 Jennifer | 8 Jennifer | 8 John | 4 John | 4 John | 4 Jonathon | 8 Jose Manuel | 11 Joshua | 6 Julia | 5 Julia | 5 Martha | 6 Mattea | 6 Matthew | 7 Michael | 7 Michael | 7 Mozhe | 5 (32 rows)need an explanation for this answer? contact us directly to get an explanation for this answer