Posts

Showing posts from September, 2025

Learning Journal Week 4- CST363

As we reach the halfway point of the course, I've had the chance to learn several foundational concepts that build on each other, moving from writing queries to designing the databases themselves. Five important things I have learned so far: Advanced SQL Querying Techniques: Beyond basic SELECT statements, I learned how to refine query results. This includes using  DISTINCT to eliminate duplicate rows and the  LIKE predicate with wildcards ( % , _  ) for powerful pattern matching in strings . I also learned how to use built-in functions to manipulate data, like concatenating strings or rounding numbers directly within a query . The Power and Variety of JOINs: I now understand that there are multiple ways to join tables, from the modern INNER JOIN syntax to the older comma-based syntax . A key takeaway was the practical use of a  LEFT OUTER JOIN to find information that is "missing", for example, to list all instructors and show a count of zero for those who ad...

Learning Journal Week 3- CST363

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 whose content is defined by a query. Think of it as a saved SELECT statement that you can interact with as if it were a real table. It doesn't store any data on its own; instead, it provides a dynamic "window" to view data from one or more underlying base tables. Similarity to a Table The main way a view is similar to a table is in how you use it. You can query a view with SELECT , filter it with WHERE , and JOIN it with other tables, just as you would with a physical table. This is its primary benefit, as it allows you to abstract away complexity. A user can interact with what might be a complicated, multi-table join as though it were a single, straightforward table. Differences from a Table The differences are crucial for understanding database structure and performance. Data Storage: A ta...

Learning Journal: Week 2- CST363

This week, we moved into advanced SQL, focusing on sophisticated ways to join and query data. I learned about different join syntaxes ( NATURAL JOIN , USING ), the power of LEFT JOIN for creating summaries that include zero-count groups, and set operations like UNION . The lessons on self-joins and WITH RECURSIVE for querying hierarchical data were particularly insightful. A key takeaway was the strategy of breaking down complex problems into smaller, incremental SQL steps to build a final solution. Prompt Answer Non-Key Join Example A common scenario for a non-key join is assigning employees to salary grades based on a range. English Sentence: "For each employee, find their salary grade by matching their salary to the grade's minimum and maximum salary range." SQL Query: SELECT e.employee_name, e.salary, sg.grade_level FROM Employees AS e  JOIN SalaryGrades AS sg ON e.salary BETWEEN sg.min_salary AND sg.max_salary; My Thoughts on SQL SQL is a powerful and decla...

Learning Journal Week 1- CST363

 Relational databases and spreadsheets can look similar on the surface, but their purpose and strengths are very different. A spreadsheet works well for small and simple tasks like keeping a budget, making a class schedule, or performing quick calculations. It is flexible, but that flexibility often leads to inconsistency and errors. For instance, imagine tracking inventory in a spreadsheet: one row lists “MacBook Pro,” another lists “Mac Book Pro,” and a third says “Apple Laptop.” All three entries might describe the same product, yet the spreadsheet treats them as separate items. A relational database, by contrast, enforces structure and rules through primary keys, foreign keys, and data types. This ensures that each product is stored once and referenced consistently wherever it is needed. Beyond enforcing rules, databases provide features that spreadsheets cannot, such as handling multiple users editing the same data at once, providing security through role-based access, and sca...