CST 363 - Week 3
Hey everyone!
We are now done with our third week of CST 363! It is so fun but also very challenging. We had an exam this week. We also were introduced to heap database and bitmaps. It was very confusing and took me a while to understand it. To answer this weeks questions, I reflected on two important questions regarding SQL.
1. What is an SQL view? How is it similar to a table? How is it different?
An SQL view is a virtual table that results from a query. It's similar to a table in that it can be queried and used in SELECT statements, but unlike a table, it doesn't store data itself—it's based on underlying tables. Views don't have primary keys, and while they allow us to retrieve data, their use in INSERT, UPDATE, and DELETE operations is more limited. Depending on the database, some views are updatable, but generally, if a view contains complex joins or aggregations, direct modifications aren't allowed.
2. How does SQL compare to other programming languages like Java?
SQL and Java share similarities, especially in logic structures. SQL's `WHERE` clause is like Java's `if` statements, as both control the flow of data or execution based on conditions. Similarly, SQL's `SELECT` clause is comparable to Java's `return` statement in how both specify the output of a process. However, SQL focuses on data retrieval and manipulation within databases, while Java is a general-purpose language with extensive control structures, object orientation, and broader functionality, such as loops and error handling, which SQL lacks. Additionally, SQL's syntax is declarative, describing *what* to retrieve, while Java is imperative, describing *how* to execute a task.
That is it for this week. See you guys next week!
Comments
Post a Comment