Firstly I am new to SQL, and I have trouble in setting up a simple stored procedure. I am learning SQL and need some help here.
Scenario:
-
I have two tables,
FruitsandOranges -
Fruitshas the following columns- fruitId
- fruitSeason
-
Orangeshas the following columns- organgesId
- fruitId
- orangeName
I want to create a stored procedure to return all Fruits along with an extra column count, this count will be total number of fruits id in Oranges.
Thanks
Try this:
Here is a live demo