How to Have an SQL Tutorial
- 1). Begin any SQL tutorial with the process of logging into the SQL database itself. This process varies between different SQL systems. Once in the system, the "use" command is often required to select a particular database before any work can be done.
- 2). Instruct participants to first see what the database already contains before moving further with any work. The "SHOW TABLES" command should be one of the first moves after logging into any database. Students will see how a database can store many tables. Alternately, if the database is brand new, students can see how a database responds to this command when it is entirely empty.
- 3). Use the "CREATE TABLE" syntax to outline how brand-new tables are constructed. This is one of the most important and complicated aspects of any database design. Each table will have multiple columns or fields, and each must be formatted to contain all the possible data items that a user might place into the table in the future. A discussion of the various formats, including text, numerical and data types and the many sub-types should be a primary focus of any SQL tutorial.
- 4). Discuss the two primary methods for entering data into a table and how they vary. The "LOAD" syntax is primarily used to migrate bulk data from one system into another, while "INSERT" syntax is the common way of adding new data to a database one record at a time. The process of entering data is not particularly complicated either way; thus, this will not likely be a large section of any SQL tutorial.
- 5). Identify many different applications of the "SELECT" command. This function is the most widely used tool in any SQL environment. "SELECT" statements, in the most basic function, extract data out of a database so it can be viewed. However, different uses of these statements can also filter and sort data prior to extraction. Entirely new data can be created by using mathematical functions in combination with a "SELECT" command. Thus, data analysis on existing table data is also implemented using this single function. The bulk of any SQL tutorial will discuss the various scenarios for using "SELECT" as it is this function thath actually makes a database useful once it contains data.
Source...