CST363: Introduction to Database, 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)?

Earlier in the course we learned about views and how they can simplify data access by restructuring columns without changing the underlying database design. Views are especially useful for protecting sensitive data, saving complex queries, and improving performance with optimized statements. They act like tables in many ways, but they are best for reading data since most databases restrict inserts, updates, and deletes on view

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?

SQL and Java have some similarities, but they work in different ways. In SQL, the WHERE clause is like an if statement in Java because both check conditions. The SELECT clause is kind of like a return statement since it tells what result should come back.

The big difference is that SQL is declarative, so you say what you want and the database figures it out. Java is procedural, which means you write the exact steps to get the result. SQL is made for working with data, while Java can do a lot more general programming.

Comments

Popular Posts