COP 4540 Database Management

Similar documents
Management System for Flight Information

Management System for Flight Information

Europass website activity report 2015 (Iceland, Icelandic)

Introduction to Data Management CSE 344

Europass website activity report 2017 (Iceland, Icelandic)

Microsoft Courses Schedule February December 2017

Europass website activity report 2018 (Macedonia, the former Yugoslav Republic of, Macedonian)

Europass website activity report 2018 (Macedonia, the former Yugoslav Republic of, Macedonian)

Europass website activity report 2017 (Macedonia, the former Yugoslav Republic of, Macedonian)

SQL Practice Questions

Saudi Arabia booking information system

FINAL EXAM: DATABASES ("DATABASES") 22/06/2010 SCHEMA

Part 1. Part 2. airports100.csv contains a list of 100 US airports.

Monthly Australian road deaths last five years, with trend. 60 Jan 08 Jan 09 Jan 10 Jan 11 Jan 12 Jan 13

Solutions to Examination in Databases (TDA357/DIT620)

Experience with Digital NOTAM

SWEN502 Foundations of Databases Session 2. Victoria University of Wellington, 2017, Term 2 Markus Luczak-Roesch

Marketing Mix Affecting Accommodation Service Buying Decisions of Backpacker Tourist Traveling at Inner Rattanakosin Island in Bangkok, Thailand

Query formalisms for relational model relational algebra

Concept, Method, Challenges. Jürgen Weiß. MA in Tourism Economics (University of applied Sciences Vienna)

Melbourne Official Visitor Map Media Kit 2016/17 MELBOURNE OFFICIAL VISITOR MAP MEDIA KIT 1

Microsoft Courses Schedule February June 2018

Carbon Offsetting and Reduction Scheme for International Aviation (CORSIA):

SERIES NO. SDT: Government of Tonga

Aboriginal and Torres Strait Islander suicide data 2016

Bus Passenger Survey spring 2015 results Centro - West Midlands PTE area

Organizing CLF Replenishment Events into CLF Voyages The CLF Voyages Template. Jason P. Jordan

Inverness, Culloden and Suburbs Settlement Economic Overview

Global formulas. Page1. Video filmed with GeneXus X Evolution 2

EXHIBITORS WITH BOOTH SPACE OVER 1501 SQ. FT.

Topic / Sub-topic L Content Ref. Material. ICAO Doc Recognise the need for

Some questions? Background (cont) Background

THE DOGS ALLAN STRATTON

Venice Airport: A small Big Data story

Background Information. Instructions. Problem Statement. HOMEWORK INSTRUCTIONS Homework #4 Airfare Prices Problem

Figure 1.1 St. John s Location. 2.0 Overview/Structure

Federal GIS Conference February 10 11, 2014 Washington DC. ArcGIS for Aviation. David Wickliffe

U S A S O C S T A T I C L I N E J U M P M A S T E R C O U R S E N O M E N C L A T U R E S T U D Y G U I D E

SILK ROAD. A view from the world

Hawaii By Cruise Ship: The Complete Guide To Cruising The Hawaiian Islands, Includes Tahiti By Anne Vipond

Asia-Pacific Trade Briefs: New Zealand

Class F3K Hand Launch Gliders 5.7. CLASS F3K - HAND LAUNCH GLIDERS

Puerto Ricans in Rhode Island, the United States, and Puerto Rico, 2013

National REDD+ Awareness Raising Workshop

A backpack tutorial *lot of pictures*

NAIPS Internet Service Authorised NOTAM Originator User Guide Version 3.0. (To be read in addition to NIS User Guide 3.0)

Minigolf Club - Predazzo. Minigolf Club Predazzo. and Federazione Italiana Golf su Pista INVITE YOU TO:

Market Monitor. Half Year Review

Some questions about our plan for transport in Bristol Bristol City Council

Regional Seminar/Workshop on CMA and SAST

3rd Party Brand Usage Guidelines

OAKLAND SYMPHONY YOUTH ORCHESTRA SUPPORTERS TOUR OF CHINA, Suggested Itinerary July 5, 2018

Using The Approach Planner

Custom brushes can be made to your specifications. Call for details!

GPS For VFR: A Practical GPS Guide For VFR Pilots By Mike Meadows

D-SUB SERIES. Fast Locking System ESCC 3401/085. Features and Benefits. Typical Applications. Specification. Quality Level.

Project 2 Database Design and ETL

Monthly Report of Tuberculosis Surveillance, Japan January, 2016

Monthly Report of Tuberculosis Surveillance, Japan May, 2018

Monthly Report of Tuberculosis Surveillance, Japan September, 2018

An-Najah National University

Affix recent Passport size Colored photograph (Self attested)

Seminar on USOAP Continuous Monitoring Approach (CMA) and State Aviation Safety Tools (SAST)

GCSE -Full Courses Summer 2008

A largely empty airport with little noise but the one coming from a television playing CNN above benches.

A GIS Analysis of Probable High Recreation Use Areas in Three Sisters Wilderness Deschutes and Willamette National Forests

The Mindset Shift: Stop The Corporate Rat Race, Make A Difference And Achieve Personal Freedom! By Bradley Thomas Finkeldei READ ONLINE

West of England LEP Quarterly Economic Bulletin April 2012

Snowmobile Accident Report For Date of Run: 11/10/2005

MASTER S THESIS. Ioannis Mamalikidis, UID: 633

CONTACT ON (888) FOR ANY QUERY RELATED TO BOOKING AMERICAN AIRLINES RESERVATIONS

DATA APPLICATION CATEGORY 25 FARE BY RULE

El Dia De Muertos / The Day Of The Dead (Spanish Edition) By Ivar Da Coll READ ONLINE

Travel and Tourism in Ukraine: Key Trends and Opportunities to 2016

Alice In Wonderland Collection By Lewis Carroll

Impacts of Visitor Spending on the Local Economy: George Washington Birthplace National Monument, 2004

PROFILE OF THE PUERTO RICAN POPULATION IN UNITED STATES AND PUERTO RICO: 2008

Not For Tourists Guide To Brooklyn 2013 By Not For Tourists READ ONLINE

POTOMAC AND RAPPAHANNOCK TRANSPORTATION COMMISSION. GWRC May 2017

STATISTICAL BULLETIN ON INTERNATIONAL ARRIVALS, DEPARTURES AND MIGRATION 2011 SERIES NO. SDT: Government of Tonga

Czech Airlines. Ambient Media

Scaling Up the Local Tourism Data Ecosystem in Guimaras

Life expectancy and potentially avoidable deaths in

BRANDED AMPS

Department of Tourism. Japan International Cooperation Agency

Presentation of activities / projects for the development of cadastre in Kosovo

Puerto Ricans in Georgia, the United States, and Puerto Rico, 2014

Affix recent Passport size coloured photograph (Self attested) Page 1 of 6. For Office Use Only. Remarks : ELIGIBLE / NOT-ELIGIBLE.

ACI-NA BUSINESS TERM SURVEY APRIL 2017

APPROVED SEMESTER ELECTIVES Accounting Diploma (AC12)

POSITIVE + OUTLOOK MICROSOFT CAMPUS 1 EPPING ROAD, NORTH RYDE, NSW

The methodology and sample surveys have been developed through a partnership of: DCNR and the Secretary's Greenways Program Advisory Committee

SCOPE AND PATTERNS OF TOURIST ACCIDENTS IN THE EUROPEAN UNION

Case Forte Hotel Design

I T N E T R E N R A N T A I T ON O AL A L A R A R R I R VA V L A S L S A N A D N D D E D PA

The 43rd World Youth Rally 2018

Tourist Survey 2014 Go Rural. Results

TripAdvisor Workshop Christchurch 7 June 2016

Project 2 Database Design and ETL

New Distribution Capability

Transcription:

COP 4540 Database Management MICROSOFT ACCESS TUTORIAL Hsin-Yu Ha

Create Database Create Table Set up attribute type, primary key, foreign key Query SQL Language

SQL Template

Tables Example: Library Database

List of Queries Query 1. Retrieve the names of all the male Resident Query 2. Retrieve the number of female and male residents Query 3. Retrieve the names of residents who did not borrow any book in our record Query 4. Retrieve the Library card id/names of residents who borrow more than once in record Query 5. Retrieve the names of residents who borrow books less than 5 days

Example: Library Database Query 1. Retrieve the names of all the male Resident SELECT Resident_L_Name,Resident_F_Name FROM Resident WHERE Sex="M"

Example: Library Database Query 2. Retrieve the number of female and male residents Important Function Aggregation functions: SUM, COUNT, MAX etc. SELECT Sex, count(*) as NumberofRecord FROM Resident GROUP BY Sex

Example: Library Database Query 3. Retrieve the names of residents who did not borrow any book in our record Important Function Nested Select Please notice that you can always use inner join or EXIST as an alternative resolution. SELECT Resident_L_Name,Resident_F_Name FROM Resident WHERE LibraryCard_ID not in (SELECT LibraryCard_ID FROM Record)

Example: Library Database Query 4. Retrieve the Library card id/names of residents who borrow more than once in record Important Function HAVING: The HAVING clause is used in combination with the GROUP BY clause Step1 SELECT LibraryCard_ID FROM Record GROUP BY LibraryCard_ID Having count(*) > 1 Step2 SELECT Resident_L_Name,Resident_F_Name FROM Resident WHERE LibraryCard_ID in (SELECT LibraryCard_ID FROM Record GROUP BY LibraryCard_ID Having count(*) > 1)

Example: Library Database Query 5. Retrieve the names of residents who borrow books less than 5 days Option1 SELECT Resident_L_Name,Resident_F_Name FROM Resident WHERE LibraryCard_ID in (SELECT LibraryCard_ID FROM Record WHERE Date_of_return - Date_of_borrow<5)

Example: Library Database Query 5. Retrieve the names of residents who borrow books less than 5 days Important Function Datediff Option2 SELECT Resident_L_Name,Resident_F_Name FROM Resident WHERE LibraryCard_ID in (SELECT LibraryCard_ID FROM Record WHERE datediff( d,date_of_return, Date_of_borrow)< 5

INNER JOIN Let the Great World Spin 45 Brooklyn 20 The City & the City 33 Stitches 24 Crazy for the Storm 19 Let the Great World Spin 20 The Lost Symbol 30 The City & the City 29 Little Oink 18 Crazy for the Storm 23 Inner Join SELECT A., A. as A_, B. as B_ FROM Amazon as A INNER JOIN FIU_bookstore as B ON A.books_title = B.

INNER JOIN(cont.) Let the Great World Spin 45 Brooklyn 20 The City & the City 33 Stitches 24 Crazy for the Storm 19 Let the Great World Spin 20 The Lost Symbol 30 The City & the City 29 Little Oink 18 Crazy for the Storm 23 Inner Join A_ B_ Let the Great World Spin 45 20 The City & the City 33 29 Crazy for the Storm 19 23

LEFT JOIN Let the Great World Spin 45 Brooklyn 20 The City & the City 33 Stitches 24 Crazy for the Storm 19 Let the Great World Spin 20 The Lost Symbol 30 The City & the City 29 Little Oink 18 Crazy for the Storm 23 Left Join SELECT A. as A_Books, B. as B_Books FROM Amazon as A LEFT JOIN FIU_bookstore as B ON A.books_title = B.

LEFT JOIN(cont.) Let the Great World Spin 45 Brooklyn 20 The City & the City 33 Stitches 24 Crazy for the Storm 19 Let the Great World Spin 20 The Lost Symbol 30 The City & the City 29 Little Oink 18 Crazy for the Storm 23 Left Join A_Books Let the Great World Spin Brooklyn The City & the City Stitches Crazy for the Storm B_Books Let the Great World Spin The City & the City Crazy for the Storm

RIGHT JOIN Let the Great World Spin 45 Brooklyn 20 The City & the City 33 Stitches 24 Crazy for the Storm 19 Let the Great World Spin 20 The Lost Symbol 30 The City & the City 29 Little Oink 18 Crazy for the Storm 23 Right Join SELECT A. as A_Books, B. as B_Books FROM Amazon as A RIGHT JOIN FIU_bookstore as B ON A.books_title = B.

RIGHT JOIN (cont.) Let the Great World Spin 45 Brooklyn 20 The City & the City 33 Stitches 24 Crazy for the Storm 19 Let the Great World Spin 20 The Lost Symbol 30 The City & the City 29 Little Oink 18 Crazy for the Storm 23 Right Join A_Books Let the Great World Spin The City & the City Crazy for the Storm B_Books Let the Great World Spin The Lost Symbol The City & the City Little Oink Crazy for the Storm