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) ?
- An SQL view is a query that acts like a table. It adds all of the specified columns to a table and populates rows of the table based on the constraints of the query. Some similarities between a view and a table are you can use the same query statements on a view, they have columns and rows, and you can use them in join statements. Some differences between a view and a table are that views are typical read only, so you cannot use insert, update, and delete methods. Views also do not have their own primary keys.
- 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.
- SQL is declarative and set-based; Java is imperative and object-based, but both share parallels in conditional logic, expressions, and returning results.
Comments
Post a Comment