Web Programming Step by Step, 2nd Edition Lecture 13_ Relational Databases and SQL - Except where otherwise noted the contents of this document are

Web Programming Step by Step, 2nd Edition Lecture 13_ Relational Databases and SQL

This preview shows page 1 - 5 out of 41 pages.

±²³´³µ²±´ :HE 3URJUDPPLQJ 6WHS E\ 6WHS¶ µQG (GLWLRQ /HFWXUH ±·¸ 5HODWLRQDO 'DWDEDVHV DQG 64/ KWWS¸³³ZZZ¹ZHEVWHSERRN¹FRP³VXSSOHPHQWVºµHG³VOLGHV³FKDSWHU±·ºGDWDEDVHVºVTO¹VKWPO»VOLGHµ¼ ±³½± :HE 3URJUDPPLQJ 6WHS E\ 6WHS± ²QG (GLWLRQ &KDSWHU ³´µ 5HODWLRQDO 'DWDEDVHV DQG 64/ Except where otherwise noted, the contents of this document are Copyright 2012 Marty Stepp, Jessica Miller, and Victoria Kirst. All rights reserved. Any redistribution, reproduction, transmission, or storage of part or all of the contents in any form is prohibited without the author's expressed written permission. ³´¶³µ 'DWDEDVH %DVLFV 13.1: Database Basics 13.2: SQL 13.3: Multi-table Queries 13.4: Databases and PHP
Image of page 1
±²³´³µ²±´ :HE 3URJUDPPLQJ 6WHS E\ 6WHS¶ µQG (GLWLRQ /HFWXUH ±·¸ 5HODWLRQDO 'DWDEDVHV DQG 64/ KWWS¸³³ZZZ¹ZHEVWHSERRN¹FRP³VXSSOHPHQWVºµHG³VOLGHV³FKDSWHU±·ºGDWDEDVHVºVTO¹VKWPO»VOLGHµ¼ µ³½± 5HODWLRQDO GDWDEDVHV relational database : A method of structuring data as tables associated to each other by shared attributes. a table row corresponds to a unit of data called a record ; a column corresponds to an attribute of that record relational databases typically use Structured Query Language (SQL) to define, manage, and search data :K\ XVH D GDWDEDVH" powerful : can search it, filter data, combine data from multiple sources fast : can search/filter a database very quickly compared to a file big : scale well up to very large data sizes safe : built-in mechanisms for failure recovery (e.g. transactions ) multi-user : concurrency features let many users view/edit data at same time abstract : provides layer of abstraction between stored data and app(s) many database programs understand the same SQL commands
Image of page 2
±²³´³µ²±´ :HE 3URJUDPPLQJ 6WHS E\ 6WHS¶ µQG (GLWLRQ /HFWXUH ±·¸ 5HODWLRQDO 'DWDEDVHV DQG 64/ KWWS¸³³ZZZ¹ZHEVWHSERRN¹FRP³VXSSOHPHQWVºµHG³VOLGHV³FKDSWHU±·ºGDWDEDVHVºVTO¹VKWPO»VOLGHµ¼ ·³½± 'DWDEDVH VRIWZDUH Oracle Microsoft SQL Server (powerful) and Microsoft Access (simple) PostgreSQL (powerful/complex free open-source database system) SQLite (transportable, lightweight free open-source database system) MySQL (simple free open-source database system) many servers run " LAMP " (Linux, Apache, MySQL, and PHP) Wikipedia is run on PHP and MySQL we will use MySQL in this course ([DPSOH simpsons GDWDEDVH students id name email 123 Bart [email protected] 456 Milhouse [email protected] 888 Lisa [email protected] 404 Ralph [email protected] teachers id name 1234 Krabappel 5678 Hoover 9012 Stepp courses id name teacher_id 10001 Computer Science 142 1234 10002 Computer Science 143 5678 10003 Computer Science 190M 9012 10004 Informatics 100 1234 grades student_id course_id grade 123 10001 B- 123 10002 C 456 10001 B+ 888 10002 A+ 888 10003 A+ 404 10004 D+ to test queries on this database, use username , password ɥ
Image of page 3
±²³´³µ²±´ :HE 3URJUDPPLQJ 6WHS E\ 6WHS¶ µQG (GLWLRQ /HFWXUH ±·¸ 5HODWLRQDO 'DWDEDVHV DQG 64/ KWWS¸³³ZZZ¹ZHEVWHSERRN¹FRP³VXSSOHPHQWVºµHG³VOLGHV³FKDSWHU±·ºGDWDEDVHVºVTO¹VKWPO»VOLGHµ¼ ½³½± ([DPSOH world GDWDEDVH countries Other columns: region , surface_area , life_expectancy , gnp_old , local_name , government_form , capital , code2 code name continent independence_year population gnp head_of_state ...
Image of page 4
Image of page 5

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture