More Querying!

I really like querying. I find it really interesting how, databases are organized. This week we looked at how to use JAVA to edit a database through a graphical user interface. Although we didn’t make the interface ourselves, I’m excited to get to the point where I can.

We did some practice querying a database in order to compile data that had been stored in separate tables. The data needed to be aggregated and displayed in a single table. I attempted to approach this problem by using a union and a left join to pull the data together. The data listed a part number and the quantity for that particular part. The problem I ran into, but did not anticipate, was that parts not stored in one table but stored in the other were reported as having a quantity value of NULL. This was an issue because the function I wrote to sum the two quantities of each part reported x + “NULL” as “NULL” not x. If there was a way to change “NULL” to 0, my solution would have been a simple alternative for aggregating the data. The alternative which had no glitches was to create a union of three different sets, one with the intersection of parts in both tables, and 2 more with the non intersecting parts in each table.

Maybe I like querying because you instantly know whether queries are correct and there is a logic to it that reminds me of math, which is what I teach. I look forward to working more with data analysis and/ or management.

Comments

Popular Posts