MIS2502: Data Analytics MySQL and SQL Workbench. Jing Gong

Similar documents
Quick Guide to Installing and Setting Up MySQL Workbench

In-Class Exercise: SQL #2 Putting Information into a Database

LABSHEET 1: creating a table, primary keys and data types

Introduction to Qualtrics Research Suite Wednesday, September 19, 2012

TUTORIAL FOR IMPORTING OTTAWA FIRE HYDRANT PARKING VIOLATION DATA INTO MYSQL

Text Input and Conditionals

MySQL On Crux Part II The GUI Client

Word: Avoid Typing Mistakes with AutoCorrect

TUTORIAL FOR IMPORTING OTTAWA FIRE HYDRANT PARKING VIOLATION DATA INTO MYSQL

Oracle SQL. murach s. and PL/SQL TRAINING & REFERENCE. (Chapter 2)

2 Adding Contacts, Sending Attachment s and Sending s to More Than 1 Person.

MIS2502: Data Analytics Dimensional Data Modeling. Jing Gong

Lesson 1A - First Java Program HELLO WORLD With DEBUGGING examples. By John B. Owen All rights reserved 2011, revised 2015

3344 Database Lab. 1. Overview. 2. Lab Requirements. In this lab, you will:

Google Sheets: Spreadsheet basics

Generating Wrappers with Fetch Agent Platform 3.2. Matthew Michelson and Craig A. Knoblock CSCI 548: Lecture 2

QUERY USER MANUAL Chapter 7

Filter and PivotTables in Excel

MIS2502: Data Analytics SQL Getting Information Out of a Database Part 1: Basic Queries

A Document Created By Lisa Diner Table of Contents Western Quebec School Board October, 2007

STOP DROWNING IN DATA. START MAKING SENSE! An Introduction To SQLite Databases. (Data for this tutorial at

RESETTING MYSQL ROOT PASSWORDS

Basics of Stata, Statistics 220 Last modified December 10, 1999.

Word: Print Address Labels Using Mail Merge

File Upload Instructions Customer Access To Transcript Bulletin Publishing s FTP Site

Creating a Brochure in Publisher

emerchant API guide MSSQL quick start guide

MIS2502: Data Analytics SQL Getting Information Out of a Database. Jing Gong

HOW TO OPERATE GMAIL

Creating the Data Layer

Outlook Web Access Getting Started

Book IX. Developing Applications Rapidly

This lab will introduce you to MySQL. Begin by logging into the class web server via SSH Secure Shell Client

How To Upload Your Newsletter

Creating a multilingual site in WebPlus

Hello World! Computer Programming for Kids and Other Beginners. Chapter 1. by Warren Sande and Carter Sande. Copyright 2009 Manning Publications

Zello Quick Start Guide for Kyocera TORQUE

CSCI 201 Lab #11 Prof. Jeffrey Miller 1/23. Lab #11 CSCI 201. Title MySQL Installation. Lecture Topics Emphasized Databases

Getting Started. Excerpted from Hello World! Computer Programming for Kids and Other Beginners

Section 1. How to use Brackets to develop JavaScript applications

MIS2502: Data Analytics The Information Architecture of an Organization. Jing Gong

LearnOSM. PostgreSQL & PostGIS. Installing PostgreSQL and PostGIS. Reviewed

Chapter 2 The SAS Environment

c r e at i N g yo u r F i r S t d ata b a S e a N d ta b l e

How to use the Social care: a rewarding career for you tool

Introduction... 3 Introduction... 4

MIS 0855 Data Science (Section 006) Fall 2017 In-Class Exercise (Day 18) Finding Bad Data in Excel

Using Outlook Web Access (OWA) for Employees

DIRECTV Message Board

Creating An Account, Using Your Inbox, Sending s and Learn My Way.

Locate your Advanced Tools and Applications

(electronic mail) is the exchange of computer-stored messages by telecommunication.

Boise State University. Getting To Know FrontPage 2000: A Tutorial

Here we will look at some methods for checking data simply using JOSM. Some of the questions we are asking about our data are:

Learn Microsoft Word Like Magic!

Using the Computer for Essays

Civil Engineering Computation

Keep Track of Your Passwords Easily

Drupal 7 guide CONTENTS. p. 2 Logging In

Using Microsoft Excel

E-Postal Services 1. The E-Postal Service is used to targeted groups at NMU. It is NOT used to all students or employee groups.

MIS2502: Data Analytics Dimensional Data Modeling. Jing Gong

At least one Charley File workbook for New Excel. This has an xlsx extension and is for PC Excel 2007, Mac Excel 2008, and after.

Installing VS Code. Instructions for the Window OS.

MIS2502: Data Analytics Relational Data Modeling. Jing Gong

Shopping Cart: Queries, Personalizations, Filters, and Settings

MySQL: an application

A Guide to Blogging on Wordpress

Improved Web Development using HTML-Kit

Moodle Tutorial. Tak Auyeung. April 5, 2006

Database Foundations. 6-1 Introduction to Oracle Application Express. Copyright 2015, Oracle and/or its affiliates. All rights reserved.

The name of our class will be Yo. Type that in where it says Class Name. Don t hit the OK button yet.

Accounts and Passwords

Tips and Tricks Working with Scribe Trace Files

Installing the WHI Virtual Private Network (VPN) for WHIX Users Updated 12/16/2016

Online Ordering Guide

Website Development Komodo Editor and HTML Intro

3. Getting data out: database queries. Querying

Follow these instructions if you are working on a school/college computer that is part of the network.

CTC Accounts Active Directory Synchronizer User Guide

Submitting Assignments

version staff had them to share viewing this this user guide. >Reports, as Logging In the SQL login User Name for your district. perform the guides.

GOOGLE DRIVE & DOCS. USERNAME: [for example,

KINETICS CALCS AND GRAPHS INSTRUCTIONS

CSCI 161: Introduction to Programming I Lab 1b: Hello, World (Eclipse, Java)

Variables and. What Really Happens When You Run hello_world.py

SynApp2 Walk through No. 1

A Quick-Reference Guide. To access reddot:

When people change their names, how can Daminion help to keep you up to date?

How to Edit a Document Using Google Drive

Database Foundations. 5-1 Mapping Entities and Attributes. Copyright 2015, Oracle and/or its affiliates. All rights reserved.

Go to SQA Academy the website address is

ASCII Art. Introduction: Python

Creating an with Constant Contact. A step-by-step guide

Microsoft PowerPoint Presentations

Lesson 4: Who Goes There?

Locate your Advanced Tools and Applications

Reading: Managing Files in Windows XP

GEO 425: SPRING 2012 LAB 9: Introduction to Postgresql and SQL

Altodigital Service Portal Guide

Transcription:

MIS2502: Data Analytics MySQL and SQL Workbench Jing Gong gong@temple.edu http://community.mis.temple.edu/gong

MySQL MySQL is a database management system (DBMS) Implemented as a server What is a server? Software specifically built to provide services to other applications MySQL Database Examples File server Print server Web server Database server

Example: The web server The web server serves web pages to the web browser The web browser allows the user to interact with the server The web browser is the client Web server Request http://fox.temple.edu Response a web page

Interacting with MySQL The client can either be a business application or a utility We re going to use the MySQL Workbench utility MySQL Database Request SQL query Response Query results (data)

MySQL Workbench Enables the user to interact directly with the database Create and make changes to tables Extract information from tables Provide help creating SQL statements Create ERDs We ll use SQL workbench to Create and execute SQL commands View query results But we won t use it for modeling We want to do some things ourselves!

Limits of MySQL Workbench It isn t meant for business users For that, we d construct an application Why do we create applications for users, instead of allowing direct database interaction? Placing an order at Amazon You don t interact with Amazon s database directly You do it through Amazon.com Registering for a course You don t interact with Temple s database directly You do it through Owlnet

Connecting to a MySQL server This is the opening screen You click on a connection to connect to a server You ll have access to your schemas on that server We ll give you instructions explaining how to set up your connection to the class server, based on your username and password.

The MySQL Workbench interface SQL Query panel Overview tabsheet (the database schemas) How many tables are in the m0orderdb schema?

Composing a SQL statement Let s just type this into the query panel Don t worry about the syntax itself yet. We ll get to that soon Notice how the words SELECT and FROM are highlighted in blue. Those are the keywords (part of the SQL language) The black indicates it isn t part of SQL So they are part of the database itself, like schemas, tables, and fields

To execute the query Click on the lightening bolt icon or select Execute Current Statement from the Query menu and you ll wind up with this result These are the results of the query, displayed in table form

This query Another example gives us this The green highlighting indicates this is a string literal, or a set of letters a numbers. In other words, what s between the quotes isn t a SQL command OR an element in the database

The editor will catch mistakes This is a query with no answer because last_nam isn t a field in the table Instead of query results, we now get this indicating the source of the error

If the syntax is wrong We ve spelled FROM wrong FRM isn t green because it is not recognized as a SQL keyword! And now we get this error MySQL Workbench can t tell quite what s wrong, but it knows it isn t a correctly formatted SQL command It thinks moviedb is the source of the problem, but really it s a misspelled keyword

Automatically generated SQL MySQL Workbench can generate the more complex queries for you Right-click on the customer table in mxorderdb and Select Rows and you ll see an editable table that you can work with. Instead of m0orderdb, you ll have your own number (i.e., m33orderdb). That s ok.

Example: Adding a row Now we ll add another row to the table, just like we re filling in a spreadsheet Click on the Apply button in the bottom right corner of the window

The generated SQL statement This is the SQL statement that will add the row to the database You can make changes to the SQL, or just click Apply That will send the SQL statement to the MySQL database server for processing

Adding a table In the Object Browser, rightclick on Tables under mxorderdb Then select Create Table from the menu Give the table a name, then enter column names and data types Then click the Apply button We ll learn what the data types mean a little later

And the result is this We ll learn the syntax for all of these statements. But every query can be entered directly through the query panel. You ll need to know how to create the SQL yourself, even if you use MySQL Workbench for help.

It will also generate statements for Deleting a row from the table (SQL DELETE) Right-click on a field in the row and select Delete Row(s) Changing a row in a table (SQL UPDATE) Delete an entire table (SQL DROP) Right-click on the table name and select Drop Table By the way DON T DO THIS!!

The bottom line SQL Workbench makes it easy to interact with a MySQL database It can help you compose queries through highlighting, syntax checking, and the automated query functions In reality, a database administrator would use a combination of automated query generation and manual entry The more complex the query, the more likely it will have to be entered manually