0% found this document useful (0 votes)
21 views9 pages

Understanding Basic SQL Syntax: Jon Flanders

Uploaded by

Enrik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views9 pages

Understanding Basic SQL Syntax: Jon Flanders

Uploaded by

Enrik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Understanding Basic SQL Syntax

Jon Flanders

@jonflanders www.jonflanders.com
A SQL Statement is an
expression that tells a
database what you want it
to do.
SELECT CLAUSE FROM CLAUSE

{
{{
SELECT first_name FROM person ;
{
{

{
KEYWORD KEYWORD

IDENTIFIER IDENTIFIER
Basic SQL Commands

id first_name last_name

1 Jon Flanders
SELECT

Retrieves one or more rows from one or more tables

SELECT first_name, last_name FROM contacts;


Basic SQL Commands

id first_name last_name

1 Jon Flanders

INSERT 2 Fritz Onion

Adds one or more rows into a table

INSERT INTO contacts (first_name, last_name)


VALUES (‘Fritz’,’Onion’);
Basic SQL Commands

id first_name last_name

1 Jon Flanders
Ahern

UPDATE

Modifies one or more rows in a table

UPDATE contacts SET last_name = ‘Ahern’ WHERE id = 1;


Basic SQL Commands
id first_name last_name

1 Jon Flanders

2 Fritz Onion
DELETE

Removes one or more rows from one table

DELETE FROM contacts where id = 2;

More on these commands in later modules!


I’ll be using MySQL
ANSI SQL Only

Course SQL Keywords will be in upper-case

Housekeeping Table names will be singular


Column names will never be repeated
Summary

! Once you understand the basics of SQL

You might also like