Thu, 3 July 2014
What is a Persistence Framework?
As the name implies, it has something to do with persisting things... this means that we're still talking about databases. But what is it that we are persisting with this framework?
Objects (of course)
A persistence framework is something we use in Java to bridge the gap between Java and SQL.
Hopefully we've gone through all of my previous tutorials and have learned a thing or two about Java and SQL. But one thing I haven't taught you yet, is how to put your knowledge of SQL into Java.
That's what I'll be teaching you throughout these Hibernate (persistence framework) tutorials.
And if you haven't guessed it already, Hibernate is a persistence framework that you can use in Java. It's what allows you to write Java code (staying true to Object Oriented programming practices) and yet still be able to communicate with your database. Cool eh?
For more information on this, check out the show notes page via: howtoprogramwithjava.com/session50
Wed, 25 June 2014
The SQL Subquery
So, what is a subquery?
First and foremost, let’s get the jargon out of the way. A subquery can also be referred to as a nested query. It’s just like having a nested
What’s very important to note here is that the SQL subquery can almost always be re-written as a
More info on this via http://howtoprogramwithjava.com/session49
Mon, 16 June 2014
After having talked about all the SQL Aggregate functions, there’s one more topic that goes hand in hand with what we’ve already learned… The
This particular keyword allows us to take a bunch of data and mash it all together into matching groups and then perform aggregate functions on those groups (like
You might ask yourself why you’d want to “mash together” a bunch of data. The answer to this is best explained with an example, but let me try to put it in regular words before we jump into our example. Grouping data together allows us to look at aggregate data in relation to unique piece of data (or rows), a typical use case would be to group all the matching data together so you can get a count of the number of occurrences of specific data. An example related to grouping and counting could be a presidential election, you’ll have all the votes in a database and you’ll want to group that data together to get the total votes for each unique candidate...
For more info, check out the show notes via http://howtoprogramwithjava.com/session48
Thu, 5 June 2014
In today’s podcast episode you’ll be learning all about the aggregate functions that exist in SQL.
What the heck is an aggregate function? Well that’s what I’m going to try and teach you today, and I promise, it’s not a difficult concept to grasp. Just think of an aggregate function as a method that you’re calling that will process data in your database and return a value. Obviously the returned value will depend on which of the aggregate functions you choose to use.
So that begs an obvious question, what are the aggregate functions that we can use in SQL? I’m glad you asked, here’s the ones that I use all the time in MySQL:
Okay, great! So now we know what the names of these functions are, now let’s see some examples of them in use!
Wed, 28 May 2014
There are three categories of joins that you can make use of in SQL:
But before we dive into the categories of joins, we first need to have an understanding of what a join really is.
Joins are used in SQL to bring together all the relevant data from multiple database tables. Remember that we've broken data down into multiple tables and established relationships between the tables.
... More via show notes: http://howtoprogramwithjava.com/session46
Fri, 23 May 2014
In this SQL tutorial episode/post we’re going to learn how to enforce our SQL relationships that we’ve already learned about. We’re going to be tackling the one-to-one and many-to-many relationships and we’re going to learn how to write the code to enforce these relationships in our database.
As outlined in the podcast, we are going to be focusing on the many-to-many relationship with the
Show notes available via http://howtoprogramwithjava.com/session45
Wed, 14 May 2014
You’ve learned all about how to create sql queries to read, write, update and delete data… but you haven’t yet learned how to create the tables where you’ll be doing the reading, writing, updating and deleting.
So that’s what today’s podcast is all about, be sure to click the play button above this to listen to the show and then follow along with the notes via http://howtoprogramwithjava.com/session44
Tue, 13 May 2014
Show Notes available via: http://howtoprogramwithjava.com/session43
In this post we will be expanding on the topic of database relationships and touch on two that are less common but just as useful.
The many-to-many database relationship is used when you are in the situation where the rows in the first table can map to multiple rows in the second table… and those rows in the second table can also map to multiple (different) rows in the first table.
A One-to-One relationship means that you have two tables that have a relationship, but that relationship only exists in such a way that any given row from Table A can have at most one matching row in Table B.
Thu, 12 December 2013
We’ve talked about relational databases already, and we’ve learned why this type of database management really dovetails with the object oriented programming model. So now I want to dive into the specifics when it comes to relationships.
What are the different types of relationships in SQL?
There are three types of relationships you can have in SQL, they are:
In this episode we are going to be focusing on the One-to-Many relationship as it’s the most commonly used in my opinion.
Wed, 4 December 2013
It's the foundation when learning any new concepts. In this episode of the "How to Program with Java Podcast" we will be talking about some new database terminology.
One of the most important aspects of modern databases is the fact that they allow you to define relationships.
Relationships between tables allow you to break data up into its individual "areas of interest". But when you break the data up, you'll need to know how to put it back together. This is accomplished using relationships, keys and joins.
There's plenty to learn about these concepts and we will start by scratching the surface in this episode.
As you'll hear in the first few minutes of this episode, I've recently had an epiphone!
I realized that there's no great communities dedicated to programmers.
So I took it upon myself to create the very first community dedicated to programmers and the pursuit of knowledge and advancement of our common goals (to excel as programmers). You'll learn lots about this community in the episode, so I won't go in to details here, but if you're interested in checking it out - please visit: