CST 363 - Module 2

 Week 2!

Something we worked with this week was the ability to join tables on any column. Normally, the join would use equality between the primary key and the foreign key. However, there are times where joining something other than keys would be necessary. For example, I can say I want to select the column "title" from the table "video_games" and the column "name" from the table "company" by joining where the "video_game" column "developer_company" is equal to the "company" column "name". In SQL, it would look like "SELECT video_game.title, company.name FROM video_game, company where video_game.title = company.name;". This would return the values of each column from both tables into one where the column values match.

So far, SQL is taking a bit of effort to get comfortable with. However, once I understand it, it is easy to use. Most of the time, the translation between English and SQL is smooth. However, when working with more specific cases like using outer, inner, left, right and natural join, the translation tends to be more different. An example of this being the fact that inner join does not mean literally join table from within a table, it means to select only matching columns from both tables being joined. 

Comments

Popular posts from this blog

CST 300 - Module 4

CST 300 - Module 2

CST 300 - Module 3