Challenge: Student-Class Report with Defaults
Compito
Swipe to start coding
Write a query to generate a report listing each student's name and their class name. If a student does not have a class assigned, display 'Unassigned' instead of a NULL class name.
- Use a LEFT JOIN to combine the
studentsandclassestables based on theclass_id. - Select the student's name from the
studentstable. - Select the class name from the
classestable, replacing any NULL values with 'Unassigned' using the COALESCE function.
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 3. Capitolo 2
single
Chieda ad AI
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione
Suggested prompts:
Can you explain this in simpler terms?
What are the main benefits or drawbacks?
Can you give me a real-world example?
Fantastico!
Completion tasso migliorato a 4.76
Challenge: Student-Class Report with Defaults
Scorri per mostrare il menu
Compito
Swipe to start coding
Write a query to generate a report listing each student's name and their class name. If a student does not have a class assigned, display 'Unassigned' instead of a NULL class name.
- Use a LEFT JOIN to combine the
studentsandclassestables based on theclass_id. - Select the student's name from the
studentstable. - Select the class name from the
classestable, replacing any NULL values with 'Unassigned' using the COALESCE function.
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 3. Capitolo 2
single