title: Count Query Reciepe/Ingredients
body: <p>basically I've been working on an SQL question which is asking to display each ingredient along with the total number of recipes it's included in. It also must only include the ingredients that occur more than 10 times and descending order of ingredient popularity and ascending order of <code>ingrdesc</code>. </p>
  
  <p>the tables are as followed: </p>
  
  <pre><code>CREATE TABLE Ingredient
  (
  
  idI NUMBER              constraint pk_Ingredient PRIMARY KEY ,
  
  ingrDesc VARCHAR2(100)  constraint nn1Ingredient not null
  );
  
  
  CREATE TABLE Recipe
  (
  
  idR NUMBER                constraint pk_recipe PRIMARY KEY ,
  
  recipeTitle VARCHAR2(200)  constraint nn1Recipe not null,
  prepText VARCHAR2(4000),
  
  cuisineType VARCHAR2(50),
  mealType VARCHAR2(30) DEFAULT NULL,
  
  CONSTRAINT ch_mealType CHECK (mealType IN ('starter', 'main', 'dessert', null))
  );
  
  
  CREATE TABLE RecpIngr
  (
  
  idR NUMBER ,
  
  hidI NUMBER ,
  
  CONSTRAINT pk_RecpIngr PRIMARY KEY (idR, idI),
  
  CONSTRAINT fk1RecpIngr_recipe foreign key(idR) references Recipe,
  
  CONSTRAINT fk2RecpIngr_ingredient foreign key(idI) references Ingredient
  )
  organization index;
  </code></pre>
  
  <p>So far I have this query:</p>
  
  <pre><code>SELECT ingrDesc,
  COUNT (idR) As num_of_recipes
  FROM RespIngr
  WHERE num_of_recipes &lt;10
  ORDER BY num_of_recipes DES, ingrDes ASC;
  </code></pre>