CCT396, Fall 2011 Database Design and Implementation Yuri Takhteyev University of Toronto This presentation is licensed under Creative Commons Attribution.

Slides:



Advertisements
Similar presentations
Let’s try Oracle. Accessing Oracle The Oracle system, like the SQL Server system, is client / server. For SQL Server, –the client is the Query Analyser.
Advertisements

Using Relational Databases and SQL Steven Emory Department of Computer Science California State University, Los Angeles Lecture 1: Introduction to Relational.
Attribute databases. GIS Definition Diagram Output Query Results.
DAT702.  Standard Query Language  Ability to access and manipulate databases ◦ Retrieve data ◦ Insert, delete, update records ◦ Create and set permissions.
Computing for Bioinformatics Introduction to databases What is a database? Database system components Data types DBMS architectures DBMS systems available.
1 Working with MS SQL Server. 2 Objectives You will be able to Use Visual Studio for GUI based interactive access to a Microsoft SQL Server database.
Simple Database.
Introduction to databases and SQL. What is a database?  A database is an organized way of holding together pieces of information  A database refers.
CS 3630 Database Design and Implementation. Your Oracle Account UserName is the same as your UWP username Followed Not case sensitive Initial.
1 Working with MS SQL Server Textbook Chapter 14.
MET280: Computing for Bioinformatics Introduction to databases What is a database? Not a spreadsheet. Data types and uses DBMS (DataBase Management System)
NMED 3850 A Advanced Online Design January 12, 2010 V. Mahadevan.
Chapter 5 Database Processing. Neil uses software to query a database, but it has about 25 standard queries that don’t give him all he needs. He imports.
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.
Most information comes from Chapter 3, MySQL Tutorial: 1 MySQL: Part.
Creating and Maintaining Geographic Databases. Outline Definitions Characteristics of DBMS Types of database Relational model SQL Spatial databases.
Database Basics BCIS 3680 Enterprise Programming.
Starting with Oracle SQL Plus. Today in the lab… Connect to SQL Plus – your schema. Set up two tables. Find the tables in the catalog. Insert four rows.
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
CCT396, Fall 2011 Database Design and Implementation Yuri Takhteyev University of Toronto This presentation is licensed under Creative Commons Attribution.
CCT396, Fall 2011 Database Design and Implementation Yuri Takhteyev University of Toronto This presentation is licensed under Creative Commons Attribution.
INF1343, Winter 2012 Data Modeling and Database Design Yuri Takhteyev Faculty of Information University of Toronto This presentation is licensed under.
Welcome to INF1343! Database Modeling and Database Design This presentation is licensed under Creative Commons Attribution License, v To view a copy.
INF1343, Winter 2012 Data Modeling and Database Design Yuri Takhteyev Faculty of Information University of Toronto This presentation is licensed under.
CCT395, Week 12 Storage, Grid Computing, Review This presentation is licensed under Creative Commons Attribution License, v To view a copy of this.
INF1343, Winter 2011 Data Modeling and Database Design Yuri Takhteyev University of Toronto This presentation is licensed under Creative Commons Attribution.
CCT1343, Week 3 SQL Queries Using Multiple Tables This presentation is licensed under Creative Commons Attribution License, v To view a copy of this.
INF1343, Week 6 Implementing a Database with SQL This presentation is licensed under Creative Commons Attribution License, v To view a copy of this.
CCT395, Week 11 Review, Permissions Physical Storage and Performance This presentation is licensed under Creative Commons Attribution License, v. 3.0.
CCT395, Week 6 Implementing a Database with SQL and a Case Study Exercise This presentation is licensed under Creative Commons Attribution License, v.
Database Design and Implementation
CCT395, Week 2 Introduction to SQL Yuri Takhteyev September 15, 2010
INF1343, Winter 2012 Data Modeling and Database Design Yuri Takhteyev Faculty of Information University of Toronto This presentation is licensed under.
CCT396, Fall 2011 Database Design and Implementation Yuri Takhteyev University of Toronto This presentation is licensed under Creative Commons Attribution.
CCT396, Fall 2011 Database Design and Implementation Yuri Takhteyev University of Toronto This presentation is licensed under Creative Commons Attribution.
N5 Databases Notes Information Systems Design & Development: Structures and links.
INF1343, Winter 2011 Data Modeling and Database Design Yuri Takhteyev University of Toronto This presentation is licensed under Creative Commons Attribution.
2nd year Computer Science & Engineer
Holland Computing Center STAT802 Create and access Anvil Windows 10 SAS instance 01/23/2017.
INTRODUCTION TO DATABASES (MICROSOFT ACCESS)
CS 3630 Database Design and Implementation
Data Modeling and Database Design INF1343, Winter 2012 Yuri Takhteyev
Database System Concepts and Architecture
Special Topics in CCIT: Databases
CCT1343, Week 2 Single-Table SQL Yuri Takhteyev University of Toronto
Introduction to MySQL.
Principles of Software Development
mysql and mysql workbench
Database Design and Implementation
Data Modeling and Database Design
Data Modeling and Database Design INF1343, Winter 2012 Yuri Takhteyev
Database Design and Implementation
CS1222 Using Relational Databases and SQL
Data Modeling and Database Design INF1343, Winter 2012 Yuri Takhteyev
Database Management  .
CS 174: Server-Side Web Programming February 12 Class Meeting
MANAGING DATA RESOURCES
Chapter 8 Working with Databases and MySQL
Database.
CS1222 Using Relational Databases and SQL
PHP and MySQL.
MIS2502: Data Analytics MySQL and SQL Workbench
CS1222 Using Relational Databases and SQL
CS1222 Using Relational Databases and SQL
CS3220 Web and Internet Programming SQL and MySQL
Lecuter-1.
CS4540 Special Topics in Web Development SQL and MS SQL
CS1222 Using Relational Databases and SQL
Presentation transcript:

CCT396, Fall 2011 Database Design and Implementation Yuri Takhteyev University of Toronto This presentation is licensed under Creative Commons Attribution License, v To view a copy of this license, visit This presentation incorporates images from the Crystal Clear icon collection by Everaldo Coelho, available under LGPL from

What is a “Database”? “an organized collection of data” (digital, managed with software) “DBMS”

Bob information Alic e

Bob information Alic e

Bob an information system

Alic e Bob storing information + doing things with it

Alic e Bob application software database “persistent storage”

Alic e Bob database “persistent storage”

What is Data? Data Information Knowledge

What is Data? Values Database Bits Records

Database Elements “logical” representation “physical” representation

Basic Data Types Numbers 42, 2.7, 7.2×10 -19, Text “Strings” “Yoda”, “Chewbacca”, “A long time ago in a galaxy far, far away....”

More Complex Data Time “Sept. 7, 2011” ( ) Binary “Blobs” contents of an image file Geometric a line, a polygon

Databases Models

Key-Value Jedi Master, unknown species smuggler, human Yoda Han Solo

Hierarchical character s human wookiee unknown species Padmé Amidala Chewbacca Yoda Han Solo Obiwan Kenobi

Network human wookieeChewbacca Yoda Han Solo Obiwan Kenobi Jedi Master

Relational A notion of a “relation” not to be confused with a “relationship”

A Relation (“Yoda”, “Jedi Master”)

A Relation (“Yoda”, “Jedi Master”, “unknown species”)

A Relation (“Yoda”, “Jedi Master”, “unknown species”) (“San Solo”, “smuggler”, “Human”) (“Padmé Amidala”, “queen”, “Human”) (“Jabba”, “crime lord”, “Hutt”) (“Jar Jar Binks”, “senator”, “Gungan”)

Another Relation (“Human”, “humanoid”, 1.7) (“Gungan”, “humanoid”, 1.89) (“Hutt”, “gastropod”, 3.5) (“Ewok”, “furry biped”, 0.9)

And Another (“humanoid”, 2) (“gastropod”, 0)

Tabular Form persona species_type species

Tabular Form persona species_type species

Relational Data Modeling Finding a proper relational representation for data

RDBMS MySQL, PostgreSQL, Oracle, Sybase, IBM DB2, Informix, MS SQL Server, MS Access*

Accessing a Database

Built-in GUI

Networked Client databas e server databas e client

A 3-Tier System databas e server application server web client

A Query Language commands status, results

Structured Query Language (Some people say “Sequel”)

An SQL Statement select name, occupation from persona where species=”Wookiee”;

An SQL Statement select name, occupation from persona where species="Wookiee";

Sequel Pro (also available in this lab)

File > New Connection Window

An SQL Statement select name, occupation from persona where species="Wookiee"; - SQL keywords are not case-sensitive (de facto) - text strings usually are are - names or tables and fields usually are

An SQL Statement so: select = SELECT* = seLecT** from = FROM* = From** * some people prefer this ** ugly, don't do this but: persona != PERSONA != Persona "Wookiee" != "wookiee"

Quotes Text strings must always be quoted Names can be, sometimes must be Quote Types “, ”, and " " must be closed by ", ' by '

The Semi-Colon Don’t forget the semi-colon;

A Terminal App / Bash OSX: “Terminal” (pre-installed) Linux: “gnome-terminal” (pre-installed) Windows: “git-bash” from Git (you can use PuTTY if you prefer)

Local v Remote Local: Your laptop / desktop Remote: Another computer you are using (via your “local” machine) Hint: Check the name in the prompt, e.g.:

SSH ssh - your password is your student ID - you will need to change your password You will need to re-enter your original password before entering the new one. That is, the sequence is: original, original again, new, new again.

MySQL mysql connect to mysql mysql -u username -p connect to mysql as a okenobi, with a password

MySQL Prompt mysql> do not confuse with the bash prompt! Hint: type “exit” or ^C to exit.

Important Keys image source: command completion quit earlier commands “Ctrl+C” is usually represented as “^C”

SQL via SSH mysql> use starwars; Database changed mysql> select name, occupation from persona where species="Wookiee"; | name | occupation | | Chewbacca | co-pilot | row in set (0.00 sec)

This Course

Contact Information Office hours: - Wed, 5-6 pm, Rm use the Q&A system if possible - if ing, use UToronto mail - put “CCT395” in the subject line - expect 2 day turn-around

The Q&A System - use for all non-private questions - feel free to answer too!

“SQL ” “RDD”

The Course Outline

Relational Algebra persona

Projection persona

Projection persona

Selection persona (“Restriction” in Harrington)

Selection persona (“Restriction” in Harrington)

Columns vs Rows Projection: choosing columns (fields) by name Selection: choosing rows with a condition

Basic SELECT selection followed by projection select «list of fields» from «source table» where «conditions»;

Skipping Projection select * from «table» where «condition»; select * from persona where species="Human"; For instance:

Skipping Selection select * from «table»; select * from persona; For instance:

LIMIT select... from... limit «N»; select name from persona limit 5; For instance:

Sorting the Results select... from... where... order by «expression»; select name from persona order by size; For instance:

Questions?