Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Challenge: Student-Class Report with Defaults | Handling NULLs, Performance, and Real-World Join Scenarios
SQL Joins in Depth

bookChallenge: 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 students and classes tables based on the class_id.
  • Select the student's name from the students table.
  • Select the class name from the classes table, replacing any NULL values with 'Unassigned' using the COALESCE function.

Soluzione

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 3. Capitolo 2
single

single

Chieda ad AI

expand

Chieda ad AI

ChatGPT

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?

close

bookChallenge: 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 students and classes tables based on the class_id.
  • Select the student's name from the students table.
  • Select the class name from the classes table, replacing any NULL values with 'Unassigned' using the COALESCE function.

Soluzione

Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 3. Capitolo 2
single

single

some-alt