Information Retrieval Part 1
This week we learned a lot about using SQL queries in order to retrieve information from relational databases. One of the topics covered in the lectures was the relevance of the relational database model in the modern-day. There are many current relational database products including (but not limited to): Oracle Database, Microsoft SQL Server, IBM DB2, MySQL, PostgreSQL, and SQLite. A topic of discussion was the fact that relational databases might be getting replaced. In a NetworkWorld article it said, “‘The heyday of the 30-year-old relational database is over, and Oracle has missed the shift to next-generational database technology needed to meet today’s big data challenges.’” This PR representative said that products like NoSQL will topple the prevalence of relational database technology like the one that Oracle provides. The article author, however, pointed out that this is probably not the case, since in the world of enterprise technology, adoption is a very slow process. The author further mentioned, “In my experience, it takes a long time for new technology to make its way from the development lab to research institutions to academic institutions to appear in enterprise data centers.” Thus it is very likely that for the foreseeable future, relational databases will still be in prevalent use in many enterprise data centers around the world.
We also learned how to run our own SQL queries in SQLite. The main topic of discussion on information retrieval and querying was the universal use of the Standard Querying Language (SQL). SQL is used in all aspects of querying relational databases and retrieving data. The past two summers, I worked at a company named Insurity, working on a .NET Web Application. During my time there, I used many different technologies and languages, including PowerShell, C#, AngularJS, etc. However, what I came to learn is that C# since version 3.0 has a set of features named LINQ or Language Integrated Query.
LINQ has several areas of functionality, including LINQ to Objects, LINQ to SQL, and LINQ to XML, among others. I primarily used LINQ to Objects and LINQ to XML at my time at Insurity, however using LINQ totally changed my programming style (specifically in C#). Using the newly provided extension methods that mirrored standard SQL commands, it was very simple to sort, filter, search, or just work with any enumerable set of data as well as nodes in XML. Instead of iterating through a list and only keeping strings starting with “S”, you’d utilize the “Where” extension method and use that to filter the starting list. On top of the extension methods for any enumerable set of data, you can also use plain sql commands in your C# code. For example:
var mypatient = from pa in patients
where pa.Age > 20
orderby pa.PatientName, pa.Gender, pa.Age
SQL serves a purpose in data retrieval from a database, but it’s also an integral part of the C# language.