0

Provide an alphabetical list of students in area code 203. List student name in the format , . ( Example, LOCKE, J. ) followed by the phone number.

this is my SQL script

SELECT
CONCAT(UPPER(LAST_NAME) , UPPER(SUBSTR(FIRST_NAME, 1, 1))) AS "Student Name", PHONE
FROM
STUDENT s 
WHERE 
PHONE LIKE '203%'
ORDER BY 
LAST_NAME

The information I pulled from SQL is correct, I just need to fix the formatting to LASTNAME(space) FIRST INITIAL followed by period.

Any suggestions would be appreciated. I am still very new to SQL and programming.

I am using Oracle SQL

drum
  • 5,416
  • 7
  • 57
  • 91
  • you can concat a bunch of strings by using `||`. For example `LAST_NAME || ' ' || FIRST_NAME || '.'` – drum Jul 14 '22 at 01:27
  • SELECT UPPER(LAST_NAME) ||' '|| UPPER(SUBSTR(FIRST_NAME, 1, 1))||'.' AS "Student Name", PHONE FROM STUDENT s WHERE PHONE LIKE '203%' ORDER BY LAST_NAME It works perfectly. Thank you so much. – jamiegale21 Jul 14 '22 at 01:34

0 Answers0