In my previous JTable Video Tutorial I showed you how to pull information from a database and work with it in a JTable.
In this tutorial I show you how to add and delete rows in a JTable that will then effect the database. I also cover allowing the user to change the database on a cell basis.
After this tutorial, you’ll be able to do anything with Java JTables.
Well over a decade ago, a book came out simply titled MySQL by Paul DuBois. Everyone I know learned about MySQL from this book.
I guess I mentioned in the past that I liked this book and ever since I get requests for the code from the book. I guess it isn’t available online anymore?
So, here I gather together all of the code in one place. So, I can just point people to it from now on 🙂
Previously I made a couple of Baseball Sabermetrics videos and it was a lot of fun. In this Sabermetrics tutorial I’ll cover a few of the Sabermetrics formulas I missed.
One question I received from a few of you was which team uses Sabermetrics most effectively. You’ll find that answer in the first query below named TTRC for Teams.
I also show how to perform many Sabermetric Pitching formulas below.
I continue covering some neat Sabermetrics formulas in this video. If you missed part 1 of my Sabermetrics Tutorial, check it out first.
I’m going to cover a few new complicated formulas including: Theoretical Team Runs Created, Batting Average on Balls in Play, Weighted On Base Average and more. I’m also going to show you how to easily save queries using views.
This tutorial has been a great deal of fun. All formulas follow the video.
Here I continue my Sabermetrics Baseball tutorial. If you missed part one, check it out first because in it I show you how to get all of your tools. It is here Sabermetrics.
I’m going to introduce a few new SQL functions being CONCAT, COALESCE and HAVING.
We will also calculate the top players based on RBIs, HRs, Batting Average, On Base Percentage, and Slugging Percentage. And, I’ll show you how to pull in data on the players position and their salary.
In this article I introduce you to the world of Sabermetrics. Sabermetrics is the analysis of baseball statistics to measure player performance, in game probabilities and much more.
With Sabermetrics you’ll be able to do most anything from decide who was the greatest hitter of all time to analyze the probability that your team will win.
But, to get started with Sabermetrics, you need to first get your tools being MySQL and a Baseball Stat Database. Both are free! More info follows the video below.
In this web design and programming video tutorial I will review a lot of what you have been taught previously. I’ll review many topics by showing you how to make drop down boxes that are populated from data stored in a database. If you don’t completely understand everything don’t worry about it. That’s why it is a review.
All of the code from the video follows the video. I included additional comments in the code that you can better understand what is going on. You also should print out the code and refer to it as you watch the video for better comprehension.
// This function is called to reload the page and pass the values chosen by the user
function reload(form)
{
// Get the value of the dropdown named cat
var val=form.cat.options[form.cat.options.selectedIndex].value;
// Loads the new page with the stored variable values
self.location=’hamtest.php?cat=’ + val ;
}
function reload2(form)
{
var val=form.cat.options[form.cat.options.selectedIndex].value;
var val2=form.subcat.options[form.subcat.options.selectedIndex].value;
self.location=’hamtest.php?cat=’ + val + ‘&cat3=’ + val2 ;
}
</script>
</head>
<body>
<?php
// Getting the data from Mysql table for first list box
$quer1=mysql_query(“SELECT DISTINCT Prod_Type,PT_ID FROM Product_ID
WHERE PT_ID IN (0,1,2,3,4,7,8,14,15,16,31,32,33,34,35,36,37) order by PT_ID”);
// For second drop down list we will check if category is selected else we will display all the subcategory
$cat=@$_GET[‘cat’]; // This line is added to take care if your global variable is off
if(isset($cat) and strlen($cat) > 0){
$quer=mysql_query(“SELECT DISTINCT Manufacturer_ID.Manufacturer,Manufacturer_ID.Man_ID FROM Manufacturer_ID, Model_Numbers
where ((Manufacturer_ID.Man_ID = Model_Numbers.Man_ID) AND (Model_Numbers.PT_ID = $cat)) order by Manufacturer”);
}else{$quer=mysql_query(“SELECT DISTINCT Manufacturer,Man_ID FROM Manufacturer_ID order by Manufacturer”); }
// end of query for second subcategory drop down list box
// Â For Third drop down list we will check if sub category is selected else we will display all the subcategory3
$cat3=@$_GET[‘cat3’]; // This line is added to take care if your global variable is off
if(isset($cat3) and strlen($cat3) > 0){
$quer2=mysql_query(“SELECT DISTINCT Model_Num, Model_Num FROM Model_Numbers where ((Model_Numbers.Man_ID=$cat3) AND (Model_Numbers.PT_ID = $cat)) order by Model_Num”);
}else{$quer2=mysql_query(“SELECT DISTINCT Model_Num, Model_Num FROM Model_Numbers order by Model_Num”); }
// Â End of query for third subcategory drop down list box
Today I present the whole SQL Statements Tutorial Video Series. I did my best to make sure, after you watch this series of videos, you will be an expert at programming with SQL. Please leave any comments and questions below.
There are many misconceptions when it comes to databases:
Some people think they are hard to develop (Not True)
Many people think they are expensive (There are Free Versions Available)
Most people don’t know how to start using them (You’re in the right place)
In the next series of articles I will show you how to use mySQL. A completely free database server that many consider to also be the best. Heck, NASA uses MySQL.
So do you need one?
If you answer any of these questions affirmative, the answer is yes:
Do you have trouble managing your data, because it is unorganized
Do you have massive amounts of data that is too complicated to store in a spreadsheet
Would you like to provide access to your data on the internet
Would you like to be able to sort through and analyze your data