title: Why am I getting an error with this SQL script?
body: <p>This Is the question that I'm supposed to be answering:</p>
  
  <ol start="2">
  <li>Write a script that uses two variables to store (1) the count of all of the products in the Products table and (2) the average list price for those products. If the product count is greater than or equal to 7, the script should print a message that displays the values of both variables. Otherwise, the script should print a message that says, “The number of products is less than 7”.</li>
  </ol>
  
  <p>And here is my SQL statement:</p>
  
  <pre><code>USE MyGuitarShop;
  
  DECLARE @AllProduct2 INT;
  DECLARE @AvgAllListPrice MONEY;
  SET @AllProduct2 = (SELECT COUNT(ProductID) FROM Products);
  SET @AvgAllListPrice = (SELECT AVG (ListPrice) FROM Products);
  IF @AllProduct2 &gt; 7
      BEIGN
          PRINT 'The number of products is greater than or equal to 7';
          PRINT 'The average list price for the products is $' + CONVERT (varchar,@AvgAllListPrice,1);
      END;
  ELSE 
      PRINT 'The number of products is less than 7';
  </code></pre>
  
  <p>What am I doing wrong or what am I missing?</p>
  
  <p>EDIT</p>
  
  <p>Sorry for not adding the error:</p>
  
  <p>Msg 102, Level 15, State 1, Line 8
  Incorrect syntax near 'BEIGN'.
  Msg 102, Level 15, State 1, Line 11
  Incorrect syntax near ';'.</p>
  
  <p>I ended up fixing it by reworking my code:</p>
  
  <pre><code>    USE MyGuitarShop;
  
      DECLARE @AllProduct2 INT;
      DECLARE @AvgListPrice MONEY;
      SELECT @AllProduct2 = COUNT(ProductID),
      @AvgListPrice = AVG (ListPrice)
      FROM Products
      IF @AllProduct2 &gt; 7
          BEGIN
              PRINT 'The number of products is greater than or equal to 7';
              PRINT 'The average list price is $' + CONVERT (VARCHAR, @AvgListPrice,1) + '.';
          END;
      ELSE
          PRINT 'The number of products is less than 7';
  </code></pre>
  
  <p>Sorry again and thanks to those who helped me out!!!!!</p>