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

bookChallenge: Student-Class Report with Defaults

Aufgabe

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.

Lösung

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 3. Kapitel 2
single

single

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

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

Swipe um das Menü anzuzeigen

Aufgabe

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.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 3. Kapitel 2
single

single

some-alt