0% found this document useful (0 votes)
11 views8 pages

SQL Syntax Correct

The document provides an overview of SQL statements, which are essential for performing actions on a database. It includes examples of SQL commands such as SELECT, UPDATE, DELETE, and INSERT INTO, along with a sample database table named 'Customers'. The tutorial emphasizes that SQL keywords are case insensitive and discusses the use of semicolons to separate SQL statements.

Uploaded by

analistabi
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)
11 views8 pages

SQL Syntax Correct

The document provides an overview of SQL statements, which are essential for performing actions on a database. It includes examples of SQL commands such as SELECT, UPDATE, DELETE, and INSERT INTO, along with a sample database table named 'Customers'. The tutorial emphasizes that SQL keywords are case insensitive and discusses the use of semicolons to separate SQL statements.

Uploaded by

analistabi
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

 Tutorials  References  Exercises  Get Certified Sign In

HTML
 CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO [Link] C

Música legal para tu local

Streaming profesional desde $246/mes. Certifica

SQL Syntax
❮ Previous Next ❯

SQL Statements
Most of the actions you need to perform on a database are done with SQL statements.

SQL statements consist of keywords that are easy to understand.

The following SQL statement selects all records from the table named "Customers":

Example Get your own SQL Server

Select all records from the Customers table:

SELECT * FROM Customers;

Try it Yourself »
In this tutorial we will teach you all about the different SQL statements.
 Tutorials  References  Exercises  Get Certified Sign In

HTML
 CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO [Link] C
Database Tables
A database most often contains one or more tables. Each table is identified by a name (e.g.
"Customers" or "Orders"), and contain records (rows) with data.

In this tutorial we will use the well-known Northwind sample database (included in MS Access
and MS SQL Server).

Below is a selection from the Customers table used in the examples:

CustomerID CustomerName ContactName Address City PostalCode Co

1 Alfreds Maria Anders Obere Str. 57 Berlin 12209 Ge


Futterkiste

2 Ana Trujillo Ana Trujillo Avda. de la México 05021 Me


Emparedados y Constitución D.F.
helados 2222

3 Antonio Antonio Mataderos México 05023 Me


Moreno Moreno 2312 D.F.
Taquería

4 Around the Thomas Hardy 120 Hanover London WA1 1DP UK


Horn Sq.

5 Berglunds Christina Berguvsvägen Luleå S-958 22 Sw


snabbköp Berglund 8

 

The table above contains five records (one for each customer) and seven columns (CustomerID,
CustomerName, ContactName, Address, City, PostalCode, and Country).
 Tutorials  References  Exercises  Get Certified Sign In

HTML
 CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO [Link] C

REMOVE ADS

Keep in Mind That...


SQL keywords are NOT case sensitive: select is the same as SELECT

In this tutorial we will write all SQL keywords in upper-case.

Semicolon after SQL Statements?


Some database systems require a semicolon at the end of each SQL statement.

Semicolon is the standard way to separate each SQL statement in database systems that allow
more than one SQL statement to be executed in the same call to the server.

In this tutorial, we will use semicolon at the end of each SQL statement.

Some of The Most Important SQL Commands


SELECT - extracts data from a database
UPDATE - updates data in a database
DELETE - deletes data from a database
INSERT INTO - inserts new data into a database
CREATE DATABASE - creates a new database
ALTER DATABASE - modifies a database
CREATE TABLE - creates a new table
ALTER TABLE - modifies a table
DROP TABLE - deletes a table
 Tutorials  References  Exercises 
CREATE INDEX - creates an index (search key)
Get Certified Sign In

DROP INDEX - deletes an index


HTML
 CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO [Link] C

?
Exercise
Which SQL statement is used to select all records from a table named
'Customers'?

SELECT FROM Customers;

SELECT ALL FROM Customers;

SELECT * FROM Customers;

GET ALL FROM Customers;

Submit Answer »

❮ Previous Sign in to track progress Next ❯


 Tutorials  References  Exercises  Get Certified Sign In

HTML
 CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO [Link] C

16

COLOR PICKER

 
REMOVE ADS
Python - Get Started - [Link]
 Tutorials  References  Exercises  Get Certified Sign In

HTML
 CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO [Link] C

-->
 PLUS SPACES

GET CERTIFIED FOR TEACHERS


 Tutorials 
BOOTCAMPS
References  Exercises 
CONTACT US
Get Certified Sign In

HTML
 CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO [Link] C

Top Tutorials
HTML Tutorial
CSS Tutorial
JavaScript Tutorial
How To Tutorial
SQL Tutorial
Python Tutorial
[Link] Tutorial
Bootstrap Tutorial
PHP Tutorial
Java Tutorial
C++ Tutorial
jQuery Tutorial

Top References
HTML Reference
CSS Reference
JavaScript Reference
SQL Reference
Python Reference
[Link] Reference
Bootstrap Reference
PHP Reference
HTML Colors
Java Reference
AngularJS Reference
jQuery Reference

Top Examples Get Certified


HTML Examples HTML Certificate
CSS Examples CSS Certificate
JavaScript Examples JavaScript Certificate
How To Examples Front End Certificate
SQL Examples SQL Certificate
Python Examples Python Certificate
[Link] Examples PHP Certificate
Bootstrap Examples jQuery Certificate
PHP Examples Java Certificate
Java Examples C++ Certificate
XML Examples C# Certificate
jQuery Examples XML Certificate

    

FORUM ABOUT ACADEMY


W3Schools is optimized for learning and training. Examples might be simplified to improve reading and
learning.
Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full
correctness

 of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookies and
Tutorials  References  Exercises 
privacy policy.
Get Certified Sign In

HTML
 CSS Copyright 1999-2026 by Refsnes
JAVASCRIPT SQL [Link]
All Rights Reserved.
JAVA W3Schools
PHPis Powered
HOW by [Link].
TO [Link] C

You might also like