title: To create a view using 5 tables with all columns of all tables
body: <p>I have to create a view that joins together all of the columns in the CUSTOMERS, ORDERS, ORDERDETAILS, EMPLOYEES, PAYMENTS and PRODUCTS tables.
  the schema for the table is below </p>
  
  <p><img src="https://i.stack.imgur.com/Xh7ZM.png" alt="schema for above tables"></p>
  
  <p>I tried the following query, though I am at a loss how to solve the above question :</p>
  
  <pre><code>create view     orders_view AS 
      select          *
      from            sys.customers c            
      left JOIN        EMPLOYEES e 
      on              c.SALESREPEMPLOYEENUMBER = e.EMPLOYEENUMBER    
      left join       sys.orders o     
      on              c.CUSTOMER NUMBER = o.CUSTOMERNUMBER
      left join       sys.orderdetails od
      on              o.ORDERNUMBER = od.ORDERNUMBER
      left join       sys.products p
      on              od.PRODUCTCODE = p.PRODUCTCODE
      left join       sys.PAYMENTS py
      on              c.CUSTOMERNUMBER = py.customernumber
  </code></pre>
  
  <p>I am a newbie with SQL and databases, so any help is appreciated.</p>