Welcome to INF1343! Database Modeling and Database Design This presentation is licensed under Creative Commons Attribution License, v. 3.0. To view a copy.

Slides:



Advertisements
Similar presentations
LIS651 lecture 5 direct use of wotan Thomas Krichel
Advertisements

Linux, it's not Windows A short introduction to the sub-department's computer systems Gareth Thomas.
Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
CSCI 1411 FUNDAMENTALS OF COMPUTING LAB Lab Introduction 1 Shane Transue MSCS.
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.
Dayu Zhang 9/3/2014 Lab01. Lab Instructor: Dayu Zhang Office Hour Mon/Wed 10:40am – 11:10am Room A201 Lab Website
A crash course in njit’s Afs
Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.
BIF713 Operating Systems & Project Management Instructor: Murray Saul
Session 5: Working with MySQL iNET Academy Open Source Web Development.
Help session: Unix basics Keith 9/9/2011. Login in Unix lab  User name: ug0xx Password: ece321 (initial)  The password will not be displayed on the.
Welcome to Linux & Shell Scripting Small Group How to learn how to Code Workshop small-group/
Linux environment ● Graphical interface – X-window + window manager ● Text interface – terminal + shell.
PHP Programming with MySQL Slide 8-1 CHAPTER 8 Working with Databases and MySQL.
Unix Basics Chapter 4.
Chapter 7 Working with Databases and MySQL PHP Programming with MySQL 2 nd Edition.
Unix Tutorial for FreeSurfer Users. Helpful To Know FreeSurfer Tutorial Wiki:
Copyright (c) by CNAPTICS Corporation. All rights reserved.1 INFO Oracle Database 11g: Administration II Presented By: Marc S. Paller,
NMED 3850 A Advanced Online Design January 12, 2010 V. Mahadevan.
PROGRAMMING PROJECT POLICIES AND UNIX INTRO Sal LaMarca CSCI 1302, Fall 2009.
Unix Tutorial for FreeSurfer Users. Helpful To Know FreeSurfer Tutorial Wiki:
Unix and Samba By: IC Labs (Raj Kidambi). What is Unix?  Unix stands for UNiplexed Information and Computing System. (It was originally spelled "Unics.")
Introduction to Programming Using C An Introduction to Operating Systems.
Unix Servers Used in This Class  Two Unix servers set up in CS department will be used for some programming projects  Machine name: eustis.eecs.ucf.edu.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
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.
 Last lesson, the Windows Operating System was discussed along with the Windows command shell  Unix is a computer operating system, that similarly manages.
CS 120 Extra: The CS1 Server Tarik Booker CS 120.
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.
Assignprelim.1 Assignment Preliminaries © 2012 B. Wilkinson/Clayton Ferner. Modification date: Jan 16a, 2014.
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.
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.
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.
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.
Dept. of Computer & Information Sciences
Review Why do we use protection levels? Why do we use constructors?
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
Introduction to Unix for FreeSurfer Users
CS1010: Intro Workshop.
CS 3630 Database Design and Implementation
Web Programming Essentials:
Data Modeling and Database Design INF1343, Winter 2012 Yuri Takhteyev
Special Topics in CCIT: Databases
CCT1343, Week 2 Single-Table SQL Yuri Takhteyev University of Toronto
Andy Wang Object Oriented Programming in C++ COP 3330
Part 3 – Remote Connection, File Transfer, Remote Environments
Data Modeling and Database Design
Database Design and Implementation
Assignment Preliminaries
Data Modeling and Database Design INF1343, Winter 2012 Yuri Takhteyev
ORACLE SQL Developer & SQLPLUS Statements
Introduction to UNIX UNIX developed at Bell Labs in 70s
Chapter 7 Working with Databases and MySQL
Chapter 8 Working with Databases and MySQL
CSE 390a Lecture 3 bash shell continued: processes; multi-user systems; remote login; editors slides created by Marty Stepp, modified by Jessica Miller.
CS1222 Using Relational Databases and SQL
Web Programming Essentials:
Andy Wang Object Oriented Programming in C++ COP 3330
CSE 303 Concepts and Tools for Software Development
CSE 390a Lecture 3 bash shell continued: processes; multi-user systems; remote login; editors slides created by Marty Stepp, modified by Jessica Miller.
Lecuter-1.
INTRODUCTION A Database system is basically a computer based record keeping system. The collection of data, usually referred to as the database, contains.
Presentation transcript:

Welcome to INF1343! Database Modeling and Database Design 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 Yuri Takhteyev University of Toronto January 3, 2011

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

Alic e Bob application software database “persistent storage”

Alic e Bob database “persistent storage”

What is Data? Data Information Knowledge

What is Data? Bytes Database Bits Records

Create Read Update Delete require a way of finding the record

Database Elements “logical” representation “physical” representation

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 m) (Gungan, humanoid, 1.89 m) (Hutt, gastropod, 3.5 m) (Ewok, furry biped, 0.9 m)

And Another (humanoid, 2 legs) (gastropod, 0 legs)

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

GUI Client for a Remote Database interne t databas e client databas e server

A 3-Tier System web browser application server

A Query Language commands status, results

A Query Language command s

A Query Language command s telnet/SSH client

Structured Query Language

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

An SQL Statement select name, occupation from persona where species=”Wookiee”; - SQL keywords are not case-sensitive (de facto) - text strings nearly always 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”

Types of Statements Data Manipulation select, insert, update, delete Data Definition create, alter, drop Data Control grant, revoke Transaction Control commit, rollback

This Course a shortcut for

Contact Information Office hours: - Mon, 2-3pm, iSouth rm use UToronto mail - put “inf1343” in the subject line - expect 2 day turn-around

“SQL ” “RDD”

Grading project exam assignment 1 assignment 2

Due Dates in-class final exam final project report assignment 2 assignment 1 preliminary project design

Lecture Schedule (See the syllabus)

Questions?

A Query Language SQL telnet/SSH client

Unix via SSH 1. Using a local bash* terminal 2. Using remote bash via SSH** 3. Running mysql remotely via SSH 4. Moving files back and forth * Bash = “Bourne again shell” (a somewhat updated version of the 1971 Thompson shell) ** SSH = “Secure shell” (a secure version of the 1969 telnet)

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.:

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)

SSH ssh - your username is your UtorID - your password is your UtorID too - 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.

More Unix Commands ls – list files in a directory cd – change directory mkdir – create (make) a directory rm – delete (“remove”) a file or directory cp – copy a file or directory less – view a text file nano – edit a text file mysql – start mysql client some of those commands are available both in your local and remote bash, some just on the server

Anatomy of the Unix Command cp -r /play/yoda /tmp/yoda2 the commandarguments options (may have their own arguments)

Some Examples cd /play go to directory “/play” Hint: press [Tab] after typing “/pl” ls list the files in the current directory cd yoda go to directory “yoda” Hint: press [Tab] after typing “y” ls Hint: use [ ↑ ] for earlier commands

Some Examples less force.txt Hint: press [Tab] after typing “f” Hint: press “q” to exit less cd.. go to up one level ls cd locked go to directory “sandbox” Hint: you don't have the permissions

Some Examples cd sandbox mkdir obiwan create a directory “obiwan” (use your own name) ls we should see everyone's directory cd obiwan go to your directory

Some Examples ls /play/yoda/ What was that file called again? less /play/yoda/force.txt Let's look at it again. cp /play/yoda/force.txt. copy “force.txt” to the local directory nano force.txt edit force.txt Hint: ^ means [Control]

Options ls -sh list files with file sizes cp -r /play/yoda. copy “recursively” less -N force.txt. show the file with line numbers

Getting Help man ls user manual for the ls command

Directories /home/kenobio7 user's “home” directory ~ alias for user's home directory e.g. “ls ~”. current directory.. parent of the current directory

Redirection command > file.txt write the output to file command < file.txt feed the content of file to the command command1 | comman2 send the output of command1 to command2 (We'll see examples in a second.)

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

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

A Bit of SQL use starwars; select name, occupation from persona where species=”Wookiee”;

A Bit of SQL 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)

SQL From a File cd ~ cp /play/yoda/humans.sql. mysql < humans.sql run mysql client feeding it the contents of “non-humans.sql” mysql h.txt save the output into “h.txt” Exercise: create a file “ewoks.sql” that would give us a list of Ewoks.

Using SCP scp = secure copy (or ssh + cp) copy files over an ssh connection Hint: You will usually be running this in your local bash session (i.e. on your laptop/desktop). Hint: Windows users can use WinSCP instead.

Remove to Local scp /local/dir e.g.: scp usernam e host (server) remote file local directory

Local to Remote scp /local/file e.g.: scp ewoks.sql

Editing Files Locally Windows: Notepad++ Mac: TextWrangler Linux: gedit (or emacs, vi) Key feature: syntax highlighting

Home Exercises 1. Connect to the server. 2. Connect to mysql database “starwars.” 3.Find the droids (the species is “droid”). 4.Write an SQL file for finding the droids. 5.Scp the file to the server. 6.Find the droids, saving the results to a file (“droids.txt”). 7.Scp droids.txt back to your laptop/desktop.