1 Databases November 15, 2005 Slides modified from Internet & World Wide Web: How to Program. 2004 (3rd) edition. By Deitel, Deitel, and Goldberg. Published.

Slides:



Advertisements
Similar presentations
 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.
Advertisements

 Pearson Education, Inc. All rights reserved Accessing Databases with JDBC.
Introduction to Structured Query Language (SQL)
1 Introduction to Web Application Introduction to Data Base.
Introduction to Structured Query Language (SQL)
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Chapter 12 Database Connectivity with ASP.NET JavaScript, Third Edition.
CSCI 3328 Object Oriented Programming in C# Chapter 12: Databases and LINQ 1 Xiang Lian The University of Texas – Pan American Edinburg, TX 78539
Exercise SELECT authorID, lastName FROM authors AuthorID FirstName
INFORMATION TECHNOLOGY IN BUSINESS AND SOCIETY SESSION 16 – SQL SEAN J. TAYLOR.
 2000 Deitel & Associates, Inc. All rights reserved. Chapter 25 – Database: SQL, ADO and RDS Outline 25.1Introduction 25.2Relational Database Model 25.3Relational.
ASP.NET Programming with C# and SQL Server First Edition
Intro to JDBC To effectively use Java Data Base Connectivity we must understand: 1.Relational Database Management Systems (RDBMS) 2.JDBC Drivers 3.SQL.
 2008 Pearson Education, Inc. All rights reserved Database: SQL, MySQL, ADO.NET 2.0 and Java DB.
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.
A CCESSING D ATABASES WITH JDBC CH 24 C S 442: A DVANCED J AVA P ROGRAMMING.
 SQL stands for Structured Query Language.  SQL lets you access and manipulate databases.  SQL is an ANSI (American National Standards Institute) standard.
 2003 Prentice Hall, Inc. All rights reserved. 1 Java Database Connectivity with JDBC TM.
CIS 270—Application Development II Chapter 25—Accessing Databases with JDBC.
Introduction to SQL Steve Perry
Pemrograman VisualMinggu …10… Page 1 MINGGU Ke Sepuluh Pemrograman Visual Pokok Bahasan: ADO.NET II Tujuan Instruksional Khusus: Mahasiswa dapat menjelaskan.
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.
CHAPTER 8 Database: SQL, MySQL. Topics  Introduction  Relational Database Model  Relational Database Overview: Books.mdb Database  SQL (Structured.
CSC 411/511: DBMS Design Dr. Nan WangCSC411_L12_JDBC_MySQL 1 MySQL and JDBC.
Database: SQL and MySQL
SQL 101 for Web Developers 14 November What is a database and why have one? Tables, relationships, normalization SQL – What SQL is and isn’t – CRUD:
Database Fred Durao What is a database? A database is any organized collection of data. Some examples of databases you may encounter in.
 2004 Prentice Hall, Inc. All rights reserved. 1 Segment – 6 Web Server & database.
Database, SQL, and ADO.NET- Part 1 Session 11 Mata kuliah: M0874 – Programming II Tahun: 2010.
7 1 Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Databases MIS 21. Some database terminology  Database: integrated collection of data  Database Management System (DBMS): environment that provides mechanisms.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
SQL Basic. What is SQL? SQL (pronounced "ess-que-el") stands for Structured Query Language. SQL is used to communicate with a database.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
Visual Programing SQL Overview Section 1.
SQL LANGUAGE and Relational Data Model TUTORIAL Prof: Dr. Shu-Ching Chen TA: Hsin-Yu Ha.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved. 2 Revised by Dr. T. Tran for CSI3140.
CS453: Databases and State in Web Applications (Part 2) Prof. Tom Horton.
A CCESSING D ATABASES WITH JDBC CH 24 C S 442: A DVANCED J AVA P ROGRAMMING.
 2008 Pearson Education, Inc. All rights reserved Database: SQL, MySQL, ADO.NET 2.0 and Java DB.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 22 - SQL, MySQL, DBI and ADO Outline 22.1 Introduction 22.2 Relational Database Model 22.3 Relational.
Databases and ADO.NET Programming Right from the Start with Visual Basic.NET 1/e 11.
 2009 Pearson Education, Inc. All rights reserved Databases and LINQ to SQL.
Database Connectivity with ASP.NET. 2 Introduction Web pages commonly used to: –Gather information stored on a Web server database Most server-side scripting.
CSCI 3328 Object Oriented Programming in C# Chapter 12: Databases and LINQ – Exercises 1 Xiang Lian The University of Texas Rio Grande Valley Edinburg,
ECMM6018 Enterprise Networking For Electronic Commerce Tutorial 6 CGI/Perl and databases.
Database: SQL, MySQL, LINQ and Java DB © by Pearson Education, Inc. All Rights Reserved.
Distribution of Marks For Second Semester Internal Sessional Evaluation External Evaluation Assignment /Project QuizzesClass Attendance Mid-Term Test Total.
1 Section 1 - Introduction to SQL u SQL is an abbreviation for Structured Query Language. u It is generally pronounced “Sequel” u SQL is a unified language.
COM621: Advanced Interactive Web Development Lecture 11 MySQL – Data Manipulation Language.
 MySQL is a database system used on the web  MySQL is a database system that runs on a server  MySQL is ideal for both small and large applications.
Chapter 12 Introducing Databases. Objectives What a database is and which databases are typically used with ASP.NET pages What SQL is, how it looks, and.
ORDER BY Clause The result of a query can be sorted in ascending or descending order using the optional ORDER BY clause. The simplest form of.
INTRODUCTION TO DATABASES (MICROSOFT ACCESS)
Database, SQL and ADO.NET
Web Systems & Technologies
CHAPTER 7 DATABASE ACCESS THROUGH WEB
 2012 Pearson Education, Inc. All rights reserved.
Introduction to Structured Query Language(SQL)
JDBC.
Databases Intro (from Deitel)
Chapter 8 Working with Databases and MySQL
Databases - בסיסי נתונים
Chapter 22 - SQL, MySQL, DBI and ADO
MySQL Database System Installation Overview SQL summary
Manipulating Data Lesson 3.
Java Chapter 6 (Estifanos Tilahun Mihret--Tech with Estif)
Presentation transcript:

1 Databases November 15, 2005 Slides modified from Internet & World Wide Web: How to Program (3rd) edition. By Deitel, Deitel, and Goldberg. Published by Prentice Hall. ISBN

2 Chapter 22 – Database: SQL, MySQL, DBI and ADO.NET Outline 22.1 Introduction 22.2 Relational Database Model 22.3 Relational Database Overview: Books.mdb Database 22.4 SQL (Structured Query Language) Basic SELECT Query WHERE Clause ORDER BY Clause Merging Data from Multiple Tables: INNER JOIN Joining Data from Tables Authors, AuthorISBN, Titles and Publishers INSERT Statement UPDATE Statement DELETE Statement 22.5 MySQL 22.6 Introduction to DBI Perl Database Interface PHP dbx module Python DB-API 22.7 ADO.NET Object Model 22.8 Web Resources

3 Objectives In this lesson, you will learn: –To understand the relational database model. –To be able to write database queries using SQL (Structured Query Language). –To understand the MySQL database server. –To learn various database interfaces. –To understand ADO.NET’s object model.

Introduction Database –Integrated collection of data –Database management system (DBMS) Store and organize data consistent with database’s format Relational database –SQL (Structured Query Language) »Queries »Manipulate data

Relational Database Model Composed of tables Row –Number column –Primary key Reference data in the table A column or set of columns in table contains unique data

Relational Database Model Fig. 22.1Relational database structure of an Employee table.

Relational Database Model departmentlocation 413New Jersey 642Los Angeles 611Orlando Fig. 22.2Table formed by selecting department and location data from the Employee table.

Relational Database Overview: Books.mdb Database Primary key uniquely identifies each row –Rule of Entity Integrity Composite primary key Lines connecting tables –Relationships One-to-many relationship Foreign key –Join multiple tables –Rule of Referential Integrity

Relational Database Overview: Books.mdb Database Fig Table relationships in Books.mdb.

10 phpMyAdmin Go to phpmyadmin folder of EasyPHP website phpMyAdmin opens automatically by default Some start-up tutorials: –Simple and straight to the pointSimple and straight to the point –Also straightforwardAlso straightforward –Another quick introAnother quick intro –A good introduction to MySQL with phpMyAdminA good introduction to MySQL with phpMyAdmin –Full official phpMyAdmin documentationFull official phpMyAdmin documentation Importing data into MySQL via phpMyAdmin

SQL (Structured Query Language)

Basic SELECT Query SELECT * FROM tableName –SELECT * FROM Authors –SELECT authorID, lastName FROM Authors

WHERE Clause Specify selection criteria for query –SELECT columnName1, columnName2, … FROM tableName WHERE criteria SELECT title, editionNumber, copyright FROM Titles WHERE copyright > 1999 –LIKE Pattern matching –Asterisk ( * ) »SELECT authorID, firstName, lastName FROM Authors WHERE lastName LIKE ‘D*’ –Question mark ( ? ) »SELECT authorID, firstName, lastName FROM Authors WHERE lastName LIKE ‘?I*’

WHERE Clause

WHERE Clause

ORDER BY Clause Arranged in ascending or descending order –SELECT columnName1, columnName2, … FROM tableName ORDER BY column ASC SELECT authorID, firstName, lastName FROM Authors ORDER BY lastName ASC –SELECT columnName1, columnName2, … FROM tableName ORDER BY column DESC SELECT authorID, firstName, lastName FROM Authors ORDER BY lastName DESC

ORDER BY Clause

Merging Data from Multiple Tables: INNER JOIN Normalize databases –Ensure database does not store data redundantly –SELECT columnName1, columnName2, … FROM table1 INNER JOIN table2 ON table1, columnName = table2.columnName

Joining Data from Tables Authors, AuthorISBN, Titles and Publishers

INSERT Statement Inserts new row in table –INSERT INTO tableName ( columnName1, columnName2, …, columnNameN ) VALUES ( value1, value2, …, valueN )

UPDATE Statement Modifies data in a table –UPDATE tableName SET columnName1 = value1, columnName2 = value2, …, columnNameN = valueN WHERE criteria

DELETE Statement Removes data from a table –DELETE FROM tableName WHERE criteria

MySQL Multi-user and multi-threaded RDBMS server Uses SQL to interact with and manipulate data Supports various programming languages Access tables from different databases Handle large databases

PHP dbx module Seven functions that interface to database modules MySQL PostgreSQL Microsoft SQL Server Oracle Sybase FrontBase ODBC (Open Database Connectivity)

PHP dbx module

Web Resources leap.sourceforge.net msdn.microsoft.com/library/devprods/vs6/vstudio/mdac200 /mdac3sc7.htm