Download presentation
Presentation is loading. Please wait.
Published byJoshua McKenzie Modified over 8 years ago
1
INF1343, Winter 2012 Data Modeling and Database Design Yuri Takhteyev Faculty of Information University of Toronto This presentation is licensed under Creative Commons Attribution License, v. 3.0. To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/. This presentation incorporates images from the Crystal Clear icon collection by Everaldo Coelho, available under LGPL from http://everaldo.com/crystal/.
2
Week 1 Introducing Databases the Relational Data Model and SQL
3
What is a “Database”? “an organized collection of data” (digital, managed with software) “DBMS”
4
Bob information Alic e
5
Bob information Alic e
6
Bob an information system
7
Alic e Bob storing information + doing things with it
8
Alic e Bob application software database “persistent storage”
9
Alic e Bob database “persistent storage”
10
What is Data? Data Information Knowledge
11
What is Data? Values Database Bits Records
12
Database Elements “logical” representation “physical” representation
13
Basic Data Types Numbers 42, 2.7, 7.2×10 -19, 879284337621 Text “Strings” “Yoda”, “Chewbacca”, “A long time ago in a galaxy far, far away....”
14
More Complex Data Time “Sept. 7, 2011” (2011-09-07) Binary “Blobs” contents of an image file Geometric a line, a polygon
15
Databases Models
16
Key-Value Jedi Master, unknown species smuggler, human Yoda Han Solo
17
Hierarchical character s human wookiee unknown species Padmé Amidala Chewbacca Yoda Han Solo Obi-Wan Kenobi
18
Network human wookieeChewbacca Yoda Han Solo Obi-Wan Kenobi Jedi Master
19
Relational A notion of a “relation” not to be confused with a “relationship”
20
A Relation (“Yoda”, “Jedi Master”)
21
A Relation (“Yoda”, “Jedi Master”, “unknown species”)
22
A Relation (“Yoda”, “Jedi Master”, “unknown species”) (“San Solo”, “smuggler”, “Human”) (“Padmé Amidala”, “queen”, “Human”) (“Jabba”, “crime lord”, “Hutt”) (“Jar Jar Binks”, “senator”, “Gungan”)
23
Another Relation (“Human”, “humanoid”, 1.7) (“Gungan”, “humanoid”, 1.89) (“Hutt”, “gastropod”, 3.5) (“Ewok”, “furry biped”, 0.9)
24
And Another (“humanoid”, 2) (“gastropod”, 0)
25
Tabular Form persona species_type species
26
Tabular Form persona species_type species
27
Relational Data Modeling Finding a proper relational representation for data
28
RDBMS MySQL, PostgreSQL, Oracle, Sybase, IBM DB2, Informix, MS SQL Server, MS Access*
29
Accessing a Database
30
Built-in GUI
31
Networked Client databas e server databas e client
32
A 3-Tier System databas e server application server web client
33
A Query Language commands status, results
34
Structured Query Language (Some people say “Sequel”)
35
An SQL Statement select name, occupation from persona where species=”Wookiee”;
36
An SQL Statement select name, occupation from persona where species="Wookiee";
37
persona
38
MySQL Workbench http://wb.mysql.com/ (also available in this lab)
41
your database username from the handout (NOT your utorid) r2.ischool.utoronto.ca
43
your database password from the handout
44
1 2
49
An SQL Statement select name, occupation from persona where species="Wookiee"; strings identifier s keyword s — not case-sensitive (de facto) — often are case sensitive — depends on configuration
50
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" (sometimes)
51
Quotes Text Strings must always be quoted Identifiers must be when the happen to be keywords (use backticks: `...`) Quote Types "..." or '...', not “...” or ‘...’ ( " must be closed by ", ' by ')
52
The Semi-Colon Don’t forget the semi-colon;
53
This Course http://takhteyev.org/courses/12F/inf1343/
54
Office Hours Time: Mondays, 14:00–15:00 (Not today, though.) Or by appointment. Place: Room 328 in iSouth (45 Wilcocks St.)
55
Contact Email: Use the Q&A system if possible. If emailing, use UToronto mail Put “INF1343” in the subject. Expect 2 day turn-around.
56
The Q&A System http://inf1343.ischool.utoronto.ca/ - use for all non-private questions - feel free to answer too!
57
“SQL ” “RDD”
58
The Course Outline
59
Grading Exercises & Quizzes Final Project (2 deliverables) The Final Exam “Standard” grading vs “the Project Option”
60
Questions?
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.