Module 10 - SQL Primer

Module Objectives

Data Types

Structured Query Language

Demo - Data Types and SQL Commands

Tables

Constraints

Types of Constraints

Example - CREATE TABLE

Example - SERIAL Data Type

ALTER TABLE

DROP TABLE

Demo - Create, Drop and Alter Table

Inserting Data

Example - INSERT

Demo - Insert

Updating Rows

Example - UPDATE

Demo - Update

How to Upsert in EDB Postgres Advanced Server

Deleting Data

Example - DELETE

Demo - Delete

Views

Example - View

Demo - Views

Materialized Views

Materialized View Example

Sequences

Demo - Sequences

Domains

Example - Domain

Demo - Domains

Quoting

Demo - Quoting

Using SQL Functions

Format Functions

Concatenating Strings

Nested SELECT Statements

Inner Joins

Column and Table Aliases

Outer Joins

Indexes

Example Index

Module Summary

Lab Exercise - 1

Lab Exercise - 2

Lab Exercise - 3

Lab Exercise - 4

Lab Exercise - 5