Write SQL statement to display the first name, last name, result for all ...

0 downloads 102 Views 343KB Size Report
Oct 28, 2014 - Write SQL statement to display the first name, last name, result for all employees, where, result = “Eq
Islamic University of Gaza Faculty of Engineering Computer Engineering Dept. Database Lab (ECOM 4113)

Quiz 2

Write SQL statement to display the first name, last name, result for all employees, where, result = “Equal”, if the first name and last name contains same number of characters. Else, result = “Not Equal”. Example:

Suggested Solution SELECT FIRST_NAME, LAST_NAME, NVL2 (NULLIF(LENGTH(FIRST_NAME), LENGTH(LAST_NAME)), 'NOT EQUAL', 'EQUAL') "Result" FROM EMPLOYEES;

October 28, 2014

Suggest Documents