Week 3 - Study of SQL Completion
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) ?
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.
As we delve through both the SQL language in this course and the intricacies of understanding how database queries work through the Java labs there are some underlying similarities between the two languages. In one case Java conditional if statements are quite similar to the WHERE predicates. Both of these similar cases act as a way to define conditions and filter control. Another similar case is the way the SQL statements operate in the same way methods are in Java, where they act as procedural and are reusable such as creating certain SELECT statements for the condition of say a WHERE. Both languages utilize the same data types, order of precedence for their operations and the use of specific keywords for declaration. In SQL you can define a column name with the AS statement similar to Java's declaration of a field/variable. Another case is the way both languages handle strings by retrieving the sub-string, length, and other operations. Finally I would like to note the way they both manipulate data, in the java labs we utilize certain data structures to mimic the ways SQL manipulates their data. In the case of the SELECT statements compared to the RETURN statements of java, SQL acts as a more declarative language whereas java requires step by step instructions. Overall they may seem to have similarities but they function very differently as SQL works best to manage relational databases and its queries while java is more for general purpose programming to write a variety of software and not only involve databases.
Comments
Post a Comment