IT: Average in SQL

So what is the benefit of SQL, also known as Oracle? Well you can keep track of your customers records easily for one thing. Second, it is secure, so no one, unless you give them permission, will access this information. Below you will see one of the basics of SQL.

How to give the average of something in SQL:

Example: Give the average scoop price of vanilla, almond, and Pistachio ice creams.

Output:

SQL> select avg (Price) from ICECREAM WHERE Ice_cream_flavor in(‘Vanilla’, ‘Almond’, ‘Pistachio’);

AVG(PRICE)

———-

2.66666667

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s