Tuesday, May 27, 2025

CSUMB Week 19 (21 May 2025 - 27 May 2025)

Briefly summarize 5 things what you have learned in the course so far.  

- I've learned what relational databases are and how to use a relational database management system (MySQL)

- I've learned how to create queries using SQL

- I've learned about 1NF, 2NF, 3NF, and BCNF

- I've learned how to create an ER diagram

-I've learned how to read the "execute" statement diagram


List at least 3 questions you still have about databases.

- Is there a more clear-cut way to identify between a non-identify vs an identifying relationship? Sometimes I misjudge by believing the child table cannot exist independently without the parent but turns out it can.

- I feel that we need more practice on identifying candidate keys and determining the minimum number of appropriate composite primary keys.

- I still have questions about how database work is carried out in "industry practice." Do database engineers just sit there and produce a whole bunch of SQL tables, joins, ER diagrams, etc.? Surely there must be more to it than that.

Tuesday, May 20, 2025

CSUMB Week 18 (14 May 2025 - 20 May 2025)

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) ?

I see SQL VIEW as a temporary table (made from a SELECT query) that I can refer back to and interact with it in a limited manner (such as selecting columns by using the VIEW name gave it just like you can with a table); however, it is different from a table because the conditions in which you can perform INSERT, UPDATE, or DELETE onto a View is under a very limiting condition. For example, if my view contains JOINS or GROUP BY, then I cannot perform update data operations as previously listed. 


We have completed our study of SQL for this course.  This is not to imply that we have studied everything in the language.  There are many specialized features such as calculating rolling averages, query of spatial data (data with latitude and longitude) coordinates, and more. But take a minute to think about how SQL compares to other programming languages such as Java.  What features are similar , and which are present in one language but not in the other?  For example,  Java has conditional if statements which are similar to SQL WHERE predicates,  the SELECT clause is similar to a RETURN statement in that it specifies what data or expression values are to be returned in the query result (although it is strange that a statement should specify the RETURN as the first part of a SELECT. 

In addition to what is already stated, both languages are similar in a sense that SQL also utilizes "methods" (e.g. COUNT( ), AVG ( ), etc.). The View operation kind of also gave me a little bit of "object-oriented" feeling since it felt like we were "initializing" a query although maybe that's not a good comparison since a View is not its own "non-static entity." We also have to declare the variable type (e.g. VARCHAR, INT, etc.) just like we would have to in JAVA. 

The main difference between the two languages is the limited scope in which I can use SQL with. With JAVA, I can pretty much use it for any purpose such as creating a software. SQL is only limited to interacting with a database. 

Tuesday, May 13, 2025

CSUMB Week 17 (7 May 2025 - 13 May 2025)

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.

The best way I am understanding this is that a key-based join establishes a "formal" relationship (as in it uses a primary and foreign key pair) and essentially always uses an equal sign (=). Whereas a non-key based join is an "informal" relationship where a relationship might not always be valid. Non-key based joins can also use predicates such as <, >, LIKE, BETWEEN, etc. 

for example:

"Given 2 tables called: student and grade, find students based on a range of a given grade"

We might see something like

SELECT student.name, student.id, grade.percentage

FROM student

JOIN grade ON grade.percentage BETWEEN 40 AND 60

WHERE student.name = grade.student_name;


What is your opinion of SQL as a language?  Do you think it is easy to learn and use?  When translating from an English question to SQL, what kinds of questions do you find most challenging?

I found SQL exceptionally easy to use and learn. The kinds of questions that gives me the most challenge is when it required multiple nested subqueries. Even then I think I am getting used to that part as well.

Tuesday, May 6, 2025

CSUMB Week 16 (30 April 2025 - 6 May 2025)

 Relational database tables and spreadsheets look similar with both having rows and columns.  What are some important differences between the two?

    From what I understand, tables from relational database managers allow us to manage relationship between tables a lot easier than it would have been when just limiting ourselves to spreadsheets. For spreadsheets, takes a lot of manual intensive effort to maintain data integrity.

Installing and configuration a database and learning how to use it is more complicated than just reading and writing data to a file.  What are some important reasons that makes a database a useful investment of time? 

    Well personally for me I feel like the query and constraint system alone makes it incredibly worthwhile to learn SQL since it makes managing database incredibly simple. It is much easier to maintain data integrity. 

What do you want to learn in this course that you think will be useful in your future career? 

- Becoming more familiar with the "tips and tricks" of relational database managers such as MySQL workbench.

- Learning how to implement SQL to manage database within personal projects.

- Learning how to develop a more mature database system.