Advanced SQL  «Prev  Next»
Lesson 3SQL Course Requirements
ObjectiveRequirements to take this course?

SQL Course Requirements

Software:

Your database can be any database you are familiar with that will let you issue SQL queries against it.
These include:
  1. Microsoft SQL Server 2015/2018
  2. Microsoft Access 2013/2016
  3. Oracle 12/13c/18c
  4. MySQL 6.1.5

The database we are will be using for this course is the PUBS database. This is the same database we used in Introduction to SQL, Part 1.
If you do not have the PUBS database, you can get it by clicking Help in the toolbar on the left and looking under Database scripts.

You can also download an MS Access version of PUBS in the same location.If you are not familiar with the PUBS database, you can get more information pubs-database.
We will be using a number of tools to work with the PUBS database. First and foremost, consider using the Microsoft Query tool if you have it. Query will let you work with any of the standard databases, including SQL Server, Oracle, Access, and others.
In order to use Query, you will need to set up a data source for your database. If you need help with that process, consult the Query documentation. Finally, there are other tools that you can use. As long as they can connect to your database engine, and allow you to enter SQL statements, you are all set.

What is SQL?

SQL is ubiquitous. In order to have any hope of writing SQL code that you can be sure is accurate, meaning it does exactly what it is supposed to do, you must follow some appropriate discipline. It is the premise of this module that using SQL relationally is the discipline you need. But what does this mean? Isn't SQL relational anyway?
Well, it is true that SQL is the standard language for use with relational databases, but that fact in itself does not make it relational. The sad truth is, SQL departs from relational theory in all too many ways. For example, duplicate rows and nulls are two obvious examples, but they are not the only ones. So you need to understand relational theory to know about SQL's departures from that theory and you need to know how to avoid the problems they can cause. In a word, you need to use SQL within the context of relational database design. Then you can behave as if SQL truly were relational, and you can enjoy the benefits of working with what is, in effect, a truly relational system. Now, a course like this would not be needed if everyone was using SQL relationally already. On the contrary, I observe much bad practice in current SQL usage. I even observe such practice being recommended, in books and similar publications, by writers who really ought to know better. In fact, a review of the literature in this regard is a pretty dispiriting exercise. The relational model first saw the light of day in 1969, and yet here we are, over 50 years later, and it still does not seem to be very well understood by the database community at large. Partly for such reasons, this course uses the relational model itself as an organizing principle. It explains various features of the model in depth, and shows in every case how best to use SQL in order to comply with the feature in question.