Posts

Showing posts from June, 2025

Learning Journal Week 7

• Compare MongoDB with MySQL.  The biggest difference between MongoDB and MySQL is how they store the data. MySQL uses tables (also known as rows and columns.) While MongoDB uses collections of documents. Collections of documents are bit more flexible than rows and columns.  • What are some similarities?  Obviously what makes them so similar is that both are used to store data and retrieve data.  Applications can use either Database depending what kind of trade offs they are willing to take or leave on the table. Both are capable of dealing with large amounts of data, and can utilize different query pathways to speed up the process of retrieving data.  • What are some differences?  One big one is the language/syntax. MySQL is based of SQL (Structured Query Language); This is why most of the syntax deals with inserting data, querying data from multiple tables, or even deleting data. Whereas MongoDB uses a document-based query language (this language is...

Learning Journal Week 5

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?   When the author talks about a "slow index," they’re not saying the index is broken or built wrong. What they really mean is that even if a query uses an index, the performance can still be pretty lousy. That’s because looking up an index isn’t just a quick trip through a tree structure. Once the matching entries pop up in the index, the database often has to follow a bunch of leaf nodes if there are a lot of matches. Plus, for each of those matches, the database needs to grab the corresponding row from the table. These rows can be all over the place in storage, which means the database has to deal with a bunch of slow, random I/O operations. This extra effort—especially when an index matches hu...

Learning Journal Week 6

 Embedded SQL is pretty neat because it lets you mix SQL commands right into other programming languages like C or COBOL. You start off with EXEC SQL to mark where those commands go. Essentially, you compile your program in two steps: first, a precompiler translates the SQL into the host language, and then the regular compiler turns that into something you can actually run. When it comes to talking to a database, you use connection statements like CONNECT , SET CONNECTION , and DISCONNECT . You can also share variables between SQL and your program by declaring them between BEGIN DECLARE SECTION and END DECLARE SECTION . If you’re running queries that give back more than one row, you’ll want to use cursors to handle the results with commands like DECLARE , OPEN , FETCH , and CLOSE . Want more flexibility? That’s where dynamic SQL comes in, letting you create and run SQL statements on the fly with PREPARE and EXECUTE . Now, let’s talk about Procedural SQL. It takes things up a not...