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


A view is a saved select query and it is not its own table in the database. Table views allow users to view specific columns of data without being exposed to unnecessary information. Views also allow for complex queries to be saved.

Issues can arise when primary key columns (if they exist) are not present in the view. If a user tries to insert a value directly into this kind of view, it would fail because values would not be allowed to be inserted into original tables with null primary keys. Similar issues can also occur when a user attempts to delete rows from a view that contain primary keys from other tables.


  • 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.


One observation I have made about sequel is that queries can behave like methods in Java. Inserts/deletes/updates are similar to setter methods and select statements are similar to getter methods in Java. Adding rows to a table is similar to updating a field in a Java object and returning these fields is similar to retrieving records with a select query.

These languages are different though in what else they can accomplish. Java can be used to control other features in an application that extend beyond data transactions. It can be used to develop GUIs with JavaFX that allow a user to interact with applications or systems.

Another difference between SQL and Java is that a SQL server is capable of maintaining more records than a database created in java can. From what I have seen so far in this week’s material, an SQL database is not nearly as limited in the amount of data it can hold like the database in lab 12 is.


Comments

Popular posts from this blog

CST - 300 Week 2

CST 300 week 4

CST 300 week 3