Databases in Web Devolvement By Andy Larson Using Microsoft Sever 2000 with ASP Database Integrity Inserting data Stored procedures Views Triggers Tips.

Slides:



Advertisements
Similar presentations
Accounting System Design
Advertisements

Advantage Data Dictionary. agenda Creating and Managing Data Dictionaries –Tables, Indexes, Fields, and Triggers –Defining Referential Integrity –Defining.
Introduction to Structured Query Language (SQL)
Fundamentals, Design, and Implementation, 9/e Chapter 14 JDBC, Java Server Pages, and MySQL.
Introduction to Structured Query Language (SQL)
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Fundamentals, Design, and Implementation, 9/e Chapter 11 Managing Databases with SQL Server 2000.
ASP.NET Database Connectivity I. 2 © UW Business School, University of Washington 2004 Outline Database Concepts SQL ASP.NET Database Connectivity.
Fundamentals, Design, and Implementation, 9/e Chapter 7 Using SQL in Applications.
Concepts of Database Management Sixth Edition
5 Chapter 5 Structured Query Language (SQL1) Revision.
Introduction to Structured Query Language (SQL)
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Database Design Overview. 2 Database DBMS File Record Field Cardinality Keys Index Pointer Referential Integrity Normalization Data Definition Language.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
SEMESTER 1, 2013/2014 DB2 APPLICATION DEVELOPMENT OVERVIEW.
Advanced Web 2012 Lecture 4 Sean Costain PHP Sean Costain 2012 What is PHP? PHP is a widely-used general-purpose scripting language that is especially.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 13 Managing Databases with SQL Server 2000.
XP Chapter 1 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Level 3 Objectives: Identifying and Eliminating Database.
Analysis of SQL injection prevention using a proxy server By: David Rowe Supervisor: Barry Irwin.
Chapter 1 Overview of Database Concepts Oracle 10g: SQL
RDB/1 An introduction to RDBMS Objectives –To learn about the history and future direction of the SQL standard –To get an overall appreciation of a modern.
Chapter 4 The Relational Model 3: Advanced Topics Concepts of Database Management Seventh Edition.
Database Technical Session By: Prof. Adarsh Patel.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
Lecture 2 An Overview of Relational Database IST 318 – DB Admin.
Lecture 7 Integrity & Veracity UFCE8K-15-M: Data Management.
RDBMS Concepts/ Session 3 / 1 of 22 Objectives  In this lesson, you will learn to:  Describe data redundancy  Describe the first, second, and third.
Database Management COP4540, SCS, FIU Relation Normalization (Chapter 14)
Normalization (Codd, 1972) Practical Information For Real World Database Design.
 2004 Prentice Hall, Inc. All rights reserved. 1 Segment – 6 Web Server & database.
Discovering Computers Fundamentals Fifth Edition Chapter 9 Database Management.
Copyright © 2005 Ed Lance Fundamentals of Relational Database Design By Ed Lance.
7 1 Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
CSCI 6962: Server-side Design and Programming Database Manipulation in ASP.
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
Module 3 Designing and Implementing Tables. Module Overview Designing Tables Working with Schemas Creating and Altering Tables.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 16 Using Relational Databases.
Database Management Supplement 1. 2 I. The Hierarchy of Data Database File (Entity, Table) Record (info for a specific entity, Row) Field (Attribute,
Database Design And Implementation. Done so far… Started a design of your own data model In Software Engineering, recognised the processes that occur.
Chapter 2 Relational Database Design and Normalization August
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Learningcomputer.com SQL Server 2008 –Views, Functions and Stored Procedures.
NORMALIZATION: ‘1NF’ The general rule: ‘’Any field which can have many, must have its own table’’ By Sam Beaumont.
1 CS 430 Database Theory Winter 2005 Lecture 7: Designing a Database Logical Level.
Dr. T. Y. Lin | SJSU | CS 157A | Fall 2015 Chapter 3 Database Normalization 1.
Databases Introduction - concepts. Concepts of Relational Databases.
NORMALIZATION Handout - 4 DBMS. What is Normalization? The process of grouping data elements into tables in a way that simplifies retrieval, reduces data.
Retele de senzori Curs 2 - 1st edition UNIVERSITATEA „ TRANSILVANIA ” DIN BRAŞOV FACULTATEA DE INGINERIE ELECTRICĂ ŞI ŞTIINŢA CALCULATOARELOR.
CS 440 Database Management Systems Stored procedures & OR mapping 1.
SQL Triggers, Functions & Stored Procedures Programming Operations.
SQL Basics Review Reviewing what we’ve learned so far…….
7.5 Using Stored-Procedure and Triggers NAME MATRIC NUM GROUP Muhammad Azwan Bin Khairul Anwar CS2305A Muhammad Faiz Bin Badrol Shah CS2305B.
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.
Introduction to Database Programming with Python Gary Stewart
Agenda for Today  DATABASE Definition What is DBMS? Types Of Database Most Popular Primary Database  SQL Definition What is SQL Server? Versions Of SQL.
A brief summary of database normalization
Web Programming Week 3 Old Dominion University
Chapter 4 Relational Databases
Payroll Management System
Database Normalization
Normalization Referential Integrity
Teaching slides Chapter 8.
Web Programming Week 3 Old Dominion University
Chapter 7 Using SQL in Applications
Chapter 11 Managing Databases with SQL Server 2000
Web Programming Week 3 Old Dominion University
Presentation transcript:

Databases in Web Devolvement By Andy Larson Using Microsoft Sever 2000 with ASP Database Integrity Inserting data Stored procedures Views Triggers Tips and ticks

Integrity Steadfast adherence to a strict moral or ethical code. The state of being unimpaired; soundness. The quality or condition of being whole or undivided; completeness. Source: The American Heritage. Dictionary of the English Language, Fourth Edition Copyright 2000 by Houghton Mifflin Company.

Database Integrity or Referential Integrity Is a feature provided by Relational Database Management Systems (RDBMS) that prevents users or applications from entering inconsistent data. Most RDBMS's have various referential integrity rules that you can apply when you create a relationship between two tables.

Types 1st Normal Form (1NF) –All the key attributes are defined –There is no repeating data. –All attributes are dependent on the primary key 2NF –It is in 1NF –It does not include partial dependencies 3NF –It is in 2NF –It does not contain transitive dependencies

There is also Boyce Codd NF, 4NF, 5NF. These normal forms help eliminate data anomalies. –Update - Having to update the same data in more than one place. –Insert - Cannot insert due to no primary key. –Delete - When information is deleted it may delete more than it should.

Inserting Data To put data into a database you have to insert it. This is done by using the insert, or update commands.

Inserting insert into pet values('Spot','Cat','4',''); Pet table PetID, PetName, PetType, OwenerId, Updated

Updating update Pet set petName = 'Katie' where OwnerId = 1;

Stored Procedures Is a query that is stored on the server. It can be called from an ASP page. Values can be passed into it and you can get values from it. One query can be used for many purposes depending on what values are passed into the procedure.

Advantages Stored procedures are modular. Stored procedures abstract or separate server-side functions from the client-side. Stored procedures are usually written by database developers or administrators.

Creating a Stored Procedure CREATE PROCEDURE varchar(50) AS SELECT Pet.PetName, PetOwner.First_Name, PetOwner.Last_Name FROM PetOwner, Pet WHERE PetOwner.First_Name AND PetOwner.Last_Name AND Pet.OwnerId = PetOwner.OwnerId

Views A view is a logical (virtual) table that exists only in memory, yet can be viewed as a real table. A view can be attributes from many tables that are placed into a new logical table. It is very helpful if you have to access the same data from different tables.

Creating a View CREATE VIEW Owner_Pet_Names AS SELECT PetOwner.OwnerId, PetOwner.First_Name, PetOwner.Last_Name, Pet.PetName FROM Pet, PetOwner Where Pet.OwnerId = PetOwner.OwnerId

Triggers The advantage of a trigger is that it invokes automatically whenever the command, for which it is defined, is issued. A trigger is a kind of stored procedure that executes automatically when you modify a table by using insert, update, or delete.

Types of triggers After triggers –Insert –Update –Delete Instead of trigger –Insert –Delete –Update

Creating a Trigger create trigger PetTrigger on Pet after update as update Pet set Updated = getdate() where OwnerId = 1;

Tips and Tricks Make sure you set up database integrity. Keep attribute names consistent. Create your connection string in a separate ASP file and then import it. Make sure you try your SQL statements before you put them into your asp code.

The End Any Questions?