SlideShare a Scribd company logo
1 of 35
Download to read offline
Library Assignment
Let's try to understand one
simple database
A library allows customers
to check out books
So what tables do we need?
Customer table: any data the
library needs to keep about its
customers
Customer table primary key:
Autonumber
Book table: store any data the
library needs to keep about its
books
Primary key for book table
Is there a relationship
between the book and
customer table?
To see if 2 tables have a
relationship you must ask 3
questions.
You have to ask 3 questions
for each side of the
relationship
Could you have a book in the
book table that no one has
checked out?
Could you have a book that 1
customer has checked out?
Could you have a book that
more than 1 customer has
checked out?
Since you can have a book
checked out by more than
one customer
                    M

   Book           Customer
Could you have a customer
in the customer table that
has not checked out a book?
Could you have a customer
that has checked out 1 book?
Could you have a customer
that has checked out more
than 1 book?
This side of the relationship is
also many!
       M

     Book              Customer
So we have a many to many
relationship!

    M             M

  Book           Customer
Each customer can check out
more than one book and each
book can be checked out by
more than one customer
We can’t track which book a
customer checks out without
adding a new table.
To create a bridge table you
start with the primary keys of
the related tables
What should be the primary
key for the bridge table?
Entity relationship diagram
shows the relationship

           1   M              M   1
customer           checkout           book
But a customer can check out
more than one book at a time!
So instead of creating a bridge
table between customer and
book tables we will create a
check out table to show each
time a customer checks out
books.
So we need a table to show
each time a customer checks
out books…
…and another table to show
exactly what books that
customer checked out that
day
The Checkout_Book table
would be the bridge or
junction table here for the
Book and Checkout tables
many to many relationship.
To enter data in this
database
You could not enter data about a
customer checking out a book if…
Questions?
Access Database Library Assignment
Access Database Library Assignment

More Related Content

Viewers also liked

Library Management System PPT
Library Management System PPTLibrary Management System PPT
Library Management System PPTTamaghna Banerjee
 
Library management
Library managementLibrary management
Library managementfarouq umar
 
Library mangement system project srs documentation.doc
Library mangement system project srs documentation.docLibrary mangement system project srs documentation.doc
Library mangement system project srs documentation.docjimmykhan
 
Data Base System Application - Unit 7
Data Base System Application - Unit 7Data Base System Application - Unit 7
Data Base System Application - Unit 7Amit Chandra
 
Dbms in education sector
Dbms in education sectorDbms in education sector
Dbms in education sectorantuvane
 
Database Programming Project Assignment
Database Programming Project AssignmentDatabase Programming Project Assignment
Database Programming Project AssignmentMahesh Kodituwakku
 
Assignment 2 of Database (Database Security)
Assignment 2 of Database (Database Security)Assignment 2 of Database (Database Security)
Assignment 2 of Database (Database Security)Aey Unthika
 
Importance of database design (1)
Importance of database design (1)Importance of database design (1)
Importance of database design (1)yhen06
 
library management system in SQL
library management system in SQLlibrary management system in SQL
library management system in SQLfarouq umar
 
Entity Relationship Diagram of Library System
Entity Relationship Diagram of Library SystemEntity Relationship Diagram of Library System
Entity Relationship Diagram of Library SystemAbdul Rahman Sherzad
 

Viewers also liked (13)

Library Management System PPT
Library Management System PPTLibrary Management System PPT
Library Management System PPT
 
Library management
Library managementLibrary management
Library management
 
Library mangement system project srs documentation.doc
Library mangement system project srs documentation.docLibrary mangement system project srs documentation.doc
Library mangement system project srs documentation.doc
 
Data Base System Application - Unit 7
Data Base System Application - Unit 7Data Base System Application - Unit 7
Data Base System Application - Unit 7
 
Dbms in education sector
Dbms in education sectorDbms in education sector
Dbms in education sector
 
Database Programming Project Assignment
Database Programming Project AssignmentDatabase Programming Project Assignment
Database Programming Project Assignment
 
Assignment 2 of Database (Database Security)
Assignment 2 of Database (Database Security)Assignment 2 of Database (Database Security)
Assignment 2 of Database (Database Security)
 
ICT Students Presentations
ICT Students PresentationsICT Students Presentations
ICT Students Presentations
 
Importance of database design (1)
Importance of database design (1)Importance of database design (1)
Importance of database design (1)
 
Library Orientation
Library OrientationLibrary Orientation
Library Orientation
 
library management system in SQL
library management system in SQLlibrary management system in SQL
library management system in SQL
 
Entity Relationship Diagram of Library System
Entity Relationship Diagram of Library SystemEntity Relationship Diagram of Library System
Entity Relationship Diagram of Library System
 
Library research methods
Library research methodsLibrary research methods
Library research methods
 

More from wiljs

Lms best practices-What is yours?
Lms best practices-What is yours?Lms best practices-What is yours?
Lms best practices-What is yours?wiljs
 
CSM Mentor Presentation
CSM Mentor PresentationCSM Mentor Presentation
CSM Mentor Presentationwiljs
 
College Faculty Mentor Program
College Faculty Mentor ProgramCollege Faculty Mentor Program
College Faculty Mentor Programwiljs
 
Blackboard 9.1 Secret Sharer
Blackboard 9.1 Secret SharerBlackboard 9.1 Secret Sharer
Blackboard 9.1 Secret Sharerwiljs
 
Syllabi Secrets
Syllabi SecretsSyllabi Secrets
Syllabi Secretswiljs
 
Bite the Bullet(s)
Bite the Bullet(s)Bite the Bullet(s)
Bite the Bullet(s)wiljs
 
Enhance learning with PowerPoint or Everything we know about PowerPoint is wrong
Enhance learning with PowerPoint or Everything we know about PowerPoint is wrongEnhance learning with PowerPoint or Everything we know about PowerPoint is wrong
Enhance learning with PowerPoint or Everything we know about PowerPoint is wrongwiljs
 

More from wiljs (7)

Lms best practices-What is yours?
Lms best practices-What is yours?Lms best practices-What is yours?
Lms best practices-What is yours?
 
CSM Mentor Presentation
CSM Mentor PresentationCSM Mentor Presentation
CSM Mentor Presentation
 
College Faculty Mentor Program
College Faculty Mentor ProgramCollege Faculty Mentor Program
College Faculty Mentor Program
 
Blackboard 9.1 Secret Sharer
Blackboard 9.1 Secret SharerBlackboard 9.1 Secret Sharer
Blackboard 9.1 Secret Sharer
 
Syllabi Secrets
Syllabi SecretsSyllabi Secrets
Syllabi Secrets
 
Bite the Bullet(s)
Bite the Bullet(s)Bite the Bullet(s)
Bite the Bullet(s)
 
Enhance learning with PowerPoint or Everything we know about PowerPoint is wrong
Enhance learning with PowerPoint or Everything we know about PowerPoint is wrongEnhance learning with PowerPoint or Everything we know about PowerPoint is wrong
Enhance learning with PowerPoint or Everything we know about PowerPoint is wrong
 

Recently uploaded

How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17Celine George
 
Education and training program in the hospital APR.pptx
Education and training program in the hospital APR.pptxEducation and training program in the hospital APR.pptx
Education and training program in the hospital APR.pptxraviapr7
 
5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...CaraSkikne1
 
KARNAADA.pptx made by - saransh dwivedi ( SD ) - SHALAKYA TANTRA - ENT - 4...
KARNAADA.pptx  made by -  saransh dwivedi ( SD ) -  SHALAKYA TANTRA - ENT - 4...KARNAADA.pptx  made by -  saransh dwivedi ( SD ) -  SHALAKYA TANTRA - ENT - 4...
KARNAADA.pptx made by - saransh dwivedi ( SD ) - SHALAKYA TANTRA - ENT - 4...M56BOOKSTORE PRODUCT/SERVICE
 
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptxSandy Millin
 
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptxClinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptxraviapr7
 
How to Solve Singleton Error in the Odoo 17
How to Solve Singleton Error in the  Odoo 17How to Solve Singleton Error in the  Odoo 17
How to Solve Singleton Error in the Odoo 17Celine George
 
Slides CapTechTalks Webinar March 2024 Joshua Sinai.pptx
Slides CapTechTalks Webinar March 2024 Joshua Sinai.pptxSlides CapTechTalks Webinar March 2024 Joshua Sinai.pptx
Slides CapTechTalks Webinar March 2024 Joshua Sinai.pptxCapitolTechU
 
How to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesHow to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesCeline George
 
EBUS5423 Data Analytics and Reporting Bl
EBUS5423 Data Analytics and Reporting BlEBUS5423 Data Analytics and Reporting Bl
EBUS5423 Data Analytics and Reporting BlDr. Bruce A. Johnson
 
The basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptxThe basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptxheathfieldcps1
 
ARTICULAR DISC OF TEMPOROMANDIBULAR JOINT
ARTICULAR DISC OF TEMPOROMANDIBULAR JOINTARTICULAR DISC OF TEMPOROMANDIBULAR JOINT
ARTICULAR DISC OF TEMPOROMANDIBULAR JOINTDR. SNEHA NAIR
 
How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17Celine George
 
Over the counter (OTC)- Sale, rational use.pptx
Over the counter (OTC)- Sale, rational use.pptxOver the counter (OTC)- Sale, rational use.pptx
Over the counter (OTC)- Sale, rational use.pptxraviapr7
 
Vani Magazine - Quarterly Magazine of Seshadripuram Educational Trust
Vani Magazine - Quarterly Magazine of Seshadripuram Educational TrustVani Magazine - Quarterly Magazine of Seshadripuram Educational Trust
Vani Magazine - Quarterly Magazine of Seshadripuram Educational TrustSavipriya Raghavendra
 
Department of Health Compounder Question ‍Solution 2022.pdf
Department of Health Compounder Question ‍Solution 2022.pdfDepartment of Health Compounder Question ‍Solution 2022.pdf
Department of Health Compounder Question ‍Solution 2022.pdfMohonDas
 
HED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfHED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfMohonDas
 
Protein Structure - threading Protein modelling pptx
Protein Structure - threading Protein modelling pptxProtein Structure - threading Protein modelling pptx
Protein Structure - threading Protein modelling pptxvidhisharma994099
 
3.21.24 The Origins of Black Power.pptx
3.21.24  The Origins of Black Power.pptx3.21.24  The Origins of Black Power.pptx
3.21.24 The Origins of Black Power.pptxmary850239
 

Recently uploaded (20)

How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17
 
March 2024 Directors Meeting, Division of Student Affairs and Academic Support
March 2024 Directors Meeting, Division of Student Affairs and Academic SupportMarch 2024 Directors Meeting, Division of Student Affairs and Academic Support
March 2024 Directors Meeting, Division of Student Affairs and Academic Support
 
Education and training program in the hospital APR.pptx
Education and training program in the hospital APR.pptxEducation and training program in the hospital APR.pptx
Education and training program in the hospital APR.pptx
 
5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...
 
KARNAADA.pptx made by - saransh dwivedi ( SD ) - SHALAKYA TANTRA - ENT - 4...
KARNAADA.pptx  made by -  saransh dwivedi ( SD ) -  SHALAKYA TANTRA - ENT - 4...KARNAADA.pptx  made by -  saransh dwivedi ( SD ) -  SHALAKYA TANTRA - ENT - 4...
KARNAADA.pptx made by - saransh dwivedi ( SD ) - SHALAKYA TANTRA - ENT - 4...
 
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
 
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptxClinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
 
How to Solve Singleton Error in the Odoo 17
How to Solve Singleton Error in the  Odoo 17How to Solve Singleton Error in the  Odoo 17
How to Solve Singleton Error in the Odoo 17
 
Slides CapTechTalks Webinar March 2024 Joshua Sinai.pptx
Slides CapTechTalks Webinar March 2024 Joshua Sinai.pptxSlides CapTechTalks Webinar March 2024 Joshua Sinai.pptx
Slides CapTechTalks Webinar March 2024 Joshua Sinai.pptx
 
How to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesHow to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 Sales
 
EBUS5423 Data Analytics and Reporting Bl
EBUS5423 Data Analytics and Reporting BlEBUS5423 Data Analytics and Reporting Bl
EBUS5423 Data Analytics and Reporting Bl
 
The basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptxThe basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptx
 
ARTICULAR DISC OF TEMPOROMANDIBULAR JOINT
ARTICULAR DISC OF TEMPOROMANDIBULAR JOINTARTICULAR DISC OF TEMPOROMANDIBULAR JOINT
ARTICULAR DISC OF TEMPOROMANDIBULAR JOINT
 
How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17
 
Over the counter (OTC)- Sale, rational use.pptx
Over the counter (OTC)- Sale, rational use.pptxOver the counter (OTC)- Sale, rational use.pptx
Over the counter (OTC)- Sale, rational use.pptx
 
Vani Magazine - Quarterly Magazine of Seshadripuram Educational Trust
Vani Magazine - Quarterly Magazine of Seshadripuram Educational TrustVani Magazine - Quarterly Magazine of Seshadripuram Educational Trust
Vani Magazine - Quarterly Magazine of Seshadripuram Educational Trust
 
Department of Health Compounder Question ‍Solution 2022.pdf
Department of Health Compounder Question ‍Solution 2022.pdfDepartment of Health Compounder Question ‍Solution 2022.pdf
Department of Health Compounder Question ‍Solution 2022.pdf
 
HED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfHED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdf
 
Protein Structure - threading Protein modelling pptx
Protein Structure - threading Protein modelling pptxProtein Structure - threading Protein modelling pptx
Protein Structure - threading Protein modelling pptx
 
3.21.24 The Origins of Black Power.pptx
3.21.24  The Origins of Black Power.pptx3.21.24  The Origins of Black Power.pptx
3.21.24 The Origins of Black Power.pptx
 

Access Database Library Assignment

Editor's Notes

  1. The first 3 questions are asked from the book table looking at the customer table. Here the answer is yes. You could have a new book for example.
  2. Yes to this question.
  3. Again yes to this question.
  4. this side of the relationship is many and now we have to see what the other side of the relationship is.
  5. The next 3 questions are asked from the customer table looking at the book table. Here the answer is yes.
  6. Again yes!
  7. And yes again.
  8. Since a book could be checked out by more than one customer.
  9. If this database only had 3 tables then there would have to be another entry for each book each customer checked out. We can do better than that!
  10. So instead of a bridge table we will create a checkout table and bring the customer primary key over as the foreign key and also include a Date_Checked_Out field. To reduce errors and to save time we will have Access enter a default time of today for this field.What would be a good primary key for this table?
  11. This is a bridge or junction table so we need both primary keys of the 2 tables in the many to many relationship to serve as foreign keys and here they both can be the primary key. We can never use just one of these two foreign keys as the primary key. And sometimes there are good reasons not to use both foreign keys as the primary key. But here we can totally eliminate errors like accidently entering the same book two times by using both foreign keys as the primary key.