Posts

Showing posts from May, 2025

CST 363: Week 4

  Briefly summarize 5 things what you have learned in the course so far.   SQL utilizes various constraint keywords to ensure the values within a database are following rules that best suit the desired functionality and utility of the database. These constraints can dictate if a value is a reference to another value, whether or not NULL can be placed into a cell, and more. It's similar to how conditional statements can be implemented in Java to conduct user input validation.  Database tables can be structured for maintaining data integrity and reducing redundancy through normalization. Through this process, a table may go through one or more stages called normal forms that establish rules on the table requiring rows to be moved to other tables or removed all together.  SQL allows tables to be joined together using related columns. These related columns can be joined with the keyword 'using' if they have the same column name or the 'on' keyword if the columns have di...

CST 363: Week 3

1) 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) ? An SQL view is a table constructed of columns taken from one or more established tables. An SQL view is similar to a base table as they consist of the same structure where columns share the same data types and rows show correlating data among the various columns. Both views and base tables can be used to perform queries and joins. Some differences between the two include that base tables consist of their own primary keys, while view tables do not. Additionally, data from base tables are stored physically in the disk while view tables are virtual and data from a view tables are dependent on the state data that they retrieve from the base table. Because of these circumstances, insert, update and delete operations do not always work when trying to update a view table and can affect a view table if these statements are used on any ref...

CST 363: Week 2

1) SQL has the flexibility to join tables on any column(s) using any predicate (=, >, < ).    Most of the time the join will use equality between a primary and foreign key.   Think of example where joining on something other than keys would be needed.  Write the query both as an English sentence and in SQL.  If you can't think of your own example, search the textbook or internet for an example. Below is a perfect example that comes from homework_2.sql. We needed to join the takes table to student where student received a letter grade, so the second line does this: -- 9. Calculate the GPA for each student from student table.  --    GPA is a fraction whose numerator is the sum of the product --    of grade value times the course credits, --    and whose denominator is the sum of course credits.   --    Consider only courses where students have received a grade (takes.grade is not null). --   ...

CST 363: Week 1

From the orientation, your reading from week 1 and your own experience answer the following questions. 1. Relational database tables and spreadsheets look similar with both having rows and columns.  What are some important differences between the two?  Relational database tables ensure that each cell within a column share the same data type. Spreadsheet cells, however, can consist of varying data types within the same column. Additionally, Relational database can ensure data is unique throughout specific columns using logic, while spreadsheets do not have the same capability. 2. Installing and configuration a database and learning how to use it is more complicated that just reading and writing data to a file.  What are some important reasons that makes a database a useful investment of time?  Databases allow for easy management of data, while also ensuring it is retrieved efficiently and accurately. Additionally, Databases accommodate increasing and large amount...