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. 

No comments:

Post a Comment