DATABASE DESIGN II IST 210: Organization of Data IST210 1.

Slides:



Advertisements
Similar presentations
ER Model For a college DB
Advertisements

More Diagramming & Practice with Relationship Modeling
Data Modeling. What are you keeping track of? You begin to develop a database by deciding what you are going to keep track of. Each thing that you are.
Database Lecture Notes Mapping ER Diagrams to Tables 2 Dr. Meg Murray
Lab Exercise This Week PHP Basics See last Friday’s slides for requirements Make sure you show the final results to TA to get credit 1IST210.
Data Modeling and Entity- Relationship Model II. IST2102 I want a database to maintain departments in my company. Store information about my employees,
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 David M. Kroenke Database Processing Chapter 6 Transforming Data.
SQL in Access S511. Create Table Schema CREATE TABLE student ( student_id INTEGER NOT NULL, name CHAR(25), major CHAR(10), gpa INTEGER, CONSTRAINT index1.
The (min,max) notation (1,1) (0,1) (1,N) (1,1). SUMMARY OF ER-DIAGRAM NOTATION FOR ER SCHEMAS Meaning ENTITY TYPE WEAK ENTITY TYPE RELATIONSHIP TYPE IDENTIFYING.
Case study Lisa’s Bookstore IST210.
Data Modeling and Entity- Relationship Model I IST2101.
COURSE REGISTRATION SYSTEM Case study IST2101. Case Study: Course Registration (1) IST2102 You are helping Penn State create a course registration system.
CHAPTER 2. FUNDAMENTAL OF ENTITY RELATIONSHIP (ER)
Chapter Six Professor Adams’ Slides. Note that entities are shadowed, tables are not. Note that entities have no physical existence (blueprint) Note.
DATABASE DESIGN I IST 210: Organization of Data IST210 1.
Database Design II (Case Studies: Step 2) IST 210: Organization of Data IST2101.
IST 210: ORGANIZATION OF DATA Chapter 1. Getting Started IST210 1.
Normalization Process: Exercise 1: Step 1 IST2101 Step 1. Identify all the candidate keys of the relation. StudentNumber.
SQL 101 for Web Developers 14 November What is a database and why have one? Tables, relationships, normalization SQL – What SQL is and isn’t – CRUD:
Entity-Relationship Model. Entity-Relationship Mode What is it? What is it? –Technique for developing an informal organization of tables How does it work?
Chapter 2. The Relational Model IST2101. Chapter 1 Review Potential problems with Lists – Deletion – Update – Insertion Avoid these problems using a relational.
Relational Database. Database Management System (DBMS)
Constraints - primary and foreign keys in Oracle Please use speaker notes for additional information!
IE 423 – Design of Decision Support Systems Data modeling and database development.
How to make flyers with Microsoft Publisher Step one: Open Microsoft Word and start publisher.
1 Translating ER Schema to Relational Model Instructor: Mohamed Eltabakh
Chapter 2. The Relational Model (cont.)
THE RELATIONAL MODEL II IST 210: Organization of Data IST210 1.
Database Design I (In-Class Exercise Answer) IST 210: Organization of Data IST2101.
THE RELATIONAL MODEL I IST 210: Organization of Data IST210 1.
Double click here to add event title Double click here to add event date Double click here to add event time Double click here to add event location.
* Database is a group of related objects * Objects can be Tables, Forms, Queries or Reports * All data reside in Tables * A Row in a Table is a record.
Database Design. Database Design Process Data Model Requirements Application 1 Database Requirements Application 2 Requirements Application 4 Requirements.
Howard Paul. Sequential Access Index Files and Data File Random Access.
IST 220 – Intro to DB Lecture 4 Database Design thru ER Modeling.
IE 423 – Design of Decision Support Systems Data modeling and database development.
Data Modeling and Entity-Relationship Model I
Database Design I IST 210: Organization of Data IST2101.
Information System Design “Student Registration System Example”
Chapter 1. Getting Started IST 210: Organization of Data IST2101.
DATA MODELING AND ENTITY-RELATIONSHIP MODEL II IST 210: Organization of Data IST210 1.
Database Design I (In-Class Exercise Answer) IST 210: Organization of Data IST2101.
Translating ER Schema to Relational Model
Week 03 – ER Diagram INFOSYS 222.
Order Database – ER Diagram
MySQL S511.
Translating ER into Relations; Normalization
E-R Diagram (Cont.) Draw ER Diagram for the following scenario:
IST 210: Organization of Data
CSIS 115 Database Design and Applications for Business
Chapter 5 STUDENT-COURSE
INFO/CSE 100, Spring 2005 Fluency in Information Technology
Entity relationship diagrams
Database Processing: David M. Kroenke’s Chapter Six:
Premier’s Reading Challenge INDONESIAN Competition 2017
Date, location, department
Date, location, department
Databases.
COMP 430 Intro. to Database Systems
MySQL.
Department | Website | Phone Number
MySQL S511.
MIS2502: Data Analytics Relational Data Modeling
ASP.NET Relationships between tables
A Very Brief Introduction to Relational Databases
Database Processing: David M. Kroenke’s Chapter Six:
Name of Event Name of Event Date, location, department
Database Processing: David M. Kroenke’s Chapter Six:
Conceptual modeling of databases
NAME OF EVENT Name of Speaker Date, location, department
Presentation transcript:

DATABASE DESIGN II IST 210: Organization of Data IST210 1

Previously IST210 2 EMPLOYEE(EmployeeID, Name, OfficeNumber, OfficePhone, LockerID) LOCKER(LockerID, LockerRoom, LockerSize) EMPLOYEE(EmployeeID, Name, OfficeNumber, OfficePhone) LOCKER(LockerID, LockerRoom, LockerSize, EmployeeID) N:M  add an intersection table EMPLOYEE(EmployeeID, Name, OfficeNumber, OfficePhone) LOCKER(LockerID, LockerRoom, LockerSize) ASSIGNMENT(EmployeeID, LockerID) EMPLOYEE(EmployeeID, Name, OfficeNumber, OfficePhone) LOCKER(LockerID, LockerRoom, LockerSize, EmployeeID) 1:N  add a foreign key to the many-side table 1:1  add a foreign key to either table or

Previously: Exercise 3 IST210 3 Transform this diagram into tables STUDENT(StudentID, StudentName, ) COURSE(CourseID, CourseName, Instructor) REGISTRATION(StudentID, CourseID)

IST210 4 STUDENT(StudentID, StudentName, ) COURSE(CourseID, CourseName, Instructor) REGISTRATION(StudentID, CourseID) STUDENT table Column Name Data TypeKeyRequiredRemarks CourseID CourseName Instructor COURSE table Column Name Data Type KeyRequiredRemarks StudentID StudentName Column Name Data Type KeyRequiredRemarks StudentID CourseID REGISTRATION table In-class Exercise 3

IST210 5 STUDENT(StudentID, StudentName, ) COURSE(CourseID, CourseName, Instructor) REGISTRATION(StudentID, CourseID) STUDENT table Column Name Data TypeKeyRequiredRemarks CourseIDChar(20)Primary key YesFormat: DepartmentName + CourseNumber CourseNameChar(50)Yes InstructorChar(100)No COURSE table Column Name Data TypeKeyRequiredRemarks StudentIDintPrimary key YesSurrogate key: initial value = 1 Increment = 1 StudentNameChar(100)Yes Char(50)No Column Name Data Type KeyRequiredRemarks StudentIDintPrimary key, foreign keyYesReference: STUDENT CourseIDChar(20)Primary key, foreign keyYesReference: COURSE REGISTRATION table

IST210 6 STUDENT table Column Name Data TypeKeyRequiredRemarks CourseIDChar(20)Primary key YesFormat: DepartmentName + CourseNumber CourseNameChar(50)Yes InstructorChar(100)No COURSE table Column Name Data Type KeyRequiredRemarks StudentIDintPrimary key YesSurrogate key: initial value = 1 Increment = 1 StudentNameChar(100)Yes Char(50)No Column Name Data Type KeyRequiredRemarks StudentIDintPrimary key, foreign keyYesReference: STUDENT CourseIDChar(20)Primary key, foreign keyYesReference: COURSE REGISTRATION table Notes: A CourseID should not be integer, for example, “IST210” is a courseID. CourseName for IST210 is “Organization of the data”.

COURSE REGISTRATION SYSTEM Case study IST210 7

8 StudentID Name STUDENT StudentID CourseID Grade GRADE DepartName Building Phone DEPARTMENT CourseID CourseName Instructor COURSE Complete E-R Diagram

IST210 9 StudentID Name STUDENT DepartName Building Phone DEPARTMENT CourseID CourseName Instructor COURSE

IST STUDENT(StudentID, Name, , DepartName) DEPARTMENT(DepartName, Building, Phone) COURSE(CourseID, CourseName, Instructor, DepartName) Primary key: use underline Foreign key: italic font (I use red color here to emphasize the foreign key. You don’t need to make it a different color in the assignment.) StudentID Name STUDENT DepartName Building Phone DEPARTMENT CourseID CourseName Instructor COURSE

IST StudentID Name STUDENT StudentID CourseID Grade GRADE CourseID CourseName Instructor COURSE STUDENT(StudentID, Name, , DepartName) DEPARTMENT(DepartName, Building, Phone) COURSE(CourseID, CourseName, Instructor, DepartName)

IST STUDENT(StudentID, Name, , DepartName) DEPARTMENT(DepartName, Building, Phone) COURSE(CourseID, CourseName, Instructor, DepartName) GRADE(StudentID, CourseID, Grade) StudentID Name STUDENT StudentID CourseID Grade GRADE CourseID CourseName Instructor COURSE

IST STUDENT(StudentID, Name, , DepartName) DEPARTMENT(DepartName, Building, Phone) COURSE(CourseID, CourseName, Instructor, DepartName) GRADE(StudentID, CourseID, Grade)

IST STUDENT(StudentID, Name, , DepartName) DEPARTMENT(DepartName, Building, Phone) COURSE(CourseID, CourseName, Instructor, DepartName) GRADE(StudentID, CourseID, Grade) Column NameData TypeKeyRequiredRemarks DepartName Building Phone DEPARTMENT We start with the table without a foreign key. STUDENT and COURSE need to know DepartName type. GRADE need to know StudentID and CourseID type. So we should first specify DEPARTMENT table, then STUDENT and COURSE, and finally GRADE table.

IST Column NameData TypeKeyRequire d Remarks DepartNameChar(50)Primary keyYes BuildingChar(100)Yes PhoneChar(12)NoFormat: ###-###- #### DEPARTMENT We start with the table without a foreign key. STUDENT and COURSE need to know DepartName type. GRADE need to know StudentID and CourseID type. So we should first specify DEPARTMENT table, then STUDENT and COURSE, and finally GRADE table. STUDENT(StudentID, Name, , DepartName) DEPARTMENT(DepartName, Building, Phone) COURSE(CourseID, CourseName, Instructor, DepartName) GRADE(StudentID, CourseID, Grade)

IST Column Name Data Type KeyRequire d Remarks StudentID Name DepartName STUDENT STUDENT(StudentID, Name, , DepartName) DEPARTMENT(DepartName, Building, Phone) COURSE(CourseID, CourseName, Instructor, DepartName) GRADE(StudentID, CourseID, Grade)

IST Column Name Data Type KeyRequire d Remarks StudentIDintPrimary key yesSurrogate key: initial value = 1, increment = 1 NameChar(100)yes Char(100)no DepartNameChar(50)Foreign key yesReference: DEPARTMENT STUDENT Must be the same as data type in DEPARTMENT Determined by the minimum cardinality STUDENT(StudentID, Name, , DepartName) DEPARTMENT(DepartName, Building, Phone) COURSE(CourseID, CourseName, Instructor, DepartName) GRADE(StudentID, CourseID, Grade)

IST Column Name Data Type KeyRequire d Remarks CourseID CourseName Instructor DepartName COURSE STUDENT(StudentID, Name, , DepartName) DEPARTMENT(DepartName, Building, Phone) COURSE(CourseID, CourseName, Instructor, DepartName) GRADE(StudentID, CourseID, Grade)

IST Column Name Data Type KeyRequire d Remarks CourseIDChar(10)Primary key yesFormat: Department name + number CourseNameChar(100)yes InstructorChar(100)no DepartNameChar(50)Foreign key yesReference: DEPARTMENT COURSE Must be the same as data type in DEPARTMENT Determined by the minimum cardinality STUDENT(StudentID, Name, , DepartName) DEPARTMENT(DepartName, Building, Phone) COURSE(CourseID, CourseName, Instructor, DepartName) GRADE(StudentID, CourseID, Grade)

IST Column Name Data Type KeyRequiredRemarks StudentID CourseID Grade GRADE STUDENT(StudentID, Name, , DepartName) DEPARTMENT(DepartName, Building, Phone) COURSE(CourseID, CourseName, Instructor, DepartName) GRADE(StudentID, CourseID, Grade)

IST STUDENT(StudentID, Name, , DepartName) DEPARTMENT(DepartName, Building, Phone) COURSE(CourseID, CourseName, Instructor, DepartName) GRADE(StudentID, CourseID, Grade) Column Name Data Type KeyRequiredRemarks StudentIDIntPrimary key, foreign key yesReference: STUDENT CourseIDChar(10)Primary key, foreign key yesReference: COURSE GradeChar(2)no GRADE Must be the same as data type in STUDENT and COURSE Remarks here should be the reference tables, not the surrogate key

LISA’S BOOKSTORE Case study IST210 22

IST BookID Title Year BOOK PurchaseID Price Date PURCHASE AuthorID Name Country PublisherName Location Phone AUTHOR PUBLISHER Address Name Address Phone CUSTOMER EventID Name Date Type EVENT Complete E-R Diagram

IST BookID Title Year BOOK AuthorID Name Country PublisherName Location Phone AUTHOR PUBLISHER

IST PUBLISHER(PublisherName, Location, Phone) BOOK(BookID, Title, Year, PublisherName) AUTHOR(AuthorID, Name, Country) BOOK_AUTHOR(BookID, AuthorID) BookID Title Year BOOK AuthorID Name Country AUTHOR PublisherName Location Phone PUBLISHER

IST BookID Title Year BOOK PurchaseID Price Date PURCHASE Address Name Address Phone CUSTOMER PUBLISHER(PublisherName, Location, Phone) BOOK(BookID, Title, Year, PublisherName) AUTHOR(AuthorID, Name, Country) BOOK_AUTHOR(BookID, AuthorID)

IST PUBLISHER(PublisherName, Location, Phone) BOOK(BookID, Title, Year, PublisherName) AUTHOR(AuthorID, Name, Country) BOOK_AUTHOR(BookID, AuthorID) PURCHASE(PurchaseID, Price, Date, BookID, Address) CUSTOMER( Address, Name, Address, Phone) BookID Title Year BOOK PurchaseID Price Date PURCHASE Address Name Address Phone CUSTOMER

IST Address Name Address Phone CUSTOME R EventID Name Date Type EVENT PUBLISHER(PublisherName, Location, Phone) BOOK(BookID, Title, Year, PublisherName) AUTHOR(AuthorID, Name, Country) BOOK_AUTHOR(BookID, AuthorID) PURCHASE(PurchaseID, Price, Date, BookID, Address) CUSTOMER( Address, Name, Address, Phone)

IST Address Name Address Phone CUSTOMER EventID Name Date Type EVENT PUBLISHER(PublisherName, Location, Phone) BOOK(BookID, Title, Year, PublisherName) AUTHOR(AuthorID, Name, Country) BOOK_AUTHOR(BookID, AuthorID) PURCHASE(PurchaseID, Price, Date, BookID, Address) CUSTOMER( Address, Name, Address, Phone) EVENT(EventID, Name, Date, Type) CUSTOMER_EVENT( Address, EventID)

IST PUBLISHER(PublisherName, Location, Phone) BOOK(BookID, Title, Year, PublisherName) AUTHOR(AuthorID, Name, Country) BOOK_AUTHOR(BookID, AuthorID) PURCHASE(PurchaseID, Price, Date, BookID, Address) CUSTOMER( Address, Name, Address, Phone) EVENT(EventID, Name, Date, Type) CUSTOMER_EVENT( Address, EventID) E-R diagram is transformed into a database with 8 tables

IST PUBLISHER(PublisherName, Location, Phone) BOOK(BookID, Title, Year, PublisherName) AUTHOR(AuthorID, Name, Country) BOOK_AUTHOR(BookID, AuthorID) PURCHASE(PurchaseID, Price, Date, BookID, Address) CUSTOMER( Address, Name, Address, Phone) EVENT(EventID, Name, Date, Type) CUSTOMER_EVENT( Address, EventID) Column NameData TypeKeyRequire d Remarks PublisherName Location Phone PUBLISHER

IST PUBLISHER(PublisherName, Location, Phone) BOOK(BookID, Title, Year, PublisherName) AUTHOR(AuthorID, Name, Country) BOOK_AUTHOR(BookID, AuthorID) PURCHASE(PurchaseID, Price, Date, BookID, Address) CUSTOMER( Address, Name, Address, Phone) EVENT(EventID, Name, Date, Type) CUSTOMER_EVENT( Address, EventID) Column NameData TypeKeyRequiredRemarks PublisherNameChar(50)Primary keyYes LocationChar(100)No PhoneChar(12)NoFormat: ###-###- #### PUBLISHER

IST PUBLISHER(PublisherName, Location, Phone) BOOK(BookID, Title, Year, PublisherName) AUTHOR(AuthorID, Name, Country) BOOK_AUTHOR(BookID, AuthorID) PURCHASE(PurchaseID, Price, Date, BookID, Address) CUSTOMER( Address, Name, Address, Phone) EVENT(EventID, Name, Date, Type) CUSTOMER_EVENT( Address, EventID) Column NameData TypeKeyRequiredRemarks BookID Title Year PublisherName BOOK

IST PUBLISHER(PublisherName, Location, Phone) BOOK(BookID, Title, Year, PublisherName) AUTHOR(AuthorID, Name, Country) BOOK_AUTHOR(BookID, AuthorID) PURCHASE(PurchaseID, Price, Date, BookID, Address) CUSTOMER( Address, Name, Address, Phone) EVENT(EventID, Name, Date, Type) CUSTOMER_EVENT( Address, EventID) Column NameData TypeKeyRequiredRemarks BookIDintPrimary key YesSurrogate key, initial value = 1, increment =1 TitleChar(100)Yes YearChar(4)No PublisherNameChar(50)Foreign key YesReference: PUBLISHER BOOK

IST PUBLISHER(PublisherName, Location, Phone) BOOK(BookID, Title, Year, PublisherName) AUTHOR(AuthorID, Name, Country) BOOK_AUTHOR(BookID, AuthorID) PURCHASE(PurchaseID, Price, Date, BookID, Address) CUSTOMER( Address, Name, Address, Phone) EVENT(EventID, Name, Date, Type) CUSTOMER_EVENT( Address, EventID) Column NameData TypeKeyRequiredRemarks AuthorID Name Country AUTHOR

IST PUBLISHER(PublisherName, Location, Phone) BOOK(BookID, Title, Year, PublisherName) AUTHOR(AuthorID, Name, Country) BOOK_AUTHOR(BookID, AuthorID) PURCHASE(PurchaseID, Price, Date, BookID, Address) CUSTOMER( Address, Name, Address, Phone) EVENT(EventID, Name, Date, Type) CUSTOMER_EVENT( Address, EventID) Column NameData TypeKeyRequiredRemarks AuthorIDintPrimary key YesSurrogate key, initial value = 1, increment =1 NameChar(100)Yes CountryChar(20)No AUTHOR

IST PUBLISHER(PublisherName, Location, Phone) BOOK(BookID, Title, Year, PublisherName) AUTHOR(AuthorID, Name, Country) BOOK_AUTHOR(BookID, AuthorID) PURCHASE(PurchaseID, Price, Date, BookID, Address) CUSTOMER( Address, Name, Address, Phone) EVENT(EventID, Name, Date, Type) CUSTOMER_EVENT( Address, EventID) Column NameData TypeKeyRequiredRemarks BookID AuthorID BOOK_AUTHOR

IST PUBLISHER(PublisherName, Location, Phone) BOOK(BookID, Title, Year, PublisherName) AUTHOR(AuthorID, Name, Country) BOOK_AUTHOR(BookID, AuthorID) PURCHASE(PurchaseID, Price, Date, BookID, Address) CUSTOMER( Address, Name, Address, Phone) EVENT(EventID, Name, Date, Type) CUSTOMER_EVENT( Address, EventID) Column NameData TypeKeyRequiredRemarks BookIDintPrimary key, foreign key YesReference: BOOK AuthorIDintPrimary key, foreign key YesReference: AUTHOR BOOK_AUTHOR

IST PUBLISHER(PublisherName, Location, Phone) BOOK(BookID, Title, Year, PublisherName) AUTHOR(AuthorID, Name, Country) BOOK_AUTHOR(BookID, AuthorID) PURCHASE(PurchaseID, Price, Date, BookID, Address) CUSTOMER( Address, Name, Address, Phone) EVENT(EventID, Name, Date, Type) CUSTOMER_EVENT( Address, EventID) Column NameData TypeKeyRequiredRemarks Address Name Address Phone CUSTOMER

IST PUBLISHER(PublisherName, Location, Phone) BOOK(BookID, Title, Year, PublisherName) AUTHOR(AuthorID, Name, Country) BOOK_AUTHOR(BookID, AuthorID) PURCHASE(PurchaseID, Price, Date, BookID, Address) CUSTOMER( Address, Name, Address, Phone) EVENT(EventID, Name, Date, Type) CUSTOMER_EVENT( Address, EventID) Column NameData TypeKeyRequiredRemarks AddressChar(50)Primary key Yes NameChar(50)Yes AddressChar(100)No PhoneChar(12)NoFormat: ###-###- #### CUSTOMER

IST PUBLISHER(PublisherName, Location, Phone) BOOK(BookID, Title, Year, PublisherName) AUTHOR(AuthorID, Name, Country) BOOK_AUTHOR(BookID, AuthorID) PURCHASE(PurchaseID, Price, Date, BookID, Address) CUSTOMER( Address, Name, Address, Phone) EVENT(EventID, Name, Date, Type) CUSTOMER_EVENT( Address, EventID) Column NameData TypeKeyRequiredRemarks PurchaseID Price Date BookID Address PURCHASE

IST PUBLISHER(PublisherName, Location, Phone) BOOK(BookID, Title, Year, PublisherName) AUTHOR(AuthorID, Name, Country) BOOK_AUTHOR(BookID, AuthorID) PURCHASE(PurchaseID, Price, Date, BookID, Address) CUSTOMER( Address, Name, Address, Phone) EVENT(EventID, Name, Date, Type) CUSTOMER_EVENT( Address, EventID) Column NameData TypeKeyRequiredRemarks PurchaseIDintPrimary key YesSurrogate key: initial value = 1, increment = 1 PricefloatYes DateDateTimeYes BookIDintForeign key YesReference: BOOK AddressChar(50)Foreign key YesReference: CUSTOMER PURCHASE

IST PUBLISHER(PublisherName, Location, Phone) BOOK(BookID, Title, Year, PublisherName) AUTHOR(AuthorID, Name, Country) BOOK_AUTHOR(BookID, AuthorID) PURCHASE(PurchaseID, Price, Date, BookID, Address) CUSTOMER( Address, Name, Address, Phone) EVENT(EventID, Name, Date, Type) CUSTOMER_EVENT( Address, EventID) Column NameData TypeKeyRequiredRemarks EventID Name Date Type EVENT

IST PUBLISHER(PublisherName, Location, Phone) BOOK(BookID, Title, Year, PublisherName) AUTHOR(AuthorID, Name, Country) BOOK_AUTHOR(BookID, AuthorID) PURCHASE(PurchaseID, Price, Date, BookID, Address) CUSTOMER( Address, Name, Address, Phone) EVENT(EventID, Name, Date, Type) CUSTOMER_EVENT( Address, EventID) Column NameData TypeKeyRequiredRemarks EventIDintPrimary key YesSurrogate key: initial value = 1, increment = 1 NameChar(50)Yes DateDateTimeNo TypeChar(20)No EVENT

IST PUBLISHER(PublisherName, Location, Phone) BOOK(BookID, Title, Year, PublisherName) AUTHOR(AuthorID, Name, Country) BOOK_AUTHOR(BookID, AuthorID) PURCHASE(PurchaseID, Price, Date, BookID, Address) CUSTOMER( Address, Name, Address, Phone) EVENT(EventID, Name, Date, Type) CUSTOMER_EVENT( Address, EventID) Column NameData TypeKeyRequiredRemarks Address EventID CUSTOMER_EVENT

IST PUBLISHER(PublisherName, Location, Phone) BOOK(BookID, Title, Year, PublisherName) AUTHOR(AuthorID, Name, Country) BOOK_AUTHOR(BookID, AuthorID) PURCHASE(PurchaseID, Price, Date, BookID, Address) CUSTOMER( Address, Name, Address, Phone) EVENT(EventID, Name, Date, Type) CUSTOMER_EVENT( Address, EventID) Column NameData TypeKeyRequiredRemarks AddressChar(50)Primary key, foreign key YesReference: CUSTOMER EventIDintPrimary key, foreign key YesReference: EVENT CUSTOMER_EVENT