Monday, May 13, 2024

CST 363 - Week 3

 1. Third normal form eliminates redundancies by eliminating columns that are dependent on non-key columns. For example, if you had a table representing restaurant pricing during happy hour that contained the item name, time of day, and price. The column representing price would be dependent on the column representing the time of day, but the prices could be repeated. Third normal form would eliminate the column of prices and would include a new table with columns for time and price. This is important because repeat data can lead to slower processing times and inconsistencies if all of the data isn't updated correctly.

2. A SQL view can also be called a virtual table. You are able to view information in the view similarly to how you would use an actual table. One major difference is that the data shown in database tables is actually stored in the system, whereas a view is dependent on the database tables that it queries from. It doesn't hold any data itself. Effectively, a view is a pre-determined query that allows complex queries to be more easily accessed. For example, when comparing data from different tables in a database, it may be easier to create a view to allow those data points to be more simply accessed.

No comments:

Post a Comment