Smell the coffee at ShopLK and Kernans special event

first_imgShopLK together with Kernans are hosting a special coffee evening at Kernans Bistro & Coffee House on October 17th. With the recent launch of their Go Green reusable cups, the team behind the environmental campaign, wanted to demonstrate just how easy it is to bring along reusable cups to your favourite coffee shops and cafes.The event will give attendees a taste of the great coffee blends and bakes available at Kernans and will also provide an insight into the Go Green campaign. Attendees will be treated to free coffee, tea, baked treats, free Go Green cups, music, prizes and more! Places are filling up so anyone who is interested in attending should register through the Eventbrite link, kernansgogreenwithshoplk.eventbrite.com.The team behind ShopLK, an initiative of Letterkenny Chamber, created the Go Green campaign with a focus on reducing waste in Letterkenny. In partnership with Letterkenny Tidy Towns, Go Green will play its part in keeping Letterkenny tidy, encouraging customers to #GoGreen in their everyday lives and promoting Letterkenny as a greener retail destination.The event at Kernans is just one of the ways that members of the community can learn about the campaign and receive a Go Green cup. The Go Green team have other exciting events and competitions in the pipeline, and these will be rolled out during the rest of 2019 and into 2020.Leonard Watson, President of Letterkenny Chamber supporting the initiative said “We’re very excited here at Letterkenny Chamber about our upcoming event at Kernans Bistro and Coffee House. It will be great to see members of the public getting into the routine of using our reusable cups. This will make a huge difference to the local area and to the wider community in the long run. “The newly renovated upstairs coffee area at Kernans is the perfect place to host our unique event. We’re delighted that Anthony and the Kernans team are working alongside us for this event and we hope that it will be a great success!”Check out the event page on Facebook for further details: https://www.facebook.com/events/1129964337209129/Toni Forrester, Cllr. John O’Donnell, Chairman of the Letterkenny Municipal Area, Leonard Watson, President of the Letterkenny Chamber and Deirdre McIntrye, Letterkenny Chamber.Smell the coffee at ShopLK and Kernans special event was last modified: October 1st, 2019 by StephenShare this:Click to share on Facebook (Opens in new window)Click to share on Twitter (Opens in new window)Click to share on LinkedIn (Opens in new window)Click to share on Reddit (Opens in new window)Click to share on Pocket (Opens in new window)Click to share on Telegram (Opens in new window)Click to share on WhatsApp (Opens in new window)Click to share on Skype (Opens in new window)Click to print (Opens in new window)last_img read more

College of the Redwoods pitcher Matt Becker signs on to play at Lewis-Clark State College

first_imgEureka >> Matt Becker has been a California kid his entire life.It doesn’t matter if it’s growing up and going to high school in Sonoma County or spending the past year in Humboldt County playing baseball, Becker has known nothing but what the West Coast has to offer.Come a few weeks from now, that will all soon change.Becker, who spent his sophomore season at College of the Redwoods and is currently playing for the Humboldt Crabs, signed a letter of intent on Thursday afternoon to play at …last_img read more

15 fantastic food and farm facts

first_imgShare Facebook Twitter Google + LinkedIn Pinterest Producing a bounty of food, fiber for clothes and renewable fuels for cars is a vast agricultural undertaking and one that few consumers today know much about. That’s not surprising, considering that most Americans are three or more generations removed from farming.Although most of us aren’t involved in full-time food production, it can still be fun – and educational – to ponder facts about how modern farmers and ranchers go about their work. That’s where Food and Farm Facts, a publication from the American Farm Bureau Foundation for Agriculture, comes in.“Food and Farm Facts provides the opportunity to learn about the many ways modern farmers produce food to meet the needs of today’s consumers,” explained Foundation Chairman Zippy Duvall, who also serves as president of the American Farm Bureau Federation.The 32-page, full-color book features hundreds of updated agriculture facts and easy-to-read infographics organized into sections: Consumers, Modern Farmers, Trade & Economics, Environment and Production.Fifteen fantastic facts about agriculture to whet your appetite for the Food and Farm Facts book are below.Ninety-nine percent of all U.S. farms are owned by individuals, family partnerships or family corporations.Farmers will have to grow 70 percent more food than what is currently produced to feed the world’s growing population by 2050.Each American farmer produces food and fiber for 165 people annually, both in the U.S. and abroad.Eight percent of U.S. farms market foods locally through farmers’ markets and food hubs.One day’s production for a high-producing dairy cow yields 10.5 pounds of cheese.Women make up 30 percent of today’s farmers.More than 20 percent of all farmers are beginning farmers.There are 257,454 millennial farmers.Texas has 248,809 farms, more than any other state in the nation.About 25 percent of all U.S. agricultural products by value are exported yearly.Careful stewardship by America’s farmers spurred a 44 percent decline in erosion of cropland by wind and water since 1982.One-third of the U.S. or 750 million acres, is covered with trees.Many of the products we use in our everyday lives are byproducts of food produced by America’s farmers and ranchers – everything from detergents and paints to X-ray film and crayons, textbooks, chalk and strings for musical instruments.An acre of land is about the same size as a football field.Biotechnology saved the Hawaiian papaya industry after a virus nearly wiped the crop out.Order the Food and Farm Facts book and related resources online.last_img read more

Punjab govt. has failed to check stray cattle menace: Akali Dal

first_imgAmid the increasing stray cattle menace in the State, the Shiromani Akali Dal has hit out at the Congress government, accusing it of failing to address the issue. SAD leader and former Minister Bikram Majithia on Saturday said the State government had failed to find a solution to stray animals, which are not just destroying crops but have also been the cause of several deaths in the State.‘Cow cess’“The government collects ‘cow cess’ and other taxes in the name of taking care of stray animals, but the problem continues to grow. All concrete steps taken by the previous SAD-BJP government to create and maintain gaushalas and cattle pounds have been withdrawn by this government,” he alleged.Mr. Majithia said that incidents of deaths due to stray animals were on the rise in the State in the last few months. ‘Farmers affected’ “Farmers are also at the receiving end with their fields being laid to waste across the State. Towns and cities are facing an acute crisis with the cattle roaming free and spoiling green belts, besides causing traffic hazards on the State highways,” he said.Asking the Congress government to wake up from its slumber, the Akali leader demanded development of stray cattle pounds, free power to gaushalas on the pattern of the previous SAD-BJP government and judicious use of ‘cow cess’ to tackle the problem.last_img read more

Is Your Online Marketing Strategy All Tweet and No Meat?

first_imgHow many times have you met somebody full of energy who gets you excited about something new — only to discover later that it was just a lot of talk and no action. All hat, no cattle .There’s a similar problem in social media: Marketers who are all tweet and no meat.At HubSpot we run into a lot of professional marketers and small business owners who are very excited about social media. They want 5,000 followers on Twitter, they want 10,000 fans on Facebook, and they want it all yesterday.Such enthusiasm is new, and it’s awesome. Just last summer, most marketers and small business owners still looked at social media as a playground for Kool-Aid drinking tech groupies.Now the  marketing ROI  of  inbound marketing  and social media is clear, and there’s a new problem: Many of the marketers and small business owners leaping into social media are forgetting the importance of other online marketing channels. This is a problem because social media works best in conjunction with a site that’s full of fresh content like  blog posts , white papers and videos.If your marketing strategy is just Twitter and Facebook — no longer-form content of your own — your company will end up a big-talking  cowboy without cattle . You’ll be making comments about everything, but substantive contributions to nothing.In pure business terms, there are two huge reasons social media needs to be mixed with original content: (1) To Drive People to Your Site — As a business, your goal is to drive leads and sales, which both happen on YourSite.com. In order to get people to YourSite.com, you have to make an investment in blogging,  content management  and  lead tracking  on that site. If your only investment is in Twitter or Facebook, the people you engage with there — no matter how much  they love you  — will never make it to YourSite.com to convert into leads and customers. (2) To Create an Archive With Long-Term SEO Value — If you’re only investing your time and resources in Facebook and Twitter, you’re not building any archive of persistent content. That’s a problem because your persistent content is what shows up in Google’s search results. Blog posts, white papers and videos posted on YourSite.com will get indexed by Google and drive people to become leads and customers for years. Posts on Twitter and Facebook don’t have nearly the same long-term search value.A marketers and salespeople, we’re prone to optimistic talk. But as we talk, we need to ask ourselves a key question: Is the talk accompanied by consistent value creation for our company?If you’re just doing social media, I think the answer is no. If that social media work is accompanied by content, I think the answer is yes.What do you think? How do you strike this balance?Photo:  Karyn  Webinar: Blogging for Business Originally published Mar 17, 2009 8:11:00 AM, updated February 01 2017 Topics: Want to learn more about publishing a blog on your business website? Download the free webinar to learn how to create a thriving inbound marketing blog.center_img Marketing Strategy Don’t forget to share this post! AddThis Sharing ButtonsShare to TwitterTwitterShare to FacebookFacebookShare to Email AppEmail AppShare to LinkedInLinkedInShare to MessengerMessengerShare to SlackSlacklast_img read more

When is the Best Time to Publish Blog Posts? [Infographic]

first_img on the topic. Based on over 170,000 blog posts I’ve created a visualization of the best times and days to post for views, links and comments. Click on the image below to see it full-size. Originally published Dec 8, 2010 5:51:00 PM, updated October 18 2015 For more data like this, be sure to Don’t forget to share this post! AddThis Sharing ButtonsShare to TwitterTwitterShare to FacebookFacebookShare to Email AppEmail AppShare to LinkedInLinkedInShare to MessengerMessengerShare to SlackSlack . In working on the data for mycenter_img big overarching post for ProBlogger Science of Blogging webinar tomorrow register for tomorrow’s webinar Over the past few years, I’ve researched and written a lot about the best time, and recently, I wrote a , one of the most important questions I could ask my data was “when is the best time to publish a blog post?”last_img read more

The 7 Slides You Need for an Epic Monthly Marketing Report

first_img Originally published Jan 27, 2012 9:00:00 AM, updated July 28 2017 Topics: Marketing Reporting Here’s a challenge for all you marketers who are on top of your game: How do you make sure your marketing team is taken seriously within your own company? One important step you should take is publishing a thorough, thoughtful, quantitative monthly report on your marketing team’s impact.For as long as there’s been marketing, marketers have struggled to show their impact. But today, there’s no need to struggle. Today, it’s simple to collect the data you need to show how your marketing investments are generating revenue for your business. You just have to pull together the right reports.At HubSpot, our marketing team creates a deck of over 200 slides each month to cover every last marketing detail. That’s extreme, and it might not be necessary for all companies. But what is important for all marketers is a core set of slides that reports on  inbound marketing  results. (Note the word “results.” We’re not showing what we did . We’re showing what we achieved .)So here are some of the core slides we use to report on our results. What do you think we’re missing? I’d love to hear about it in the comments! 1. Visits by Source This is your measure of the top of your funnel. It tells you, month-over-month, how many people are coming to your site, and how they got there. You can look at this slide quickly to see which marketing channels are driving your changes in overall traffic. (HubSpot customers can find this report in Sources .) 2. Leads by Source This is your measure of your middle-of-the-funnel (MOFU) activity. This slide answers the questions, “How many leads did we generate, and which channels did they come from?” You can use this report to track month-over-month changes in lead volume and to figure out ways to improve the results. For example, if you’re generating a lot of traffic to your blog articles , but you aren’t converting any leads there, you should experiment with different ways to improve blog page conversions. Maybe you need better calls-to-action (CTAs). Or maybe you need better blog offers. Whatever the root of the problem, this report can help identify its location and help you understand where to dive into the details and diagnose. (HubSpot customers can get this report in Sources .) 3. Funnel Summary This is an overall view of your marketing funnel that shows you the five most important metrics —visits over time, leads over time, customers over time, visit-to-customer conversion over time, and lead-to-customer conversion over time. This data gives you a great overall sense of your marketing team’s performance. (HubSpot customers can get this data from  Sources .) 4. Paid vs. Organic Leads This view helps you show how much of your lead flow is coming from paid campaigns and how much is coming from organic inbound marketing. If you’re trying to build an inbound marketing machine and keep your paid spend down, this slide can help you track your progress.   (HubSpot customers can get this data from  Sources  by exporting and aggregating all their organic campaigns, then comparing that to their paid campaigns.) 5. Top Blog Posts by Page View This slide helps you keep track of the content that’s engaging your community. This knowledge should help you refine your blog articles to generate even more traffic, and to refine your overall marketing strategy to better reach your target personas. ( HubSpot customers can find this data in their monthly report or Blog Analytics .) 6. Top Landing Pages by Leads This slide shows you which offers and landing pages are generating the most leads. You should know this information and constantly be testing new offers and landing pages in order to create new leaders generating even more leads. (HubSpot customers can see this in their Landing Page Dashboard .) 7. Lead Speed to Your Event This is a way to measure lead quality. In other words, how good are the leads that you’re sending to your sales team? If there isn’t much time before your leads convert into an event, the marketing team is doing a good job. If your leads take a while to convert, you need to do a better job nurturing your leads . (HubSpot customers can get this data from a CRM like Salesforce.com when it’s integrated with HubSpot.) Bonus for HubSpot customers! Most of these slides are already being created for you. Keep an eye out for a personalized monthly report that gets sent to you at the beginning of each month. The report contains a link to download a PowerPoint version of your own monthly report. Make sure you’re using it! What other marketing data do you report on for the rest of your company? Image Credit: SqueakyMarmot Don’t forget to share this post! AddThis Sharing ButtonsShare to TwitterTwitterShare to FacebookFacebookShare to Email AppEmail AppShare to LinkedInLinkedInShare to MessengerMessengerShare to SlackSlacklast_img read more

Twitter Launches More Robust Targeting for Promoted Tweets

first_img Originally published Sep 6, 2012 4:30:00 PM, updated October 20 2016 Once you select the interests you want to target, you can carry on with the rest of the campaign as you normally would, including tweet selection and budget. Don’t forget to share this post! AddThis Sharing ButtonsShare to TwitterTwitterShare to FacebookFacebookShare to Email AppEmail AppShare to LinkedInLinkedInShare to MessengerMessengerShare to SlackSlack Keep in mind you can also target people, not just companies. Thought leaders who are very influential in your space — like bloggers, authors, and social media personalities — are likely to have followers that are similar to your target audience!Do you plan on using Twitter’s latest promoted tweet update?Image credit: lucianvenutian Topics: Pretty easy, huh? Now, let’s learn how to target your promoted tweets by specific usernames.Target Twitter Users by UsernameLet’s start by clearing up one misconception about targeting promoted tweets by username: When targeting specific usernames, you’re not making your promoted tweets visible to people who follow that specific username. Instead, Twitter determines other usernames that are similar to the username you selected, and promotes your tweets to those people.Why is this the case? Well, let’s say you want to target people who like cooking shows, so you enter in the username @homecookingchannel. You want your reach to be as large as possible … but only as far as it includes people who are actually interested in cooking. Therefore, Twitter isn’t just going to promote your tweets to everyone who follows @homecookingchannel. They’re going to promote your tweets to everyone who follows @homecookingchannel that actually cares about cooking (not, you know, the account holder’s dad who just followed because he was told to). From there, Twitter will look at other users who may not follow @homecookingchannel, but exhibit the same care for cooking based on the content they share, and promote your tweets to those usernames, too.You may be wondering how Twitter finds the people to target your promoted tweets to. Well, because this targeting method is for timelines and not specific search terms, it’s a little unclear how a person on Twitter’s interests are determined. But we do know that Twitter’s algorithm uses the topics discussed on Twitter, keywords uses, and followers of each person to determine if they are a good fit for your timeline campaign. So if someone’s tweeting about their favorite quinoa recipes, Twitter knows they’re probably a good fit for @homecookingchannel promoted tweets.Let’s go through one more example to clarify this. Let’s say you’re interested in promoting your tweets to marketers. With this new feature, you could target your campaign at people who are similar to the followers of the username @HubSpot. Why? Because HubSpot is known as a thought leader in the marketing industry, so a large amount of our followers are likely to be marketers. Additionally, people who are similar to our followers are also likely to be marketers, and Twitter can tell based on whether they’re actually talking about marketing on Twitter. Here, you can look through general interests, and drill down into more detail to the right. Twitter Updates Last week, Twitter launched a new update to their promoted tweets that should get marketers pretty pumped. Now, you can target your promoted tweets to users based on their interests. Pretty groovy, eh?Before this launch, people were able to promote tweets in timelines, search results and profiles. Targeting a specific search term, however, was the only way an advertiser could control who saw their tweets. That left the rest of their promoted tweets to be targeted to “followers,” “people like my followers,” or everyone. No more! Now Twitter advertisers can show promoted posts to the people they are actually interested in targeting.There are two ways this new update can be used: You can target by interests, or you can target specific @usernames. Here’s how to do both.Target Twitter Users by InterestBefore we get into logistics, ask yourself … do you know what your target audience’s interests are? If not, you might need to do a little brushing up of your buyer personas.Great, glad that’s taken care of. So, you want to target Twitters users with promoted tweets based on their interests? Makes sense — greater relevancy should increase the effectiveness of your promoted tweets! Twitter determines interests based on what the user is talking about, following, and the keywords used. To utilize this feature, you must first click on “Browse Interests.”last_img read more

Would You Dare Advertise on Reddit?

first_imgFor marketers, Reddit has a lot of things going for it: most notably, an audience that’s both young and huge. Last month, Reddit drew 71 million unique visitors who viewed 4.8 billion pages. Their big challenge, however, is to find a way to make money from that audience without driving it away. Lately Reddit has been experimenting with a new sponsored content campaign in which Reddit creates original video content based on ideas generated by Reddit users. The program has won praise from Edelman content chief Steve Rubel, who writes in AdAge, “The internet isn’t TV, and Reddit knows that and has an approach to original content that might just work if it can stick to what made it a success. Reddit knows that the best way for marketers to get involved is not just through content, but conversation.”The first attempt in content creation is “Explain Like I’m Five,” a series of videos inspired by a subreddit of the same name. (A subreddit is what Reddit calls a topic-specific domain. There are about 5,000 active user-generated subreddits on Reddit.) The videos are sponsored by DonorsChoose, a charity that helps teachers get supplies for their classrooms.The video series, which takes complex topics and explains them to 5-year-olds, is hosted on Reddit’s YouTube channel, aggregated on the DonorsChoose website, and promoted on the ‘Explain Like I’m Five’ subreddit — in an effort to motivate Reddit users to donate to the charity. Reddit even asks its community to contribute ideas for scripts for new videos. Here’s one video:Reddit is trying to identify other subreddits that could lend themselves to being turned into original programming. Next up for a video treatment is a subreddit called “Crazy Ideas,” says Reddit General Manager Erik Martin. Martin says that, for now, Reddit sees the idea as experimental and isn’t selling it in a big way. “There are maybe a few brands we would work with. But it needs to be the right idea and the right sponsor,” he says.As Rubel points out, Reddit’s challenge will be to add mainstream advertisers to its mix without losing its edge and turning off its audience.To be sure, this is the same challenge most user-generated sites confront as they try to attract advertisers (e.g. concerns about porn on Tumblr, or the recent scandal where advertisers suspended Facebook campaigns because of offensive content). But even in the anything-goes world of user-generated content, Reddit pushes the limits. The site contains a huge amount of stuff that could be called “not safe for work.”The trick — for Reddit and for marketers — will be to reach the attractive parts of the Reddit universe and steer clear of the less savory elements. Whether it can be done remains to be seen. Martin points out that “the vast majority of content on Reddit is [safe for work],” and that advertisers can target content that’s safe and be sure that their ads will not run next to racy content.Also, keep in mind that getting in early will have an extra benefit — your brand could get pulled along in all the coverage about the Reddit program. DonorsChoose got mentioned in the Steve Rubel article in AdAge, and this one here on the HubSpot blog, as well as here on a teaching blog, here on Entertainment Weekly, and here on Mediabistro.Thoughts on Reddit’s new sponsored content program? Topics: Don’t forget to share this post! AddThis Sharing ButtonsShare to TwitterTwitterShare to FacebookFacebookShare to Email AppEmail AppShare to LinkedInLinkedInShare to MessengerMessengerShare to SlackSlack Originally published Jun 4, 2013 4:00:00 PM, updated February 01 2017 Native Advertisinglast_img read more

An Introductory SQL Tutorial: How to Write Simple Queries

first_imgEver heard of the computer language called SQL? You may have heard about it in the context of data analysis, but never really thought it would apply to you as a marketer. Or, you may have thought to yourself, “That’s for the really advanced data users. I could never do that.”Well, you couldn’t be more wrong! The most successful marketers are data-driven, and one of the most important parts of being data-driven is being able to collect data from databases quickly. SQL happens to be one of the best and most popular tools out there for doing just that.Download 9 Free Excel Templates for MarketersSQL stands for Structured Query Language, and it’s used when companies have a ton of data that they want to manipulate in an easy and quick way. If your company already stores data in a database, you may need to learn SQL to access the data. But not to worry — you’re in the right place to get started!Before we begin, make sure that you have a database management application that will allow you to pull data from your database. Some options include MySQL Workbench or Sequel Pro. Start by downloading one of these options, and then talk to your company about how to connect to your database. The option that you choose will depend on your product’s backend, so check with your product team to make sure you select the correct one.Let’s jump right in.Why Use SQL?The beauty of SQL is that anyone working at a company that stores data in a relational database can use it. (And chances are, yours does.)If you work for a software company and want to pull usage data on your customers, you can do that using SQL. If you work for an ecommerce company that has data about customer purchases, you can use SQL to find out which customers are purchasing which products. Of course, these are just a few of many, many examples.Think about it this way: Have you ever opened a very large data set in Excel, only for your computer to freeze or even shut down? SQL allows you to access only certain parts of your data at a time so you don’t have to download the data into a CSV, manipulate it, and possibly overload Excel. In other words, SQL takes care of the data analysis that you may be used to doing in Excel. (If you want to dig into this aspect of SQL a bit more, here is a blog post to get you started.)How to Write Simple SQL QueriesUnderstand the hierarchy of your databaseBefore you get started, it’s important to become accustomed to your database and its hierarchy. If you have multiple databases of data, you’ll need to zero in on the location of the data you want to work with.For example, let’s pretend we’re working with multiple databases about people in the United States. Type in the query “SHOW DATABASES;”. Our results may show that you have a couple of databases for different locations, including one for New England.Within your database, you’ll have different tables containing the data you want to work with. Using the same example above, let’s say we want to find out which information is contained in one of the databases. If we use the query “SHOW TABLES in NewEngland;”, we’ll find that we have tables for each state in New England: people_connecticut, people_maine, people_massachusetts, people_newhampshire, people_rhodeisland, and people_vermont.Finally, you need to find out which fields are in the tables. Fields are the specific pieces of data that you can pull from your database. For example, if you want to pull someone’s address, the field name may not just be “address” — it may be separated into address_city, address_state, address_zip. In order to figure this out, use the query “Describe people_massachusetts;”. That will provide a list of all of the data that you can pull using SQL.Let’s do a quick review of the hierarchy using our New England example:Our database is: NewEngland.Our tables within that database are: people_connecticut, people_maine, people_massachusetts, people_newhampshire, people_rhodeisland, and people_vermont.Our fields within the people_massachusetts table include: address_city, address_state, address_zip, hair_color, first_name, and last_name.Now, to learn how to write a simple SQL query, let’s use the following example:Who are the people who have red hair in Massachusetts and were born in 2003 organized in alphabetical order?SELECTSELECT chooses the fields that you want displayed in your chart. This is the specific piece of information that you want to pull from your database. In the example above, we want to find the people who fit the rest of the criteria.Here is our SQL query:SELECT     first_name,     last_nameFROMFROM pinpoints the table that you want to pull the data from. In the earlier section, we found that there were six tables for each of the six states in New England: people_connecticut, people_maine, people_massachusetts, people_newhampshire, people_rhodeisland, and people_vermont. Because we’re looking for people in Massachusetts specifically, we’ll pull data from that specific table.Here is our SQL query:SELECT     first_name,     last_nameFROM     people_massachusettsWHEREWHERE allows you to filter your query to be more specific. In our example, we want to filter our query to include only people with red hair who were born in 2003. Let’s start with the red hair filter.Here is our SQL query:SELECT     first_name,     last_nameFROM     people_massachusettsWHERE     hair_color = “red”hair_color could have been part of your initial SELECT statement if you’d wanted to look at all of the people in Massachusetts along with their specific hair color. But if you want to filter to see only people with red hair, you can do so in the WHERE statement.ANDAND allows you to add additional criteria to your WHERE statement. Remember, we want to filter by people who had red hair in addition to people who were born in 2003. Since our WHERE statement is taken up by the red hair criteria, how can we filter by a specific year of birth as well?That’s where the AND statement comes in. In this case, the AND statement is a date property — but it doesn’t necessary have to be. (Note: Be to check the format of your dates with your product team to make sure it is in the correct format.)Here is our SQL query:SELECT     first_name,     last_nameFROM     people_massachusettsWHERE     hair_color = “red”AND     birth_date BETWEEN ‘2003-01-01’ AND ‘2003-12-31’ORDER BYWhen you create SQL queries, you shouldn’t have to export the data to Excel. The calculation and organization should be done within the query. That’s where the “ORDER BY” and “GROUP BY” functions come in. First, we’ll look at our SQL queries with the ORDER BY and then GROUP BY functions, respectively. Then, we’ll take a brief look at the difference between the two.Your ORDER BY clause will allow you to sort by any of the fields that you have specified in the SELECT statement. In this case, let’s order by last name.Here is our SQL query:SELECT     first_name,     last_nameFROM     people_massachusettsWHERE     hair_color = “red”AND     birth_date BETWEEN ‘2003-01-01’ AND ‘2003-12-31’ORDER BY     last_name;GROUP BY”GROUP BY” is similar to “ORDER BY,” but it will aggregate data that has similarities. For example, if you have any duplicates in your data, iyou can use “GROUP BY” to count the number of duplicates in your fields.Here is your SQL query:SELECT     first_name,     last_nameFROM     people_massachusettsWHERE     hair_color = “red”AND     birth_date BETWEEN ‘2003-01-01’ AND ‘2003-12-31’GROUP BY     last_name;ORDER BY VS. GROUP BYTo clearly show you the difference between an “ORDER BY” statement and a “GROUP BY” statement, let’s step outside our Massachusetts example briefly to look at a very simple dataset. Below is a list of four employees’ ID numbers and names.If we were to use an ORDER BY statement on this list, the names of the employees would get sorted in alphabetical order. The results would look like this:If we were to use a GROUP BY statement, the employees would be counted based on the number of times they appeared in the initial table. Note that Peter appeared twice in the initial table. The results would look like this:With me so far? Okay. Let’s return to the SQL query we’ve been creating about red-haired people in Massachusetts who were born in 2003.LIMITDepending on the amount of data you have in your database, it may take a long time to run the queries. It can be frustrating if you find yourself waiting a long time to run a query that you didn’t really want to begin with. If you want to test our query, the LIMIT function is a great one to use because it allows you to limit the number of results you get.For example, if we suspect there are millions of people who have red hair in Massachusetts, we may want to test out our query using LIMIT before we run it in full to make sure we’re getting the information we want. Let’s say, for instance, we only want to see the first 100 people.Here is our SQL query:SELECT     first_name,     last_nameFROM     people_massachusettsWHERE     hair_color = “red”AND     birth_date BETWEEN ‘2003-01-01’ AND ‘2003-12-31’ORDER BY     last_nameLIMIT     100;That’s it for the basics!Feeling good? Here are a few other ways to take your SQL queries up a notch.Bonus: Advanced SQL TipsNow that you have mastered how to create a SQL query, let’s walk through some other tricks that you can use to take it up a notch, starting with the asterisk.*When you add an asterisk to one of your SQL queries, it tells the query that you want to include all the columns of data in your results. In the example we’ve been using, we’ve only had two column names: first_name and last_name. But let’s say we had 15 columns’ worth of data that we want to see in our results — it would be kind of a pain to type out all 15 column names in the SELECT statement. Instead, if you replace the names of those columns with an asterisk, the query will know to pull all of the columns in to the results.Here’s what the SQL query would look like:SELECT     *FROM     people_massachusettsWHERE     hair_color = “red”AND     birth_date BETWEEN ‘2003-01-01’ AND ‘2003-12-31’ORDER BY     last_nameLIMIT     100;LAST 30 DAYSOnce I started using SQL regularly, I found that one of my go-to queries involved trying to find which people took an action or fulfilled a certain set of criteria within the last 30 days. Since this type of query was so useful for me, I wanted to share that capability with you.Let’s pretend today is December 1, 2014. You could create these parameters by making the birth_date span between November 1, 2014 and November 30, 2014. That SQL query would look like this:SELECT     first_name,     last_nameFROM     people_massachusettsWHERE     hair_color = “red”AND     birth_date BETWEEN ‘2014-11-01’ AND ‘2014-11-30’ORDER BY     last_nameLIMIT     100;But that would require thinking about which dates cover the last 30 days, and it would mean you’d have to constantly update this query. Instead, to make the dates automatically span the last 30 days no matter which day it is, you can type this under AND: birth_date >= (DATE_SUB(CURDATE(),INTERVAL 30.(Note: You’ll want to double-check this syntax with your product team because it may differ based on the software you use to pull your SQL queries.)Your SQL query would therefore look like this:SELECT     first_name,     last_nameFROM     people_massachusettsWHERE     hair_color = “red”AND     birth_date >= (DATE_SUB(CURDATE(),INTERVAL 30))ORDER BY     last_nameLIMIT     100;COUNTIn some cases, you may want to count the number of times that a criterium of a field appears. For example, let’s say you want to count the number of times the different hair colors appear for the people you are tallying up from Massachusetts. In this case, COUNT will come in handy so you don’t have to manually add up the number of people who have different hair colors or export that information to Excel.Here’s what that SQL query would look like:SELECT     hair_color,     COUNT(hair_color)FROM     people_massachusettsAND     birth_date BETWEEN ‘2003-01-01’ AND ‘2003-12-31’GROUP BY     hair_color; JOINThere may be a time where you need to access information from two different tables in one SQL query. In SQL, you can use a JOIN clause to do this. (For those of you familiar with Excel formulas, this is similar to how you would use the VLOOKUP formula when you need to combine information from two different sheets in Excel.)For example, let’s say we have one table that has data of all Massachusetts residents’ user IDs and their birthdates. Let’s say we also have an entirely separate table that has data of all Masachusetts residents’ user IDs and their hair color. If we want to figure out the hair color of Massachusetts residents born in the year 2003, we’d need to access information from both tables and combine them. This works because both tables share a matching column: the Massachusetts residents’ user IDs.Because we’re calling out fields from two different tables, our SELECT statement is also going to change slightly. Instead of just listing out the fields we want to include in our results, we’ll need to specify which table they’re coming from. (Note: The asterisk function may come in handy here so your query includes both tables in your results.)To specify a field from a specific table, all we’d have to do is combine the name of the table with the name of the field. For example, our SELECT statement would say “table.field” — with the period separating the table name and the field name.Let’s take a look at what this looks like in action.We’re assuming a few things in this case:The Massachusetts birthdate table includes the following fields: first_name, last_name, user_id, birthdateThe Massachusetts hair color table includes the following fields: user_id, hair_colorYour SQL query would therefore look like:SELECT     birthdate_massachusetts.first_name,      birthdate_massachusetts.last_nameFROM     birthdate_massachusetts JOIN haircolor_massachusetts USING (user_id)WHERE     hair_color = “red”AND     birth_date BETWEEN ‘2003-01-01’ AND ‘2003-12-31’ORDER BY     last_name; This query would join the two tables using the field “user_id” which appears in both the birthdate_massachusetts table and the haircolor_massachusetts table. You would then be able to see a table of people born in 2003 who have red hair.Congratulations: You’re ready to get started with your own SQL queries! While there’s a lot more you can do with SQL, I hope you found this overviewof the basics helpful so you can get your handsdirty. With a strong foundation of the basics, you’ll be able to navigate SQL better and work toward some of the more complex examples.What data are you excited to pull using SQL? Topics: Don’t forget to share this post! AddThis Sharing ButtonsShare to TwitterTwitterShare to FacebookFacebookShare to Email AppEmail AppShare to LinkedInLinkedInShare to MessengerMessengerShare to SlackSlack Data-Driven Marketingcenter_img Originally published Mar 25, 2015 8:00:00 AM, updated July 23 2019 How to Query a SQL Database:Make sure that you have a database management application (ex. MySQL Workbench, Sequel Pro).If not, download a database management application and work with your company to connect your database.Understand your database and its hierarhcy.Find out which fields are in your tables.Begin writing a SQL query to pull your desired data.last_img read more