title: SQL Server create a view from multiple tables with indirect referencing
body: <p>I have four tables:</p>
  <pre><code>CUSTOMER(CustomerId, CustomerName)
  SITE(SiteId, SiteName, CustomerId(FK ref CUSTOMER))
  TOOL(ToolId, ToolName, SiteId(FK ref SITE))
  TICKET(TicketId, Amount, ToolId(FK ref TOOL))
  </code></pre>
  <p>Key points:</p>
  <ul>
  <li>One customer can have multiple sites</li>
  <li>One tool belongs to only one customer, and will reside in only one site that belongs to that customer</li>
  </ul>
  <p>I want to create a view that looks like this:</p>
  <pre><code>VIEW_TICKETS(TicketId, Amount, CustomerName, SiteName, ToolName)
  </code></pre>
  <p>I understand that I can get the <code>ToolName</code>, for instance, by doing something like this:</p>
  <pre><code>CREATE VIEW ViewTicket
  AS
  SELECT TICKET.TicketId, TICKET.Amount, TOOL.ToolName
  FROM
  TICKET, TOOL
  WHERE
  TICKET.ToolId = TOOL.ToolId
  </code></pre>
  <p>But since in the <code>TICKET</code> table I don't have a direct reference to either <code>Customer</code> or <code>Site</code> tables, how can I get <code>SiteName</code> and <code>CustomerName</code> as well?</p>