Web Programming Week 3 Old Dominion University

Slides:



Advertisements
Similar presentations
Virtual training week 4 structured query language (SQL)
Advertisements

 2003 Prentice Hall, Inc. All rights reserved. Chapter 22 – Database: SQL, MySQL, DBI and ADO.NET Outline 22.1 Introduction 22.2 Relational Database Model.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
ASP.NET Database Connectivity I. 2 © UW Business School, University of Washington 2004 Outline Database Concepts SQL ASP.NET Database Connectivity.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
CSC 2720 Building Web Applications Database and SQL.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
Chapter 9 SQL and RDBMS Part C. SQL Copyright 2005 Radian Publishing Co.
ASP.NET Programming with C# and SQL Server First Edition
CHAPTER 7 Database: SQL, MySQL. Topics  Introduction  Relational Database Model  Relational Database Overview: Books.mdb Database  SQL (Structured.
PHP Programming with MySQL Slide 8-1 CHAPTER 8 Working with Databases and MySQL.
 SQL stands for Structured Query Language.  SQL lets you access and manipulate databases.  SQL is an ANSI (American National Standards Institute) standard.
Chapter 7 Working with Databases and MySQL PHP Programming with MySQL 2 nd Edition.
Chapter 7 Working with Databases and MySQL PHP Programming with MySQL 2 nd Edition.
Database: SQL and MySQL
1 Structured Query Language (SQL). 2 Contents SQL – I SQL – II SQL – III SQL – IV.
SQL Basics. 5/27/2016Chapter 32 of 19 Naming SQL commands are NOT case sensitive SQL commands are NOT case sensitive But user identifier names ARE case.
SQL: DDL. SQL Statements DDL - data definition language –Defining and modifying data structures (metadata): database, tables, views, etc. DML - data manipulation.
1 Database Systems Introduction to Microsoft Access Part 2.
1 DBS201: Introduction to Structure Query Language (SQL) Lecture 1.
DBSQL 5-1 Copyright © Genetic Computer School 2009 Chapter 5 Structured Query Language.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
Web Programming Week 2 Old Dominion University Department of Computer Science CS 418/518 Fall 2010 Martin Klein 09/07/10.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 (Part II) INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 16 Using Relational Databases.
CS453: Databases and State in Web Applications (Part 2) Prof. Tom Horton.
Database UpdatestMyn1 Database Updates SQL is a complete data manipulation language that can be used for modifying the data in the database as well as.
Distribution of Marks For Second Semester Internal Sessional Evaluation External Evaluation Assignment /Project QuizzesClass Attendance Mid-Term Test Total.
7 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel 7.6 Advanced Select Queries SQL provides useful functions that.
Databases Introduction - concepts. Concepts of Relational Databases.
Programming for the Web MySQL Command Line Using PHP with MySQL Dónal Mulligan BSc MA
 MySQL  DDL ◦ Create ◦ Alter  DML ◦ Insert ◦ Select ◦ Update ◦ Delete  DDL(again) ◦ Drop ◦ Truncate.
Database Normalization. What is Normalization Normalization allows us to organize data so that it: Normalization allows us to organize data so that it:
Web Systems & Technologies
CHAPTER 7 DATABASE ACCESS THROUGH WEB
Database Access with SQL
Databases.
Chapter 5 Introduction to SQL.
Insert, Update and the rest…
Quiz Questions Q.1 An entity set that does not have sufficient attributes to form a primary key is a (A) strong entity set. (B) weak entity set. (C) simple.
Web Programming Week 3 Old Dominion University
Chapter 4 Relational Databases
Payroll Management System
CS1222 Using Relational Databases and SQL
Chapter 9 Designing Databases
Structured Query Language (SQL) William Klingelsmith
Chapter 7 Working with Databases and MySQL
Chapter 8 Working with Databases and MySQL
Normalization Referential Integrity
CS1222 Using Relational Databases and SQL
Teaching slides Chapter 8.
A Normalization Example
CS122 Using Relational Databases and SQL
Databases and Information Management
CS122 Using Relational Databases and SQL
Data Management Innovations 2017 High level overview of DB
CS1222 Using Relational Databases and SQL
CS1222 Using Relational Databases and SQL
CS1222 Using Relational Databases and SQL
Lesson Objectives Aims You should know about: 1.3.2: (a) indexing (d) SQL – Interpret and Modify (e) Referential integrity (f) Transaction processing,
CS122 Using Relational Databases and SQL
CS1222 Using Relational Databases and SQL
CS122 Using Relational Databases and SQL
Review of Week 3 Relation Transforming ERD into Relations
Web Programming Week 3 Old Dominion University
CS122 Using Relational Databases and SQL
Intro to SQL CS-422 Dick Steflik.
CS1222 Using Relational Databases and SQL
Presentation transcript:

Web Programming Week 3 Old Dominion University Department of Computer Science CS 418/518 Fall 2007 Michael L. Nelson <mln@cs.odu.edu> 9/10/07

LAMP Chapters 3, 10 of textbook Quick review of relational databases more info: http://dev.mysql.com/doc/ Quick review of relational databases normalization referential integrity Basic MySQL commands

“Graphic Novel” Super Heroes (from chapter 10)

1NF add primary key to tables eliminate repeating columns each attribute is atomic

2NF satisfy 1NF create separate tables for data duplicated across rows

3NF satisfy 2NF create separate tables for any transitive or partial dependencies see note on p. 283 on why good/evil is not in a separate table

That’s About as Far As We’ll Go Other normal forms are possible (BCNF, 4NF, 5NF) take a database class if you’re interested Referential integrity a foreign key (“link”) into another table is no longer valid “404 Errors” are bad in databases and should not happen how bad is a function of the data itself…

MySQL Hierarchy server=mln-web.cs.odu.edu database=classiccars database=superheroes table 1 table 2 table 1 table 2 table 3 table 3

Manipulating Tables & Databases CREATE - create new databases, tables ALTER - modify existing tables DELETE - erase data from tables DESCRIBE - show structure of tables INSERT INTO tablename VALUES - put data in table UPDATE - modify data in tables DROP - destroys table or database (values + structure) more: http://dev.mysql.com/doc/refman/5.0/en/sql-syntax.html

Native MySQL Data Types Unlike Perl, PHP and other civilized languages, MySQL is big into data types: http://dev.mysql.com/doc/refman/5.0/en/data-types.html many examples in chapter 3, 10

SQL Query Form SELECT [fieldnames] FROM [tablenames] WHERE [criteria] ORDER BY [fieldname to sort on] [DESC] LIMIT [offset, maxrows] more: http://dev.mysql.com/doc/refman/5.0/en/select.html look at chapters 3 and 10 for code examples