Wednesday, June 5, 2024

CST 363 Week 8 Report

 Most Important Things Learned During CST 363: Introduction to Databases

  1. The most important thing learnt, if I had to choose, is how to work with SQL and MongoDB in Java. I really liked labs 19 and 21 for this, because we learnt quite a bit about how we can manage databases using Java. We were able to put everything together during these labs and really test our skills.
  2. The second most important thing I learned is how to write SQL queries, because this was the gateway into learning about databases. I think starting with SQL queries was a perfect way to get us to fundamentally understand how databases work. 
  3. The third most important thing I learned is how databases work beneath the surface. While theoretical knowledge like this may not be immediately practical, I think in the long term it will serve us well to at least be aware of how databases really work. I enjoyed learning the differences between relational and document databases, in particular.

CST 363 Week 7 Report

MySQL and MongoDB are both great programs one can use to manage databases.

Similarities: Both programs are open source and can also be installed on many different operating system such as Windows, Mac, and Linux. Both programs support indexing and large amounts of data, as well as sharding which can help to distribute data across many machines.

Differences: MySQL is technically a relational database, which means it is centered on tables, whereas MongoDB is NoSQL, document based. In MongoDB, data is stored in documents, specifically BSON files which are closely related to JSON format. MongoDB has a proprietary query language, whereas MySQL uses SQL, or structured query language. Furthermore, MongoDB does not use schemas, and each document can have a different structure, whereas MySQL relies heavily on schemas and every table must have a predefined schema structure.

When to choose MySQL: MySQL should be chosen whenever we require structured data and very reliable, consistent transactional integrity. Another indicator for MySQL is when we require complicated queries and joins. Some applications could be those that work with e-commerce and web apps.

When to choose MongoDB: MongoDB should be selected as our program when there is a need to store large volumes of unstructured data. Another good indicator would be if we require flexible schemas and fast, plentiful write transactions. Some applications could be those that work with real time analytics.

Friday, May 31, 2024

CST 363 Week 6 Report

Summary of Week's Learning

This week, we learned a ton about spring web server and also JDBC API. JDBC is a Java based API that enables us to interact with databases. The spring web server is like a programming component that sort of acts like an environment in which we can create web applications. We learned how to connect these two with a custom made SQL data schema, which was actually pretty fun. I really liked how we were able to see real time updates from our spring web server updates in our Mysqlworkbench queries. This makes sense because they were using the exact same database, through JDBC api access. Overall, it was a great week full of learning and I look forward to learning about mongoDB next week.

Sunday, May 19, 2024

CST 363 Week 5 Report

Generally speaking, an index provides faster read times for queries in SQL. There are three elements that, when combined, can prove an index search to be slower than expected, however. The first regards the leaf node chain. The second is accessing the table. If the hits point to many table blocks, that is a bad sign for performance. The third is fetching the relevant data from table(s). Databases can actually be asked how they use an index. In the oracle database, which has three operations for describing an index lookup, the index range scan, which performs the tree traversal and follows the leaf node chain to find matching entries, is the default fallback operation if multiple potential entries are triggered. It is precisely in this scenario where a "slow index" can manifest.

Tuesday, May 14, 2024

CST 363 Week 4 Report

Five Things I Have Learned

1. The first thing I have learned in the course so far is how to write SQL queries. I thought it was actually pretty cool to learn, because it is a new language. The language is kind of cute to be honest. 

2. The second thing I have learned in the course is how to join tables in SQL. This is a big deal and we spent almost a whole week on the topic. I like that we have the flexibility to choose which tables to join, and whether it is outer or inner. Creating views is also really cool and useful for analyzing data. 

3. The third thing I have learned in the course is how to create an ER diagram in MySQLWorkbench. This feature is actually simple and effective, I intend on exploring it more going forward. 

4. The fourth thing I have learned is how to to program mock tables and tuples in Java, as well as querying and indexing. This is so far a great experience because it is not only teaching us about databases but also keeping our programming skills sharp. 

5. The fifth thing I have learned is the normal forms in relational databases, which are fundamental concepts to help ensure databases are efficient and stable in the long term, especially when migrating them. There are also fourth and fifth forms, but more often than not are unnecessary to work with, given that the first three forms will take care of the vast majority of database designs. 

Questions

 1. Is it possible to use directly use a SQL database in Java (or any other popular language), and if so how? 

2. Is there a way to create graphs from SQL queries? 

3. Can databases be encrypted for security purposes? 

4. Realistically speaking, how often is the fourth and fifth normal form actually considered in SQL? 

5. What is the fundamental difference between SQL and NoSQL?

Saturday, May 11, 2024

CST 363 Week 3 Report

 1. The third normal form is a concept in normalization that helps to eliminate unnecessary data and "entanglements" between table columns. Every column in a table that is not a key must only rely upon the table's primary key in order to maintain data integrity, less redundancy, and a more straightforward database. Normalizing tables is especially important for ensuring that queries are more efficient and faster, as well as for future scalability of the database. 

 2.  An SQL view is an "abstract" table that is temporarily created in order to help users analyze data. Some similarities to a table include: the ability to query, columns and rows, and ability to join them together. A key difference is that, whereas a table is physically stored, the view lacks persistence and is only temporarily created. Another difference is that views lack indexes and constraints, whereas tables are able to support them. Views are also typically not able to be updated unlike tables. 



Thursday, May 2, 2024

CST 363: Week 2 Report

 1. One case in which an SQL join would be used on columns on non keys are in this given example: lets say we have two tables named "Products" and "Orders". If we were to require the total sales amount for each type of product, then we would have to join the two tables by the product type column, which may not necessarily be the primary or foreign key. This means that we would write in SQL as such:

 select a.product_type, sum(b.total_amount) as total_sales_amount from orders b

join products a on b.product_type = a.product_type

group by a.product_category;

2.  SQL as a language is actually very straightforward, the only confusing parts are the terms one has to learn in order to accomplish data manipulation. For example, it is tricky to remember when to use the term "on" and "as" when writing prompts. It is easy to forget what each term does, ultimately. However, with enough practice I am certain it will become far easier.

Saturday, April 27, 2024

CST 363: Introduction to Database Systems WEEK 1 REPORT

This is Gigabit Goon Squad captain Luis reporting in for database week 1 intel briefing.

While spreadsheets can hold data, it is an older form of database named "file" database compared to our modern relational database used in SQL. This means that in relational databases, data is more securely protected and also the system ensures that data is more consistent by using constraints. Another big difference is that relational databases are designed with concurrency in mind, meaning it can be used by many people at the same time without having nearly as many errors as a spreadsheet or file database would. For a very small business, a spreadsheet might work but not for big companies such as google or tesla. Yet another big difference is that spreadsheets are far more prone to data redundancy, and relationships in relational databases mean they are far more organized and efficient. 

The main reasons for learning to a database is not only for the above, but also that if one wishes to create their own database or work for a data centered company in the future, an understanding of how databases function is absolutely important. For instance, if one were to encounter an error, they may not know how to address it without knowing the appropriate mechanism at fault. Also, a good programmer should be well versed in a variety of subjects, and databases are no exception. 

In particular for this course, CST 363, I believe that learning how to work with databases in Java or python would be great, especially since data science is a booming field. Knowing the fundamentals of database interactions with regular programming languages would surely help all students to grow professionally.

Wednesday, April 17, 2024

CST 338 End Course Report

    In CST338: Software Design, we are about to wrap up our final project and major assignment of the course. This course was incredibly educational, I learnt a ton about Java and Android and how to properly design and test software. 

    The first major victory I accomplished was completing the Jotto assignment. This is primarily because we are all new to Java (at least most of the students, since we started with C++). Having to overcome the initial learning curve the language presents along with implementing it into a word guess game was very challenging and yet rewarding, since I acquired a much better understanding upon completion. If I could go back in time, I would actually simply learn Java ahead of time (this is something that could be recommended to CS online students ahead of the first course, actually). I gained the ability to understand Java code, and that is massive. Another skill I gained is knowing how to create and run unit tests, which are very important in the world of software development. Yet another skill gained was a decent expertise over GitHub, which today is probably even more important than knowing unit tests!

    The second major victory I accomplished was definitely completing the android project. This thing was an absolute beast of an assignment, and conquering it proved equally as rewarding. I easily have probably 100 hours into the assignment, if I had to guess. However, the effort was well compensated as we now have an awesome mobile game application, one that Pokemon fans are especially certain to enjoy. Training with android studio taught me much; I particularly feel that I now have a strong foundation for Java app development, including a whole bunch of tools such as activity layout design, SQLite database operations, threading, recyclerviews, livedata, mediaPlayers, adapters, intent factories, push notifications, and much more. 

    Overall, this course was awesome, and I am grateful to have had a tremendous professor and TA for it. Thanks for the training and guidance Dr. C and Polina!

Thursday, March 21, 2024

Week 12 Report

 CST 338 Week 4 Learning Journal

I worked with Guillermo Zendejas and Edward Torres on this task.

I first read the instructions and then commented on the methods with JavaDoc style comments to explain them. Then, I begin completing each method one by one, until they are all finished. Afterwards, I complete any debugging in tandem with running unit tests to assert correct functionality. Then I will polish the program for maximum readability.

Eddie starts similarly to me, with many todo’s inserted on initial coding. Eddie simply starts typing right away, until he encounters a problem upon which he will take a break and either research and/or think about it on paper. For Guillermo, he codes the methods one at a time. Guillermo does a rough mental plan in his mind and then begins writing the methods. Guillermo will also keep in mind what the unit tests require as he is coding, which is a good strategy.

I would experiment next time by running unit tests earlier during program completion, rather than after it is all written. This can help both with assignment completion and project functionality.

My program follows the Google Java Style Guide well, with no notable violations of the guidelines.

Monday, March 18, 2024

Week 11 Report

 CST 338 Week 3 Learning Journal

Jotto Code Review 

    I worked with Victoria Ramirez and Ichiro Miyasato. The feedback I received indicated to me that I missed a small opportunity to keep the game going by offering the player the option to update the wordlist when words are run out of, as my program is coded they must go to the main menu to do that. Another small improvement is to include the proper score sum output when the player guesses the correct word, rather than only including it in the menu.

    The improvements I would make to my code include updating the program so that the player has the option to add more words when they run out and try to play a round, rather than having to do it from the other option in the main menu. To be honest, the only unit test that I had trouble with was getLetterCount(), but it was only because of the need to capitalize the input in the method in addition to doing so in the game round process. It was easy to fix.

    The clearest improvement that could be made to the getLetterCount() test is one of two options: remove the capitalized GRAPE word that is tested, or include in the Jotto instructions to capitalize the passed in String value at the beginning of the method definition. This is sincerely nitpicking though since the unit tests are overall well designed and appropriate.

    I only struggled a bit with understanding the different variables, for example in differentiating the local “score” variable in guess() and the global “score” variable in the class fields. I think this could be improved in the future by changing the global variable to be named “final_score” and the local variable “round_score”. Also, learning how to work with File and StringBuilder objects was cool.

qVictoria struggled with IntelliJ, specifically her Gradle tool kept bugging out. She was being gatekept by the compiler, it seems. We are still looking for a proper solution, I am sure we will find it eventually. With the Jotto program, we had similar struggles, mostly being confused by the overlapping score variable. She also struggled with coding getLetterCount(), but was able to solve it with focus.

     I am most proud of the fact that I was able to put all the code together and then most of the tests passed afterwards, which in retrospect is potentially a foolish way to complete similar assignments since test driven development should involve continuous testing rather than coding marathons in between testing. I look forward to implementing more stops and testing in between coding in future projects.

Saturday, March 9, 2024

Week 10 Report

     For this week of CS online in CST 338, we got to work with developing a small text based game named Jotto guess. The unit tests were all straight forward and easy to pass, with a small exception being the tear down test issue that Dr. C had let us know about occurring in windows machines (now I am curious what percent of the course students are using windows vs mac). There was a unit test that also expected getletterCount() to lower case the input which was not mentioned in the instructions, so I went ahead and fixed it after most of the program was complete. I am frankly most proud of simply getting the program finished way ahead of schedule. I had it complete at least a week ahead, which is exactly how my die hard Type-A mind likes it. All prophecies of immeasurable ambition aside, I thought the program was a cool challenge for us to learn Jotto, File, scanner, and array list methods. I think if the program was in C++ we would have finished it much faster since we are comfortable with that language more right now, however this is quickly shifting as we learn more about Java. I think within two weeks from now I may actually prefer Java.

    Looking through the new videos for week 2 now, I am hyped to train harder and become stronger as a programmer. In honor of Akira Toriyama I vow to become the software super saiyan

Tuesday, March 5, 2024

Week 9 Report

    This week is technically our first in CST 338: Software Design, a course for Java fundamentals and a good introduction for software engineering. Already I have learned a ridiculous amount of new knowledge, particularly about working with GitHub, IntelliJ, and Java classes. Our professor and TA are really cool, which makes the learning process easier. 

    For our first week, we completed several assignments including progress in CodingBat, which is to help us get comfortable with strings, arrays, hash maps and whatnot in Java. When it came to tackling the problems in CodingBat, I would briefly plan out the solution in my head into at least two steps and then write the beginning of each part in the compiler. For instance, in many of the problems I would generate variables and then get to the loop to complete the task. The problems were actually fun, they are like little puzzles. It would take me usually at least two tries to get the proper solution, though often I got it on the first thankfully. None of the problems were particularly frustrating, especially since we are just barely getting acquainted with Java. 

    We also got to learn about UML and Unit testing with Junit which looks like a great technique for software development. In test driven development, test coverage refers to what percent of the code in the program is covered by unit tests, and the more test coverage one can build, the better, usually. We got to put many of these skills to use in our full calorie homework, Jotto Guess, which is basically a mini project in Java for a text based word guessing game. I am grateful that we received quite a bit of starter code from Dr. C, because that was probably the more complicated code since it involved Unit testing and several instances of File objects being summoned with respective try catch blocks. The process for completing Jotto was rough at first, since there was much researching to be made regarding Java syntax, array list methods, and other fundamentals. My favorite part was actually creating the method getLetterCount(), which compares how similar two words are and returns a score for it. 

I am hyped for learning more about Java and software development in this course.