Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with the ERD diagram for the following tables in database, as well as the SQL/PHP code written in java if at all

I need help with the ERD diagram for the following tables in database, as well as the SQL/PHP code written in java if at all possible. It is all one program for a video game rental assigment. thank you so much

Transaction 1:

Id:12345 Title:Destiny GameID:123 Date_rented:04/16/17 Date_due:04/23/17 Cost:$4.99

insert into customer(customerID) values('12345'); insert into rental values('04/16/17', '04/23/17', '4.99', '123'); insert into game(Title, Cost, gameID) values('Destiny', '4.99', '123'); insert into payment(Amount) values('4.99');

Transaction 2:

Id:13579 Title:Horizon Zero Dawn GameID:345 Date_rented:05/05/17 Date_due:05/12/17 Cost:$9.99

insert into customer(customerID) values('13579'); insert into rental values('05/05/17', '05/12/17', '9.99', '345'); insert into game(Title, Cost, gameID) values('Horizon Zero Dawn', '9.99', '345'); insert into payment(Amount) values('9.99');

Transaction 3:

Id:24680 Title:Minecraft GameID:420 Date_rented:03/15/17 Date_due:03/22/17 Cost:$3.99

insert into customer(customerID) values('24680'); insert into rental values('03/15/17', '03/22/17', '3.99', '420'); insert into game(Title, Cost, gameID) values('Minecraft', '3.99', '420'); insert into payment(Amount) values('3.99');

Transaction 4:

Id:56789 Title:Halo 5 GameID:896 Date_rented:08/10/17 Date_due:08/17/17 Cost:$7.99

insert into customer(customerID) values('56789'); insert into rental values('08/10/17', '08/17/17', '7.99', '896'); insert into game(Title, Cost, gameID) values('Halo 5', '7.99', '896'); insert into payment(Amount) values('7.99');

Transaction 5:

Id:89067 Title:Resident Evil 7 GameID:687 Date_rented:09/12/17 Date_due:09/19/17 Cost:$10.99

insert into customer(customerID) values('89067'); insert into rental values('09/12/17', '09/19/17', '10.99', '687'); insert into game(Title, Cost, gameID) values('Resident Evil 7', '10.99', '687'); insert into payment(Amount) values('10.99');

CREATE TABLE customer (FName varchar(255) default null, LName varchar(255) default null, Address varchar(255) default null, Phone numeric(20,0) default 0, DOB varchar(255) default null, customerID numeric(20,0) default 0 Primary Key);

CREATE TABLE rental (Date_rented varchar(255) default null, Date_due varchar(255) default null, Customer_id numeric(20,0) default 0 Foreign Key references customerID, Game_id numeric(20,0) default 0 Foreign Key references gameID);

CREATE TABLE game (Title varchar(255) default null, Rating varchar(255) default null, Cost numeric(20,0) default 0 Foreign Key references references Amount, gameID numeric(20,0) default 0 Primary Key);

CREATE TABLE payment (payment_type varchar(255) default null, transaction_id numeric(20,0) default 0, Amount numeric(20,0) default 0 Primary Key);

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

3rd Edition

0071107010, 978-0071107013

More Books

Students also viewed these Databases questions

Question

4. Schedule individual conferences with students.

Answered: 1 week ago