Web Development
This presentation is the property of its rightful owner.
Sponsored Links
1 / 11

Web Development PowerPoint PPT Presentation


  • 46 Views
  • Uploaded on
  • Presentation posted in: General

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

Download Presentation

Web Development

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


Web development

Web Development

SQL


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;


  • Login