The patient name on the wristband
The patient name on the wristband
You are a reports developer at a clinic. The patient wristband printer needs a single field with the full name: last name, first name and — when present — the middle name, separated by single spaces. Some patients have no middle name (NULL), and the band must contain no double or trailing spaces: the admissions scanner compares the name character by character.
Return columns:
- patient_id — patient id (integer);
- full_name — a string of the form 'Lastname Firstname Middlename' with a single space as separator; when the middle name is missing it simply does not participate (no stray trailing spaces).
Sorting: by full_name ascending, identical names ordered by patient_id ascending. Return all patients.
Exemplo de resposta esperada
É assim que se parece uma resposta correta: ela tem seu próprio número de linhas e não precisa coincidir com as tabelas do esquema. Sua resposta precisa retornar os mesmos nomes de colunas do exemplo: use AS para renomeá-las se for preciso.
| patient_id | full_name |
|---|---|
| 4 | Bauer Chris |
| 10 | Costa Bruno Miguel |
| 7 | Hansen Freja |
Entre para ver seu histórico de envios
EntrarEntre para usar o AI Mentor
Entrar