Posts

    Week 5 – CST– 363 Introduction to Database Systems The web site  "Use the Index Luke"  has a page on "slow indexes."    https://use-the-index-luke.com/sql/anatomy/slow-indexes Links to an external site.   If indexes are supposed to speed up performance of query, what does the author mean by a slow index?  What the author refers to as slow indexes is not that indexes are slow but that there are situations that cause indexes to perform slower. He mentions two ingredients that cause indexes to perform a slow lookup. The first is the leaf node chain. The database must read the next leaf node to search for matching entries after it has found the node it was looking for. The author points out that an index lookup must perform a tree traversal and follow the leaf chain as well. The second ingredient he mentions is accessing the table after finding a matching node. There is an additional table access for each hit and a single node can co...
  Week 4 – CST– 363 Introduction to Database Systems This week is halfway through the course. Briefly summarize 5 things you have learned in the course so far. List at least 3 questions you still have about databases. The five things I have learned in the course so far are the structure of relational databases, SQL syntax, database design, normal forms, and how databases store data. The relational database structure is organized using tables, which have names, fixed tuples of columns, and a varying set of rows. A column has a name and a data type. A row is a tuple of values and does not have a name. Each value belongs to a column and the column’s data type. The data type is used to assign a value to a column, such as int, char, and varchar. SQL is a high-level computer language for storing, manipulating, and retrieving data. It uses statements which are complete commands composed of one or more clauses. The most common clauses included Select, From, and Where. There are als...
  Week 3 – CST– 363 Introduction to Database Systems 1.       Someone described normalization rule as “a non-key column depends on the key, the whole key, and nothing but the key, so help me Codd.” Key refers to a primary or other candidate key of a table. If the key has multiple columns, then “whole key” means all columns together and not just some part of the key. Explain, in your own words, what 3 rd normal form is and why it is important.   The 3 rd normal form is a rule used to design tables that eliminate redundancy. Redundancy is the repetition of related values in a table. When a table is in 3 rd normal form, all the non-key columns depend on the key only. In case of a composite key, non-key columns must depend on all of the columns that make up the primary key. This is important because when non-key values depend on other non-key values it causes redundancies. Redundancies in a database can cause problems because all related values must...
  Week 2 – CST– 363 Introduction to Database Systems 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 an 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.   (Found example in stackoverflow). In SQL you would need to use something other than keys when you need to join two tables that do not have keys in common. An example would be two tables that have one column each. There would be Table A with column CustomerId and TableB with RewardCode. The query would be, join TableA with TableB. Select tA.CustomerId, tB.RewardCode From (Select customerId,      ROW_NUMBER() OVER (ORDER BY CustomerId) as TableA_RowNumber From TableA) tA ...
  Week 1 – CST – 363 Introduction to Database Systems 1.       Relational database tables and spreadsheets look similar with both having rows and columns. What are some important differences between the two? Some important differences between database tables and spreadsheets are the way data is formatted and how data is stored. In a spreadsheet, every cell can store any type of data like a date, integer, or string. These data types can also have their unique format. In a database, each cell must contain only one data type helping to prevent data mismatch mistakes. In a spreadsheet, the data is stored in each cell. In a database, the data is stored in a row made up of columns. 2.       Installing and configurating a database and learning how to use it is more complicated than just reading and writing data to a file. What are some important reasons that make a database a useful investment of time? Learning how to install and c...
  CST 338 – Software Design – Wk07/08 Learning Journal Summary When I look back at Jotto now, it still seems like a challenge. I would definitely change my approach and make sure I understand the prompt before I begin. I would make a list of the methods and write down how to implement them in my own words to show that I understand what is being asked. As I begin coding, I will use that list as a checklist to track my progress and return to methods I might have set aside for later implementation. I really enjoyed the coding bat exercises. They were challenging for me because Java was one of the first classes I took when I started my programming journey. Although it took me a while, I was able to complete the required tasks. It was a fantastic way to get back into using java. After a couple of setbacks with Jotto and Markov, I was able to complete Legally Distinct Pocket Monsters aka LDPM aka Project 1. Project 1 was the first time we were required to use object-oriented programm...
  CST 338 – Software Design – Wk04 Learning Journal: Markov Code Review Who did you work with? I worked with Kelia Smith. What was your strategy for solving the Markov assignment? My strategy to solve Markov was to thoroughly read the prompt first. After reading, I began by entering the fields. I then added the stubs for the methods so I can get a good idea of what I needed to do. Then I finally got down to coding while keeping the prompt open for clarification. After implementing all methods I ran the test file and revised any areas where the tests failed. I was not able to complete Markov as intended. What was THEIR strategy for solving the Markov assignment? Lia’s strategy is also to read the prompt thoroughly. She then creates a list of tasks she needs to do for the project. For Markov, she added the fields and method stubs. She then followed along with the prompt to implement each method one by one. She then ran the test file to check for errors indicated by the te...