Announcements. PS 3 is out (see the usual place on the course web) Be sure to read my notes carefully Also read. Take a break around 10:15am

Similar documents
Introduction to Data Management. Lecture #1 (The Course Trailer )

Big Data Processing Technologies. Chentao Wu Associate Professor Dept. of Computer Science and Engineering

CS275 Intro to Databases. File Systems vs. DBMS. Why is a DBMS so important? 4/6/2012. How does a DBMS work? -Chap. 1-2

Introduction to Database Systems

Introduction and Overview

Database Management Systems MIT Introduction By S. Sabraz Nawaz

Introduction and Overview

Introduction to Data Management. Lecture #1 (Course Trailer )

Lecture 2 08/26/15. CMPSC431W: Database Management Systems. Instructor: Yu- San Lin

CMPSCI 645 Database Design & Implementation

Introduction to Data Management. Lecture #1 (Course Trailer )

Introduction to Data Management. Lecture #1 (Course Trailer ) Instructor: Chen Li

Data! CS 133: Databases. Goals for Today. So, what is a database? What is a database anyway? From the textbook:

Database Systems ( 資料庫系統 ) Practicum in Database Systems ( 資料庫系統實驗 ) 9/20 & 9/21, 2006 Lecture #1

CS145: Intro to Databases. Lecture 1: Course Overview

CSE 303: Database. Teaching Staff. Lecture 01. Lectures: 1 st half - from a user s perspective. Lectures: 2 nd half - understanding how it works

CS564: Database Management Systems. Lecture 1: Course Overview. Acks: Chris Ré 1

Introduction to Data Management. Lecture #4 (E-R Relational Translation)

Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications. Today's Party. Example Database. Faloutsos/Pavlo CMU /615

CAS CS 460/660 Introduction to Database Systems. Fall

The Relational Model. Database Management Systems

Outline. Databases and DBMS s. Recent Database Applications. Earlier Database Applications. CMPSCI445: Information Systems.

CSC 337. Relational Databases and SQL. Rick Mercer

CS 2451 Database Systems: Relational Data Model

CSC 261/461 Database Systems Lecture 13. Fall 2017

Score. 1 (10) 2 (10) 3 (8) 4 (13) 5 (9) Total (50)

Outline. Quick Introduction to Database Systems. Data Manipulation Tasks. What do they all have in common? CSE142 Wi03 G-1

1/19/2012. Finish Chapter 1. Workers behind the Scene. CS 440: Database Management Systems

Course Web Site. 445 Staff and Mailing Lists. Textbook. Databases and DBMS s. Outline. CMPSCI445: Information Systems. Yanlei Diao and Haopeng Zhang

CS 146 Database Systems

Let's Play... Try to name the databases described on the following slides...

MySQL Introduction. By Prof. B.A.Khivsara

CMPSCI445: Information Systems

BBM371- Data Management. Lecture 1: Course policies, Introduction to DBMS

Lecture 1: Introduction

Database Management Systems. Chapter 1

DATABASES SQL INFOTEK SOLUTIONS TEAM

The Relational Model. Week 2

CS145: Intro to Databases. Lecture 1: Course Overview

Basics of Web. First published on 3 July 2012 This is the 7 h Revised edition

1. Data Model, Categories, Schemas and Instances. Outline

ITP 140 Mobile Technologies. Databases Client/Server

Introduction. Example Databases

UNIT 1 INTRODUCTION TO DBMS 1

Page 1. Quiz 18.1: Flow-Control" Goals for Today" Quiz 18.1: Flow-Control" CS162 Operating Systems and Systems Programming Lecture 18 Transactions"

Page 1. Goals for Today" What is a Database " Key Concept: Structured Data" CS162 Operating Systems and Systems Programming Lecture 13.

MIT Database Management Systems Lesson 01: Introduction

1 (10) 2 (8) 3 (12) 4 (14) 5 (6) Total (50)

Standard stuff. Class webpage: cs.rhodes.edu/db Textbook: get it somewhere; used is fine. Prerequisite: CS 241 Coursework:

Introduction to MySQL. Database Systems

CS 4604: Introduction to Database Management Systems. B. Aditya Prakash Lecture #2: The Relational Model and Relational Algebra

Relational Model and Relational Algebra

Instructor s Notes Web Data Management Web Client/Server Concepts. Web Data Management Web Client/Server Concepts

Project Title REPRESENTATION OF ELECTRICAL NETWORK USING GOOGLE MAP API. Submitted by: Submitted to: SEMANTA RAJ NEUPANE, Research Assistant,

Introduction to Database Management Systems

Introduction to Database Systems. Chapter 1. Instructor: . Database Management Systems, R. Ramakrishnan and J. Gehrke 1

Full version is >>> HERE <<<

Basic operators: selection, projection, cross product, union, difference,

Database Management Systems MIT Lesson 01 - Introduction By S. Sabraz Nawaz

DS Introduction to SQL Part 2 Multi-table Queries. By Michael Hahsler based on slides for CS145 Introduction to Databases (Stanford)

Introduction to MySQL. Database Systems

Database Applications (15-415)

Database Concepts. CS 377: Database Systems

The Relational Model. Chapter 3

Mysql Using Php Script

Introduction to Data Management. Lecture #4 (E-R à Relational Design)

Prepared By: PATEL DHARMESH M.( ) (C.E.)

Introduction to Data Management. Lecture #2 Intro II & Data Models I

Goals for Today. CS 133: Databases. Relational Model. Multi-Relation Queries. Reason about the conceptual evaluation of an SQL query

Introduction. Who wants to study databases?

Introduction to Data Management. Lecture #5 Relational Model (Cont.) & E-Rà Relational Mapping

Excel4apps Wands 5 Architecture Excel4apps Inc.

Database Management Systems. Chapter 3 Part 1

The Relational Model. Chapter 3. Comp 521 Files and Databases Fall

CS 327E Class 3. February 11, 2019

Database Design and Implementation

Chapter 13 XML: Extensible Markup Language

CMPT 354: Database System I. Lecture 1. Course Introduction

G64DBS Database Systems. G64DBS Module. Recommended Textbook. Assessment. Recommended Textbook. Recommended Textbook.

745: Advanced Database Systems

DATABASE SYSTEMS. Introduction to MySQL. Database System Course, 2016

Development Technologies. Agenda: phpmyadmin 2/20/2016. phpmyadmin MySQLi. Before you can put your data into a table, that table should exist.

DATABASE SYSTEMS. Introduction to MySQL. Database System Course, 2016

Mysql Server 4.1 Manually Windows 7 Start Service

EECS 647: Introduction to Database Systems

Data Modeling. Yanlei Diao UMass Amherst. Slides Courtesy of R. Ramakrishnan and J. Gehrke

CS637 Midterm Review

PHP: Cookies, Sessions, Databases. CS174. Chris Pollett. Sep 24, 2008.

Review. Fundamentals of Website Development. Web Extensions Server side & Where is your JOB? The Department of Computer Science 11/30/2015

The Relational Data Model. Data Model

The Relational Model. Chapter 3. Comp 521 Files and Databases Fall

The Relational Model. Why Study the Relational Model? Relational Database: Definitions

COS 333: Advanced Programming Techniques

Database in Everyday Life by Assoc. Prof. Dr. Churee Techawut adapted into English by Dr. Prakarn Unachak

The Relational Model. Relational Data Model Relational Query Language (DDL + DML) Integrity Constraints (IC)

Php And Mysql Manual Simple Yet Powerful Web Programming

Relational data model

The Relational Model Constraints and SQL DDL

Week 11 ~ Chapter 8 MySQL Command Line. PHP and MySQL CIS 86 Mission College

Lecture 16. The Relational Model

Transcription:

Announcements PS 3 is out (see the usual place on the course web) Be sure to read my notes carefully Also read SQL tutorial: http://www.w3schools.com/sql/default.asp Take a break around 10:15am 1

Databases 2

Multi-tiered Web app architecture Front-end / Middle Tier Data / Resource Client Tier Web Tier Application Tier Tier HTTP... Web Browser (Chrome) HTTP Server (Apache) Web Application (PHP, Java) Database Server (MySQL, Oracle) 3

Example: Databases today 4

What is a database? A database: A very large, integrated collection of persistent data (records) A database contains one or more tables Each table contains records (or rows) Each row contains fields (or columns) that contain data itself Typically models a real-world enterprise Entities (e.g., students, courses) Relationships (e.g., Amy is taking CS 135) A web app dealing with dynamic content needs a database on the backend! Example: Google employee database 5

What is a DBMS? A Database Management System (DBMS) is a software system designed to store, manage, and facilitate access to databases Reliable storage and recovery of 100s of GB Querying/Updating interface and API for applications and Web pages Support for many concurrent users Typically this term DBMS is used narrowly: Relational DBMS with transactions Examples Oracle, DB2, SQL Server, MySQL, SQLite, etc. 6

Describing data: data models A data model is a collection of concepts for describing data Mathematical representation of data Examples: relational model = tables semi-structured model = trees/graphs A schema is a description of a particular collection of data, using a given model Relational model is the most widely used today Main concept: relation, a table with rows and columns Every relation has a schema, which describes the columns (fields). This is really the meta data part of a database. 7

Example: college database Schema: Students(sid text, name text, gpa real) Courses(cid text, cname text, credits integer) Enrolled(sid text, cid text, grade text) 8

Conceptual design: ER diagram fid PROFESSOR name Teaches STUDENT Takes COURSE sid name cid name semester 9

Designing a schema (set of relations) Convert the ER diagram to tables STUDENT Takes COURSE sid name sid cid cid name sem 1 Amy 1 10-03 10-03 DB S15 2 Bob 1 12-10 12-10 PL F14 3 Mary 3 13-03 13-03 OS F13 PROFESSOR fid name 1 Jim 2 Art 8 Mike Teaches fid cid 1 10-03 2 12-10 8 13-03 10

Applications use queries in SQL Structured Query Language (SQL) <html> <body> <!-- someembeddedsql: SELECT name, major, gpa FROM STUDENT, Takes, COURSE WHERE STUDENT.sid = Takes.sid AND Takes.cid = COURSE.cid --> </body> </html> 11

MySQL 12

MySQL Probably the most popular DBMS for web servers (well over 10 million installations) Powerful Fast Not a resource hog Scalable For the latest benchmarks, see http://mysql.com/why-mysql/benchmarks Free 13

Accessing MySQL via the command line Three main ways you can interact with MySQL 1. Using a command line 2. Via a web interface such as phpmyadmin 3. Through a programming language like PHP, Java, etc. We will see first two today 14

Command line interface (Windows) Assuming that you have installed XAMPP... You will be able to access the MySQL executable from the directory: C:\xampp\mysql\bin By default, the initial MySQL user is root and will not have a password set. Using it as a development server that only you should be able to access, we won t worry about creating one. From a command window prompt (Start -> Run; CMD) enter: C:\xampp\mysql\bin\mysql u root You have just logged into MySQL as user root, without a password Now, you are ready to type in MySQL commands, e.g., SHOW databases; 15

Command line interface (OSX) Assuming that XAMPP is installed; the web server is running; and the MySQL server has started... You will be able to access the MySQL executable from the MySQL installation directory: /Applications/XAMPP/bin By default, the initial MySQL user is root and it will have a password of root too. So, to start a MySQL client, try the following on a Terminal /Applications/XAMPP/bin/mysql u root You have just logged into MySQL as user root, and not to request your password (Consider using an alias if you don t want to type in this long command every time) Now, you are ready to type in MySQL commands, e.g., SHOW databases; 16

Running a MySQL script file Once a MySQL client has started, from the command prompt try the following command with a script file named mydb.sql mysql> source mydb.sql See mydb.sql 17

Common MySQL commands 18

Accessing MySQL via phpmyadmin Although to use MySQL you have to learn these main commands and how they work, once you understand them, it can be much quicker and simpler to use a program such as phpmyadmin to manage your database and tables To do this Go to http://localhost/xampp Click the phpmyadmin link toward the bottom of the lefthand menu to open up the program In the lefthand pane of the main phpmyadmin screen, you can select a database you wish to work with From here you can perform all the main operations such as creating a new database, adding tables, creating indexes, etc. Visit https://docs.phpmyadmin.net to see the supporting documentation for phpmyadmin 19

Next... More database stuff SQL in PHP 20