EDITIONS REMYLENT     REMYLENT@GMAIL.COM

GETTING STARTED WITH SQL

Chapter 1 : The working environment

1.1 Installing the local MAMP server

1.2 Starting the phpMyAdmin tool

1.3 Creating a database


Chapter 2 : Tables

2.1 The table, the fields and the primary key

2.1.1 Creating a table

2.1.2 Workshop

2.1.3 Adding information to a table

2.1.4 Finding information in a table

2.1.5 Multiple operators

2.1.6 Miscellaneous operators

2.2 The SELECT command

2.2.1 Examples with SELECT

2.2.2 Sorting a column with Order By

2.2.3 Grouping with GROUP By

2.2.4 The HAVING clause

2.3 Managing records

2.3.1 Deleting a record

2.3.2 Copying a record

2.3.3 The UPDATE command

2.4 Calculating

2.4.1 Grouping and totaling

2.4.2 Statistics

2.4.3 Calculating with a condition WHERE

2.4.4 Calculating with UPDATE

2.4.5 Duplicating a table

2.5 The routines

2.6 The views

2.7 The triggers

2.8 The console

2.9 The privileges


Chapter 3 : Relationships

3.1 Defining relationships

3.1.1 The BOOKS table

3.1.2 The SHOPS table

3.1.3 Displaying the schema

3.1.4 Creating a foreign key

3.1.5 Creating a relationship

3.1.6 The table constraints

3.1.7 The UPDATE or DELETE constraints

3.2 Multi-table queries

3.2.1 The query window

3.2.2 Performing a query by example

Chapter 4 : Functions

4.1 The text functions

4.2 The date functions

4.2.1 Creating a table with dates

4.2.2 Calculations with dates

A) Displaying the number of days between two dates

B) Displaying the number of months between two dates

C) Displaying the number of years between two dates

D) Adding 13 days to a date

E) Subtracting 10 days from a date

F) Subtracting 3 months from a date

G) Adding years to a date

4.2.3 The current date and time

4.2.4 Extracting parts of date

4.2.5 Day of month, week and year

4.3 Functions about numbers

4.4 The aggregate functions


Chapter 5 : Advanced SQL Queries

5.1 A CASE expression in a SELECT

5.2 The COALESCE function and NULL values

5.3 More complex sorting

5.3.1 Sorting with an index

5.3.2 Sorting with several columns

5.3.3 Sorting on substrings

5.4 Ensemble queries

5.4.1 The UNION operator

5.4.2 Creating a table with the UNION operator

5.4.3 The MINUS operator

5.4.4 The IN operator

5.5 Joining several tables

5.5.1 Creating a foreign key

5.5.2 Finding identical names

5.5.3 The LEFT OUTER JOIN operator

5.5.4 The RIGHT OUTER JOIN operator

5.6 Deletions

5.6.1 Removing records in a table

5.6.2 Deleting a table

5.5.3 Deleting an index in a table

5.7 Enumerating objects in a table


Glossary