cst 363: week 3

  1. 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 SQL view is a saved query that is very similar to a table, but doesn't store data. It can show data from other tables if you use the SELECT statement. Some similarities is that you can use SELECT to query a view. Some differences are that views don't have primary keys. You also can't insert, update, or delete data through them.

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

    The features that are similar are how SQL has a SELECT and Java has a return statement. Also the SQL WHERE is similar to Java's if, since these are both conditional statements. The differences are that SQL is used to navigate through databases, while Java is used to create projects and programs. In terms of data handling, Java has arrays and lists but. SQL has tables and rows. Also, Java has elements like functions, but SQL doesn't have this. 

Comments