Using DECODE, write a query that checks the phone number of students. If the area code is 212, remove it. If it is anything else., put a 1- in front of the phone number. Display the student name and the phone number. If they have no phone number, display “No Phone”.
What will be an ideal response?
```
SELECT first_name||' '||last_name Student,
DECODE(SUBSTR(phone,1,3),'212',
SUBSTR(phone,5),
null, 'No phone',
'1-'||phone) Phone
FROM student```
Computer Science & Information Technology
You might also like to view...
Match the following file extensions with their descriptions:
I. .rtf II. .txt III. .docx IV. .htm V. .pptx A. file format of a Web document B. file format that retains structure and most formatting C. file format of Microsoft Word 2013 D. file format that retains only text, no formatting E. file format of Microsoft PowerPoint 2013
Computer Science & Information Technology
You can start the Task Manager by pressing Ctrl + Esc
Indicate whether the statement is true or false
Computer Science & Information Technology