slide1
Download
Skip this Video
Download Presentation
Web Development

Loading in 2 Seconds...

play fullscreen
1 / 11

Web Development - PowerPoint PPT Presentation


  • 67 Views
  • Uploaded on

Web Development. SQL. What is it?. SQL stands for Structured Query Language It is a text based scripting language for setting up and manipulating databases There are different flavours of SQL depending upon the manufacturer and software used

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Web Development' - damon


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
what is it
What is it?
  • SQL stands for Structured Query Language
  • It is a text based scripting language for setting up and manipulating databases
  • There are different flavours of SQL depending upon the manufacturer and software used
  • E.g. Microsoft SQL has a few differences to other versions
  • We will be using an open source database: MySQL (pronounced My Sequel)
how it fits in with php
How it fits in with PHP
  • Remember that EasyPHP comes as three programs, together known as AMP:
    • Apache
    • MySQL
    • PHP
  • That’s why MySQL can be used on its own; it is a program in its own right
  • PHP goes together nicely with MySQL because web apps often need a back end database
ways to use it
Ways to use it
  • SQL can be used on its own in phpMyAdminor embedded within php code
  • In phpMyAdmin, the commands can be typed in one at a time or processed in a batch file
  • To open phpMyAdmin, right click on the php server icon, then select Configuration and phpMyAdmin
  • SQL commands are written in uppercase. E.g. CREATE (this makes it stand out in the php code)
sql commands
SQL Commands
  • CREATE:
    • Used to create whole databases or tables:
    • E.g. CREATE DATABASE mydatabase;
    • CREAT TABLE people;
    • Note: SQL lines end with a semi colon ;
sql commands1
SQL Commands
  • INSERT INTO:
    • Used to add data into tables:
    • E.g. INSERT INTO people VALUES (1, “fred”);
sql commands2
SQL Commands
  • SELECT:
    • Used to query the database
    • This is the one you really need to know for the assignment!
    • E.g. SELECT name FROM people;
    • SELECT * FROM people;
sql commands3
SQL Commands
  • WHERE:
    • Used to add criteria to a query
    • Another one you really need to know for the assignment!
    • E.g. SELECT name FROM people WHERE age=21;
sql commands4
SQL Commands
  • LIKE:
    • Used to add wildcards to a query
    • E.g. SELECT name FROM people WHERE age LIKE ‘2%’;
    • This query would return a match for all people with an age that started with 2
sql commands5
SQL Commands
  • ORDER BY:
    • Used to sort query results into order
    • E.g. SELECT name FROM people WHERE age=21 ORDER BY name;
sql commands6
SQL Commands
  • AND / OR:
    • Used to make logical choices when querying
    • E.g. SELECT name FROM people WHERE age>17 AND age<66 ORDER BY name;
ad