Wednesday, September 18, 2024

CST363 Week - 3

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 created based on the result of a query. Views do not store data physically; instead, they provide access to data from the underlying tables. This is especially helpful for sensitive data you don't want everyone to access. Both views and tables have rows and columns, and you can use SELECT statements on both. However, views do not have primary keys and are not typically used with INSERT, UPDATE, and DELETE statements.


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.

Honestly, I haven't thought about this too much. The first thing that comes to mind is statements like INSERT, UPDATE, and DELETE. In Java, we don't manage data in that way. Another aspect that comes to my mind is error handling, which is quite robust in Java. I'm not sure how in-depth SQL's error-handling capabilities are when it comes to exceptions.

No comments:

Post a Comment

CST462S - Service Learning Experience

With the first half of my Summer semester now coming to a close, I am submitting my final assignments and preparing for the upcoming class i...