What is the Coalesce statement in Sql?
Asked in the Technical interview stage. Write a PostgreSQL query that returns the first usable contact value for every employee, using the employee email when no usable preference exists.
employee_id, employee_name, and contact_email.Not provided when neither value exists.employee_id ascending.| Column | Type | Description |
|---|---|---|
| employee_idPK | INT | Unique employee identifier |
| employee_name | VARCHAR(100) | Employee display name |
| VARCHAR(255) | Default employee email address |
| Column | Type | Description |
|---|---|---|
| preference_idPK | INT | Unique contact preference identifier |
| employee_id | INT | Employee associated with the preference |
| preferred_email | VARCHAR(255) | Preferred email address, if supplied |