3rd Week in 363 Database Management
- 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 views are like tables in that they display a restructured table columns and data types, they both contain table data just that a view is more like a virtual table. The differences between a view an a table is that views might have issues using insert, update, and delete statements. Since primary keys from a base might not be in a view during an insert a primary key can not be null there for it is not allowed. Aggregate values in a view might be used and update or insert to the view might create a new aggerate value which the must be converted to many base tables and the conversion is undefined there for that is also restricted.
- 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.
- Well in some ways there is similar syntax as with "()" means some type of function in both java and SQL. There are closing ";" end statements. There are built in functions such as avg() with is similar to have java has some built in functions. Some different features are like how data is manipulated or joined together using Join, union, group by while java focus on objects and algorithms.
Comments
Post a Comment