ComeçarComece de graça

Junções internas (II)

Aqui, você vai continuar treinando suas habilidades com a INNER JOIN. Usaremos a tabela album como da última vez, mas vamos fazer a junção dela com uma nova tabela – artist – que consiste em duas colunas: artist_id e name.

Este exercício faz parte do curso

Introdução ao SQL Server

Ver curso

Instruções do exercício

  • Selecione as colunas album_id e title de album (nome da tabela de origem principal).
  • Selecione a coluna name de artist e chame-a de artist.
  • Identifique uma coluna em comum entre as tabelas album e artist e execute uma junção interna.

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

-- Select album_id and title from album, and name from artist
SELECT 
  ___,
  ___,
  ___ AS artist
  -- Enter the main source table name
FROM ___
  -- Perform the inner join
INNER JOIN ___ on ___.___ = ___.artist_id;
Editar e executar o código