0% found this document useful (0 votes)
2 views

SQL Basics

Learn Basic

Uploaded by

bands97
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

SQL Basics

Learn Basic

Uploaded by

bands97
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

SQL Structured Query Language to access and manipulate databases

What Can SQL do?

 SQL can execute queries against a database

 SQL can retrieve data from a database

 SQL can insert records in a database

 SQL can update records in a database

 SQL can delete records from a database

 SQL can create new databases

 SQL can create new tables in a database

 SQL can create stored procedures in a database

 SQL can create views in a database

 SQL can set permissions on tables, procedures, and views

Using SQL in Your Web Site

To build a web site that shows data from a database, you will need:

 An RDBMS database program (i.e. MS Access, SQL Server, MySQL)

 To use a server-side scripting language, like PHP or ASP

 To use SQL to get the data you want

 To use HTML / CSS to style the page

Some of The Most Important SQL Commands

 SELECT - extracts data from a database

o SELECT DISTINCT (to select distinct values from a table)

SELECT Country FROM Customers;

SELECT COUNT(DISTINCT Country) FROM Customers;

For MS Access…..

SELECT Count(*) AS DistinctCountries


FROM (SELECT DISTINCT Country FROM Customers);

SELECT WHERE

SELECT column1, column2, ...


FROM table_name
WHERE condition;
 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

 CREATE INDEX - creates an index (search key)

 DROP INDEX - deletes an index

You might also like