Skip To Content

Athabasca University

Section 4.2 SQL Fundamentals

Learning Objectives

After you have completed this section, you should be able to

  • write database queries in structured query language (SQL).

Activities

  • Carefully read the learning objectives.
  • Watch related section of the presentation for Chapter 18;
  • Read section 18.4, SQL of Chapter 18.
  • Study the tutorial at http://www.dcs.napier.ac.uk/~andrew/sql/.
  • Find answers to the study questions below.
  • Design a database called “books” for a library. It should have at least two tables: book and borrower.
  • Write an SQL file that can be used to create the above two tables.

Study Questions

  1. What commands does SQL provide?
  2. What can you do with the SELECT query command?
  3. How do you use the SELECT query command?
  4. What should directly follow the SELECT keyword?
  5. What should directly follow the FROM keyword in a SELECT query command?
  6. When do you need to use the WHERE clause in a SELECT query? How do you use it?
  7. When do you need to use the GROUP BY clause in a SELECT query?
  8. What does the COUNT(*) AS count clause do?
  9. When do you need to use the ORDER BY clause in a SELECT query?
  10. How do you merge data from multiple tables using the SELECT query?
  11. How do you insert a record into a table using the INSERT INTO command?
  12. How do you modify data in a table using the UPDATE command?
  13. How do you remove data from a table using the DELETE FROM command?

Updated April 14 2016 by FST Course Production Staff