Tuesday, May 7, 2024

CST 363 - Week 2

 1. While most of the time, you will use queries to connect tables that are related, you may want to connect tables that have no keys in common. An odd example would have to do with a video I recently saw about silly sports statistics. If we wanted to calculate how many NFL players have scored a touchdown on their birthday, we could join a player table with a game table using something similar to this:

select scoring_player, count(*) as touchdowns from players p join games g where p.bday = g.game_date group by scoring_player; 


2. So far I'm finding SQL to be pretty challenging for me. My brain naturally assesses data well, but for whatever reason I'm struggling with the order of the clauses involved in SQL queries. I also tend to write programs very explicitly. For example, x =5; y = 4; sum = x + y; cout << sum;  instead of cout << x + y; So not having those intermediate "pauses" for values feels unnatural to me. I'm excited to continue challenging myself with it though, and know it will be very useful to me in the future.

No comments:

Post a Comment