+ All Categories
Home > Documents > COP 4540 Database Management

COP 4540 Database Management

Date post: 12-Jan-2016
Category:
Upload: luisa
View: 36 times
Download: 0 times
Share this document with a friend
Description:
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. Query 1. Retrieve the names of all the male Resident Query 2. Retrieve the number of female and male residents - PowerPoint PPT Presentation
9
MICROSOFT ACCESS TUTORIAL COP 4540 Database Management Hsin-Yu Ha
Transcript
Page 1: COP 4540 Database Management

MICROSOFT ACCESS TUTORIAL

COP 4540Database Management

Hsin-Yu Ha

Page 2: COP 4540 Database Management

Create DatabaseCreate TableSet up attribute type, primary key, foreign

keyQuery

SQL Language

Page 3: COP 4540 Database Management

Query 1. Retrieve the names of all the male ResidentQuery 2. Retrieve the number of female and male

residentsQuery 3. Retrieve the names of residents who did not

borrow any book in our recordQuery 4. Retrieve the Library card id/names of

residents who borrow more than once in recordQuery 5. Retrieve the names of residents who

borrow books more than 10 daysQuery 6. What is the total price of books each

residents have borrowed?

Page 4: COP 4540 Database Management

INNER JOIN

Inner Join SELECT A.Books_title, A.Books_price as A_price , B.Books_price as B_price FROM Amazon as A INNER JOIN FIU_bookstore as B ON A.books_title = B.Books_title

Books_title Books_price

Let the Great World Spin

45

Brooklyn 20

The City & the City 33

Stitches 24

Crazy for the Storm 19

Books_title Books_price

Let the Great World Spin

20

The Lost Symbol 30

The City & the City 29

Little Oink 18

Crazy for the Storm 23

Page 5: COP 4540 Database Management

INNER JOIN(cont.)

Inner Join

Books_title Books_price

Let the Great World Spin

45

Brooklyn 20

The City & the City 33

Stitches 24

Crazy for the Storm 19

Books_title Books_price

Let the Great World Spin

20

The Lost Symbol 30

The City & the City 29

Little Oink 18

Crazy for the Storm 23

Books_title A_price B_price

Let the Great World Spin 45 20

The City & the City 33 29

Crazy for the Storm 19 23

Page 6: COP 4540 Database Management

LEFT JOIN

Left Join SELECT A.Books_title as A_Books , B.Books_title as B_Books FROM Amazon as A LEFT JOIN FIU_bookstore as B ON A.books_title = B.Books_title

Books_title Books_price

Let the Great World Spin

45

Brooklyn 20

The City & the City 33

Stitches 24

Crazy for the Storm 19

Books_title Books_price

Let the Great World Spin

20

The Lost Symbol 30

The City & the City 29

Little Oink 18

Crazy for the Storm 23

Page 7: COP 4540 Database Management

LEFT JOIN(cont.)

Left Join

Books_title Books_price

Let the Great World Spin

45

Brooklyn 20

The City & the City 33

Stitches 24

Crazy for the Storm 19

Books_title Books_price

Let the Great World Spin

20

The Lost Symbol 30

The City & the City 29

Little Oink 18

Crazy for the Storm 23

A_Books B_Books

Let the Great World Spin

Let the Great World Spin

Brooklyn

The City & the City The City & the City

Stitches

Crazy for the Storm Crazy for the Storm

Page 8: COP 4540 Database Management

RIGHT JOIN

Right Join SELECT A.Books_title as A_Books , B.Books_title as B_Books FROM Amazon as A RIGHT JOIN FIU_bookstore as B ON A.books_title = B.Books_title

Books_title Books_price

Let the Great World Spin

45

Brooklyn 20

The City & the City 33

Stitches 24

Crazy for the Storm 19

Books_title Books_price

Let the Great World Spin

20

The Lost Symbol 30

The City & the City 29

Little Oink 18

Crazy for the Storm 23

Page 9: COP 4540 Database Management

RIGHT JOIN (cont.)

Right Join

Books_title Books_price

Let the Great World Spin

45

Brooklyn 20

The City & the City 33

Stitches 24

Crazy for the Storm 19

Books_title Books_price

Let the Great World Spin

20

The Lost Symbol 30

The City & the City 29

Little Oink 18

Crazy for the Storm 23

A_Books B_Books

Let the Great World Spin

Let the Great World Spin

The Lost Symbol

The City & the City The City & the City

Little Oink

Crazy for the Storm Crazy for the Storm


Recommended