Posts

Computer Science BS Journal (CST363) : Week 8

 This journal entry marks the final days of CST363. What an amazing class. I really enjoyed working with MySQL Workbench. Mongo was a bit odd, but I liked the challenge of learning to use new software/get better with the command line. Our final prompt is to list 3 of the most important things we learned in this class. The three things I'll list are going to be Database design, Transaction & Concurrency, and JDBC & Spring Boot.  I'll list the key learning takeaways for these as well as some useful information. 1. Database Design Key Learning Takeaways: Data Modeling: Understand entities , attributes , and relationships . Learn how to design ER diagrams to visualize database schemas. Normalization: Apply 1NF, 2NF, 3NF (and BCNF) to reduce redundancy and improve integrity. Understand denormalization trade-offs for performance. Schema Design: Create well-structured primary and foreign keys . Define constraints (NOT NULL, UNIQUE, CHECK) f...

Computer Science BS Journal (CST363) : Week 7

 This week we installed and used MongoDB. It was super new to me and I haven't really used the command prompt very much so when I was running into errors while trying to load my JavaScript file I got a bit irritated. I got it working eventually after realizing I had to move my file to a different directory and type out the full path when trying to load it. That solved all my issues. I followed the same steps when loading the other two files provided for the lab and it went smoothly. Here are some things I noticed when comparing Mongo DB with MySQL. Similarities Database Management : Both are database management systems used to store, retrieve, and manage data. Cross-Platform : Both are cross-platform and run on Linux, Windows, and macOS. Indexing : Both support indexing for faster queries. Replication : Both support data replication for high availability. Security : Both offer authentication, authorization, and encryption features. Community and Support : Each has...

Computer Science BS Journal (CST363) : Week 6

 This week I learned quite a bit about JDBC, Connectors, and what it takes to work on some Web Applications.  *JDBC is the standard Java API for connecting and executing SQL queries with relational databases. Key Concepts: DriverManager / DataSource : Manages DB connections. Connection : Represents a connection session. PreparedStatement : Safely sends parameterized SQL (prevents SQL injection). ResultSet : Retrieves query results. Some key takeaways: Use PreparedStatement for safe, efficient, and secure database queries. Always close connections (or use try-with-resources). Avoid hardcoding SQL logic — parameterize everything. Use jdbcTemplate.getDataSource().getConnection() in Spring Boot for quick integration. *Spring Boot simplifies JDBC usage by handling connection setup and dependency injection through JdbcTemplate . Key Concepts: @Autowired JdbcTemplate gives access to your DB. Spring Boot reads config from application. Properties...

Computer Science BS Journal (CST363) : Week 5

 This marks the 5th week of CST363 and things are going great so far. This week we designed a prescription database, practiced transactions on MySQL as well as practiced some SQL in our homework 3 assignment. I had fun making the database for the prescriptions, I still get a little confused when it comes to the 1:1 or 1:M relationships so I had to go back and review a bit to be sure I was correct. Homework 3 and Lab 15 were pretty straightforward but they were good material to practice what was taught to us thus far. The web site  "Use the Index Luke"  has a page on "slow indexes".    https://use-the-index-luke.com/sql/anatomy/slow-indexes If indexes are supposed to speed up performance of query,  what does the author mean by a slow index?      After reading through the article I can conclude a few things.  What is a "slow index"? A slow index is one that exists and is technically used by the query planner, but results in poor performanc...

Computer Science BS Journal (CST363) : Week 4

     This week marks the halfway point for our class. There is so much I've learned in this class so far and I'm excited to keep moving forward.  Briefly summarize 5 things what you have learned in the course so far.   SQL - I've learned that SQL (Structured Query Language) is used to manage and interact with relational databases. It lets you define data structures(tables), insert data, and query information using commands like SELECT, INSERT, UPDATE, and DELETE. Java Tuples - In Java, I learned that tuples are fixed-size collections of elements, used to group related values without creating a class. Java Predicates - A Java Predicate is a functional interface that represents a condition or boolean-valued function. I learned that it's commonly used in filtering operations with streams or collections, and takes one argument to return true or false. Bitmaps - I learned that a bitmap is a data structure that represents a set of bits (0s and 1s), often used to ...

Computer Science BS Journal (CST363) : Week 3

  1.What is an SQL view.  How is it similar to a table? In what ways is it different (think about primary keys,  insert, update, delete operations) ?      An SQL view is a virtual table that is created by saving the result of a SELECT query. It does not store data itself but presents data from one or more underlying base tables. A view is similar to a table in that you can query it using SELECT statements, apply filtering, sorting, and even joins, just like with a regular table. However, views differ from tables in several key ways. Unlike tables, views do not physically store data, and they cannot have primary keys defined on them. Additionally, while tables fully support INSERT , UPDATE , and DELETE operations, views only support these operations under certain conditions. For example, a view must be updatable—typically meaning it is based on a single table without joins, aggregations, or GROUP BY clauses—to allow data modifications. Even when a view i...

Computer Science BS Journal (CST363) : Week 2

 Class: CST363-30_2253 ( Intro to Database Systems) SQL has the flexibility to join tables on any column(s) using any predicate (=, >, < ).    Most of the time the join will use equality between a primary and foreign key.   Think of example where joining on something other than keys would be needed.  Write the query both as an English sentence and in SQL.  If you can't think of your own example, search the textbook or internet for an example. English Sentence: Imagine you are working with a database that stores information about employees and their salary performance. You may want to find the employees who are earning more than the average salary in their department. In this case, you would join the employee table with the salary data table using the salary amount, not the keys, in order to compare each employee's salary with the department's average. Query:   SELECT e.employee_name, e.department_id, s.salary FROM employees e JOIN salaries ...