Databases

Information about Databases

Published on October 16, 2007

Author: Lindon

Source: authorstream.com

Content

Databases and SQL:  Databases and SQL Structuring your world! Project Challenge 2007 Overview:  Overview What is a database? How are databases used? Database queries U.S. presidents BBC country profiles How to create a DB table? Adding records to a table Editing records Deleting records from a table Overview:  Overview How to use a DB table? Finding a date for Saturday night Nobel Prize winners: http://sqlzoo.net/1b.htm What are relational databases? Relations, primary keys and joins Querying a relational database using JOIN Internet Movie Database: http://sqlzoo.net/3.htm What is a database?:  What is a database? Database a collection of related records, organized into tables Table a set of data elements (values) organized by records (horizontal rows) and fields (vertical columns) Record (or row) a single, structured data item in a table Field (or column) a set of data values of a particular simple type, one for each row of the table A database table:  A database table R e c o r d s F i e l d s How are databases used?:  How are databases used? Computer databases allow users to Add, Edit, and Delete records; Extract records using specific criteria; and to Extract aggregate data from collections of records Database transactions are accomplished through queries Database queries:  Database queries SELECT queries are used to extract information from a database: Example: SELECT first_name, last_name FROM president WHERE state = ‘NY’; More database queries:  More database queries More examples SELECT first_name, last_name FROM president WHERE birth_date like ’19%’; SELECT count(*) FROM president WHERE state = ‘VT’; SELECT first_name, last_name FROM president WHERE state IN (ME,NH,VT,MA,CT,RI); Still more database queries:  Still more database queries Try all the SELECT exercise queries on the BBC Country Profiles database at: http://sqlzoo.net/1.htm How to create a DB table?:  How to create a DB table? Use CREATE TABLE query, specifying fields and column types: Example: CREATE TABLE friends ( first_name varchar(25), last_name varchar(25), gender enum(‘M’, ‘F’), grade smallint unsigned, hair_color varchar(20), email varchar(30), screen_name varchar(25), phone char(12)); Adding records to a table:  Adding records to a table Use the INSERT query: Example: INSERT INTO friends VALUES (‘Daffy’, ‘Duck’,‘M’,11,’Brunette’,‘[email protected]’, YellowBill’, ’315-555-1213’); Editing records :  Editing records Use the UPDATE query: Example: UPDATE friends SET phone=‘315-555-1234’ WHERE first_name=‘Daffy’ and last_name = ‘Duck’; Deleting records from a table:  Deleting records from a table Use the DELETE query: Example: DELETE FROM friends WHERE first_name=‘Daffy’ and last_name=‘Duck’; How to use a DB table?:  How to use a DB table? Finding a date: SELECT first_name, screen_name, phone FROM friends WHERE gender=‘F’ and grade > 10 and hair_color=‘Red’; How to use a DB table?:  How to use a DB table? Try all the SELECT exercise queries on the Nobel Laureates database at: http://sqlzoo.net/1b.htm What are relational databases?:  What are relational databases? Relations, primary keys, joins:  Relations, primary keys, joins Querying with JOIN:  Querying with JOIN SELECT name FROM casting JOIN actor ON casting.actorid=actor.id JOIN movie ON casting.movieid=movie.id WHERE actor.name = ‘Humphrey Bogart’ Querying with JOIN:  Querying with JOIN Try all the SELECT exercise queries on the Internet Movie Database at: http://sqlzoo.net/3.htm Questions?:  Questions?

Related presentations


Other presentations created by Lindon

wolbring1
08. 05. 2008
0 views

wolbring1

Occupational Noise
08. 05. 2008
0 views

Occupational Noise

Paper22
07. 05. 2008
0 views

Paper22

malignant hyperthermia
02. 05. 2008
0 views

malignant hyperthermia

mastitis
02. 05. 2008
0 views

mastitis

Chapter 3 lecture
02. 05. 2008
0 views

Chapter 3 lecture

habil final
02. 05. 2008
0 views

habil final

BIOSEC PDR
02. 05. 2008
0 views

BIOSEC PDR

Steps to PDR
02. 05. 2008
0 views

Steps to PDR

ancient china
10. 10. 2007
0 views

ancient china

Latin America 07
22. 10. 2007
0 views

Latin America 07

Super3 ApplytheBig6toK 2
11. 10. 2007
0 views

Super3 ApplytheBig6toK 2

tutorial coco
12. 10. 2007
0 views

tutorial coco

c115c905
13. 10. 2007
0 views

c115c905

Marina PartIII
16. 10. 2007
0 views

Marina PartIII

Harrison EgyptianWebQuest
21. 10. 2007
0 views

Harrison EgyptianWebQuest

20040616 blair
02. 10. 2007
0 views

20040616 blair

Consumer Health Compl
06. 12. 2007
0 views

Consumer Health Compl

599 Introduction
10. 10. 2007
0 views

599 Introduction

orizon2010
23. 10. 2007
0 views

orizon2010

Saul Hahn
25. 10. 2007
0 views

Saul Hahn

Guide to the Match 2007 FINAL
30. 10. 2007
0 views

Guide to the Match 2007 FINAL

U Fix It Workshop
07. 11. 2007
0 views

U Fix It Workshop

015 parker
19. 10. 2007
0 views

015 parker

yun MPLS
30. 10. 2007
0 views

yun MPLS

11029 2003
20. 11. 2007
0 views

11029 2003

Great Grains
21. 11. 2007
0 views

Great Grains

II homology
10. 10. 2007
0 views

II homology

basel
15. 10. 2007
0 views

basel

miele
03. 10. 2007
0 views

miele

pres4 7
31. 12. 2007
0 views

pres4 7

piero messina
04. 01. 2008
0 views

piero messina

ASBESTOS AWARENESS
04. 01. 2008
0 views

ASBESTOS AWARENESS

osmoregulation2
10. 10. 2007
0 views

osmoregulation2

Clim Application Water
07. 01. 2008
0 views

Clim Application Water

Accountability Foster
07. 01. 2008
0 views

Accountability Foster

145 9 new
07. 01. 2008
0 views

145 9 new

Fundraising AWNY2007
28. 09. 2007
0 views

Fundraising AWNY2007

VanBorm
12. 10. 2007
0 views

VanBorm

608uetic
24. 10. 2007
0 views

608uetic

SwissBCH
18. 10. 2007
0 views

SwissBCH

the superstring adventure
15. 10. 2007
0 views

the superstring adventure

winton
23. 10. 2007
0 views

winton

El Mozote
26. 02. 2008
0 views

El Mozote

don cote flh env conf
20. 03. 2008
0 views

don cote flh env conf

Shyama Bijapurkar
26. 03. 2008
0 views

Shyama Bijapurkar

Session 8 Meteorological Hazards
03. 10. 2007
0 views

Session 8 Meteorological Hazards

RiseofBigBusiness
27. 02. 2008
0 views

RiseofBigBusiness

4550ch16
11. 04. 2008
0 views

4550ch16

bbhh107 presentation
26. 11. 2007
0 views

bbhh107 presentation

Arbitragepresentation
16. 04. 2008
0 views

Arbitragepresentation

holiday 2007
17. 04. 2008
0 views

holiday 2007

class8n4
22. 04. 2008
0 views

class8n4

mindful habits
11. 03. 2008
0 views

mindful habits

PraesentationAchtonl ine
07. 10. 2007
0 views

PraesentationAchtonl ine

12 Project02 05
04. 10. 2007
0 views

12 Project02 05

Balschmiter
05. 10. 2007
0 views

Balschmiter

DARPA NoD
08. 10. 2007
0 views

DARPA NoD

308
02. 05. 2008
0 views

308

200606INRIADREIen
13. 03. 2008
0 views

200606INRIADREIen

Organigrama actualizado 01
22. 10. 2007
0 views

Organigrama actualizado 01

Japan Outlook
25. 03. 2008
0 views

Japan Outlook

Inferring Main Ideas New
15. 10. 2007
0 views

Inferring Main Ideas New

Nutrients
07. 03. 2008
0 views

Nutrients

secession
17. 10. 2007
0 views

secession

L5PresentationFive
19. 10. 2007
0 views

L5PresentationFive

JIGSAW
23. 11. 2007
0 views

JIGSAW

fall
02. 11. 2007
0 views

fall

holland poodles
16. 11. 2007
0 views

holland poodles

niimoto
09. 10. 2007
0 views

niimoto

comment to Itai
07. 04. 2008
0 views

comment to Itai

L24 Sartorius
04. 01. 2008
0 views

L24 Sartorius

Power Point Final
02. 11. 2007
0 views

Power Point Final

Prof Thomas Meyer
17. 10. 2007
0 views

Prof Thomas Meyer

Bauer
15. 11. 2007
0 views

Bauer

PBritton
10. 04. 2008
0 views

PBritton

AST5220 2 print
15. 10. 2007
0 views

AST5220 2 print

PRESENTATIONISAAC
01. 11. 2007
0 views

PRESENTATIONISAAC

Willits FIA Program News 2007
08. 10. 2007
0 views

Willits FIA Program News 2007

15 Tauchi
09. 10. 2007
0 views

15 Tauchi

hedberg
19. 10. 2007
0 views

hedberg

Analyst briefing condenced
19. 10. 2007
0 views

Analyst briefing condenced

funcProg2
19. 10. 2007
0 views

funcProg2

28 C4 avispachaquetaamar
24. 10. 2007
0 views

28 C4 avispachaquetaamar