Introduction to Databases
This book is a work in progress
This book is being written and is not yet completed. Feel free to dive in and start reading anyway. Of course all feedback is welcome by the Authors.
This book is an introductory book to the concept of databases. It can be used for self-studies, or as course literature for a basic database course (a course which serves as an introduction to databases and SQL). The book , exercises and video lectures use a command line interface with bash and SQLite3.
Before reading this book
Any one with basic knowledge of computing and IT, who wants to learn the basics of using databases.
This book assumes you have knowledge of the working from the command line with a shell like bash. We also assume that you have a basic understanding of the standard streams and how they can be redirected or joined with pipes. If you feel that you need to freshen up your Bash skills before starting with this book, we recommend our Bash book, Bash-introduction.
(Rough outline - subject to changes in the future)
- Database:Introduction to Databases
- Database:Exercise - Introduction to Databases
- Database:Retrieving rows of data - SQL SELECT
- Database:Exercise - Retrieving rows of data - SQL SELECT
- Database:Getting started with SQLite
- Database:Exercise - Getting started with SQLite
- Database:Changing rows of data - SQL UPDATE
- Database:Exercise - Changing rows of data - SQL UPDATE
- Database:Deleting rows of data -SQL DELETE
- Database:Exercise - Deleting rows of data -SQL DELETE
- Database:Adding rows with new data - SQL INSERT
- Database:Exercise - Adding rows with new data - SQL INSERT
- Database:Assignment 1 - The basics
- Database:Combining rows of data from related tables - SQL JOIN
- Database:Exercise - Combining rows of data from related tables - SQL JOIN
- Database:Adding constraints to prevent garbage data
- Database:Exercise - Adding constraints to prevent garbage data
- Database:Scraping data from the web
- Database:Exercise - Scraping data from the web
- Database:Assignment 2 - JOINs and Constraints
Book companion/Extra material
- Getting started with MariaDB - Extra material for students/readers who wish to learn also a little about MariaDB/MySQL
- Some MariaDB equivalents of .schema .databases .tables etc
- Gettring started with PostgreSQL - Extra material for students/readers who wish to learn also a little about PostgreSQL
- Short presentation on CREATE TABLE syntax (PDF) Databases - create statement (video)
- ALTER TABLE MariaDB version - Extra material for students/readers who wish to learn also a little about MariaDB/MySQL
- Extra lecture on JOINs (pdf)
- The SQLite web site is an important resource as a companion for this wiki book.
- If you want to move on to MariaDB, you should check out the official web site for MariaDB.
Reading tips (Swedish)
- For Swedish readers, we recommend the book Databasteknik (Studentlitteratur) which is a quite complete book on database technology
- Also for Swedish readers, we recommend the web course related to the above book at http://www.databasteknik.se/webbkursen/ which covers a subset of the chapters of the related book above
We might add some more extra reading material here in the future.
What this book doesn't pretend to be
This book doesn't claim to be computer science or theoretical or even very technical. We strive to give the reader a practical introduction to what databases are, what database management systems are and how to use SQL to retrieve and manipulate data. We will not touch upon theoretical frameworks such as relational theory, relational algebra or set theory. Heck, we aren't even teaching logic. We believe that the reader is perfectly capable of getting a grasp of the basics behind databases and SQL without too much theoretic excursions. We are even inclined to think that understanding the basics of SQL and relational databases on this introductory level isn't simplified by introducing mathematics and computational models.
We focus on the practical and - as usual with our books - base a lot of the teaching through the use of exercises and assignments.
A warning and disclaimer; Some readers with a theoretical background might be offended by our avoiding such terminology as "relational model", "tuples", "Cartesian product", "Relational Calculus", "Cardinality", or, even "Projection"! This book is not for them. There are numerous theoretical books for those who have a strong need for more mathematical or philosophical descriptions of database usage.