IT: Before a year in SQL

How to find something offered before a year in SQL:

Example: How many flavors of icecream were offered before 2000?

SELECT count (Ice_cream_flavor) from ICECREAM where year_first_offered  < ‘2000’;

Output:

SQL> SELECT count (Ice_cream_flavor) from ICECREAM where year_first_offered  < ‘2000’;

COUNT(ICE_CREAM_FLAVOR)

———————–

6

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