Download presentation
Presentation is loading. Please wait.
1
Database Connections
2
Databases The simplest databases can be as simple as MS Access or MS Excel Use them for small sites Large sites may require large industrial-strength databases. ORACLE is the 2nd largest software company in the world – all based on Databases
3
Database Terms: TABLE A database consists of many TABLES. A table is analogous to a spreadsheet. For an e-commerce Web site database this may consist of tables such as CUSTOMERS, PRODUCTS, ORDERS, etc.
4
Database Terms: Record
A record is a “row” of data. It all pertains to the same entity. EXAMPLE: A customer’s name and address.
5
Database Terms: Field A field is a “column” of data.
EXAMPLE: FirstName
6
Database Terms: Primary Key
The PRIMARY KEY is the column in the database that is unique for each and every row. Even something as basic and individual as an SSN may not be a good unique identifier. What if someone changes it to protect their identity, or the number is recycled, or they are not US citizens or residents.
7
Databases Web Databases – CSC 122 Teaches more about Databases
8
Making Database Queries
SQL Making Database Queries
9
SQL “S-Q-L”, or “Sequel” is the most common language to access databases. It comes in many dialects, but the most basic operations require only simple SQL statements. You program the SQL queries into your scripts.
10
SQL Example 1 - Inserting
INSERT INTO Customers (FirstName, LastName) VALUES (“Fred”, “Jones”)
11
SQL Example 2 -- Updating
UPDATE Customers SET FirstName = “Freddy” WHERE CustID = 7
12
SQL Example -- Selecting
SELECT FirstName, LastName FROM Customers WHERE LastName = Jones Use this statement to create a RECORDSET A RECORDSET is a subset of the database that has been copied onto the server for immediate use.
13
Recordset Even if the record included more than just the first name and last name, the recordset only has those columns. Freddy Jones Suzie Jones Marky Mark Jones Joanie Jones
14
SQL SELECT When choosing a recordset * A wildcard
FROM From what table? WHERE Conditions UPDATE To update an existing record INSERT To add a record INTO Into what table VALUES What values SET SET Rank = “Sergeant”
15
SQL Operators SQL Operators are conventional. Here are some: = >
< <> <= >=
16
Open Database Connectivity
ODBC
17
How do we get data from a database to a web page?
5 layers 1 Scripts – ASP, PHP 4 Driver Layer 5 Database
18
5 layers 5 layers 1 Scripts – ASP, PHP
2 ADO (Active Data Objects Layer) 3 OLE DB Layer 4 Driver Layer 5 Database
19
Important to remember ODBC is our connection
Open Data Base Connectivity Establish Database connections through the ODBC Control Panel Applet
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.