CSE 190: Internet E-Commerce Lecture 10: Data Tier.

Slides:



Advertisements
Similar presentations
C6 Databases.
Advertisements

Database Theory Each Table in a Database needs a Primary Key Data TypesDescriptionExample TextCharacters (Letters, numbers and symbols) ABC 123 NumberNumerical.
Relational Databases Chapter 4.
SQL Components DML DDL DAL. Overview u Getting the records onto the disk - mapping u Managing disk space u SQL Modes u Ceating database.
The Relational Model Lecture 3 Book Chapter 3 Relational Data Model Relational Query Language (DDL + DML) Integrity Constraints (IC) From ER to Relational.
A Guide to SQL, Seventh Edition. Objectives Understand the concepts and terminology associated with relational databases Create and run SQL commands in.
Murali Mani SQL DDL and Oracle utilities. Murali Mani Datatypes in SQL INT (or) INTEGER FLOAT (or) REAL DECIMAL (n, m) CHAR (n) VARCHAR (n) DATE, TIME.
30-Jun-15 SQL A Brief Introduction. SQL SQL is Structured Query Language Some people pronounce SQL as “sequel” Other people insist that only “ess-cue-ell”
CS320 Web and Internet Programming SQL and MySQL Chengyu Sun California State University, Los Angeles.
DAT702.  Standard Query Language  Ability to access and manipulate databases ◦ Retrieve data ◦ Insert, delete, update records ◦ Create and set permissions.
Databases Dan Otero Alex Loddengaard
Introduction To Databases IDIA 618 Fall 2014 Bridget M. Blodgett.
DAY 21: MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Akhila Kondai October 30, 2013.
Chapter 4: Organizing and Manipulating the Data in Databases
Database Lecture # 1 By Ubaid Ullah.
IE 423 – Design of Decision Support Systems Database development – Relationships and Queries Introduction to SQL.
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.
The Relational Model. Review Why use a DBMS? OS provides RAM and disk.
1 Overview of Databases. 2 Content Databases Example: Access Structure Query language (SQL)
Introduction to SQL Steve Perry
Rensselaer Polytechnic Institute CSCI-4380 – Database Systems David Goldschmidt, Ph.D.
Relational Database Management Systems. A set of programs to manage one or more databases Provides means for: Accessing the data Inserting, updating and.
FEN  Concepts and terminology  Operations (relational algebra)  Integrity constraints The relational model.
Oracle Data Definition Language (DDL) Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
CPS120: Introduction to Computer Science Lecture 19 Introduction to SQL.
10/17/2012ISC471/HCI571 Isabelle Bichindaritz 1 Technologies Databases.
Relational Databases Database Driven Applications Retrieving Data Changing Data Analysing Data What is a DBMS An application that holds the data manages.
9/7/2012ISC329 Isabelle Bichindaritz1 The Relational Database Model.
Chapter 10: The Data Tier We discuss back-end data storage for Web applications, relational data, and using the MySQL database server for back-end storage.
C6 Databases. 2 Traditional file environment Data Redundancy and Inconsistency: –Data redundancy: The presence of duplicate data in multiple data files.
Relational Database. Database Management System (DBMS)
Databases MIS 21. Some database terminology  Database: integrated collection of data  Database Management System (DBMS): environment that provides mechanisms.
FEN Introduction to the database field:  The Relational Model Seminar: Introduction to relational databases.
SQL: DDL. SQL Statements DDL - data definition language –Defining and modifying data structures (metadata): database, tables, views, etc. DML - data manipulation.
1 Database & DBMS The data that goes into transaction processing systems (TPS), also goes to a database to be stored and processed later by decision support.
SQL 101 – Class 1 Lee Turner. Agenda 1. This is your life – SQL A brief history of SQL What SQL is and what it is not Normalization 2. Some Super Simple.
Prepared by The Smartpath Information Systems
Database revision.
What’s a database? Data stored in a structured format that lends itself to easy manipulation and recall.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
Visual Programing SQL Overview Section 1.
SQL Jan 20,2014. DBMS Stores data as records, tables etc. Accepts data and stores that data for later use Uses query languages for searching, sorting,
A CCESSING D ATABASES WITH JDBC CH 24 C S 442: A DVANCED J AVA P ROGRAMMING.
There are two types of MySQL instructions (Data Definition Language) DDL: Create database, create table, alter table,,,. (Data Manipulation Language) DML.
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.
Jennifer Widom Relational Databases The Relational Model.
Chapter 3: Relational Databases
Quiz Which of the following is not a mandatory characteristic of a relation? Rows are not ordered (Not required) Each row is a unique There is a.
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
CS320 Web and Internet Programming SQL and MySQL Chengyu Sun California State University, Los Angeles.
 MySQL  DDL ◦ Create ◦ Alter  DML ◦ Insert ◦ Select ◦ Update ◦ Delete  DDL(again) ◦ Drop ◦ Truncate.
Introduction to Databases & SQL Ahmet Sacan. What you’ll need Firefox, SQLite plugin Mirdb and Targetscan databases.
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.
Big Data Yuan Xue CS 292 Special topics on.
Fundamentals of DBMS Notes-1.
CS320 Web and Internet Programming SQL and MySQL
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.
Database Management  .
Databases and Data Warehouses Chapter 3
Structured Query Language (SQL) William Klingelsmith
Relational Databases The Relational Model.
Relational Databases The Relational Model.
Teaching slides Chapter 8.
Structured Query Language
CMPT 354: Database System I
CS3220 Web and Internet Programming SQL and MySQL
CS3220 Web and Internet Programming SQL and MySQL
Presentation transcript:

CSE 190: Internet E-Commerce Lecture 10: Data Tier

Data Tier Rationale –All data will be stored in central location, the database, with no duplication of state. Careful attention will be paid to keeping data access atomic, consistent, isolated, and durable. (ACID) –Database will provide high level access to querying, filtering, and summarizing the data –Common commercial products: Oracle, IBM’s DB2, Microsoft SQL Server –Free products: mysql, PostgresSQL

Choosing data tier representation When might a data base be contra- indicated? –Very simple patterns of data access –Loss of data not catastrophic –Low latency an absolute requirement –Examples: Amazon, Yahoo, Hotmail, Google For most sites, a database backed web site is a good idea

Relational databases All data is described as relations between one set of facts (a table) and another set of facts Each relation is called a table. Each row (sometimes called a tuple) has a set of fields, such as name, date of birth Each field (column) has a value of some intrinsic DB type (string, integer, date)

Primary keys, foreign keys Primary key: A field of a table designated to provide a unique identifier for a specific row of the table Foreign key: A field of a table whose value matches the primary key of another table. From foreign keys, we see relationships between one table and another. Design: primary keys should not encode meaning in their representation

Joins A join is the cross product of all the rows of a set of tables. By selecting a subset of the rows of the join that match some criteria, we can answer simple questions about our data. This is the core of the relational model. Two tables Inner Join of two tables Left outer join

Schemas By creating several tables, with the appropriate Primary keys, foreign keys, we can model the data needs of our application Database especially suited for representing the relationship between our entities (objects) when the number of rows in our schemas very large compared to the number of schemas

SQL A standard mechanism for querying and manipulating relational databases Queries, Changes (DML: Data Manipulation Language) –SELECT id, firstname, lastname, networth from customers where networth > –INSERT into customers values( 17, “Alice”, “Crypto”, 400 ) –UPDATE customers SET networth = networth Note: Results from a SQL query (SELECT) are a table in their own right, a view of the data. This table may also be used to perform joins against other tables.

SQL Schema Manipulation (DDL: Data Definition Language) Example table creation: CREATE TABLE Customers ( CustNo NUMBER(3) NOT NULL, CustName VARCHAR2(30) NOT NULL, Street VARCHAR2(20) NOT NULL, City VARCHAR2(20) NOT NULL, State CHAR(2) NOT NULL, Zip VARCHAR2(10) NOT NULL, Phone VARCHAR2(12), PRIMARY KEY ( CustNo ) );