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

SQL View is a temporary table, which is created from existent data table. It can be viewed and extracted information from rows and columns similar with data table. But the different is SQL View, as the name suggests, is read-only. It cannot be created solely like regular table (using primary keys and insert), nor its data can be modified (update and delete operations).

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. 

First of all, we can see the difference is that SQL is language specific for data management and querying. Other languages, such as Java, is programming language used to build the tools for data management.
Because of that, we can see SQL and other programming languages are very different. In programming languages, we can create data table that fit our need. Meanwhile, we can use SQL to create a similar data table. But with SQL, we have to follow the statements and predicates, instead of customizing it our own way.

Another significant difference between SQL and programming language is reusable resources. SQL's data table and predicates certainly can be reused, but we have to write the statements on our own. Even when some repeated part can be reused with VIEW, it is not easy and obvious to do so. Meanwhile, with programming language, we can create a new struct, class, function to reuse them over and over again as we see fit.


Comments

Popular Posts