Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have a database of a courier moving company. the mySql code for it is CREATE TABLE Customer ( customer _ id INT PRIMARY KEY,

I have a database of a courier moving company. the mySql code for it is
CREATE TABLE Customer (
customer_id INT PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50),
contact VARCHAR(20),
address VARCHAR(100),
email VARCHAR(100)
);
CREATE TABLE Driver (
driver_id INT PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50),
contact VARCHAR(20),
address VARCHAR(100),
rating FLOAT
);
CREATE TABLE Job (
job_id INT PRIMARY KEY,
customer_id INT,
pick_up VARCHAR(100),
drop_off VARCHAR(100),
vehicle_preference VARCHAR(50),
FOREIGN KEY (customer_id) REFERENCES Customer(customer_id)
);
CREATE TABLE Bidding (
bid_id INT PRIMARY KEY,
job_id INT,
driver_id INT,
fare DECIMAL(10,2),
status VARCHAR(20),
FOREIGN KEY (job_id) REFERENCES Job(job_id),
FOREIGN KEY (driver_id) REFERENCES Driver(driver_id)
);
CREATE TABLE Active_Job (
job_id INT PRIMARY KEY,
FOREIGN KEY (job_id) REFERENCES Job(job_id)
);
CREATE TABLE Assigned_Job (
job_id INT PRIMARY KEY,
driver_id INT,
FOREIGN KEY (job_id) REFERENCES Active_Job(job_id),
FOREIGN KEY (driver_id) REFERENCES Driver(driver_id)
);
CREATE TABLE Past_Trip (
job_id INT PRIMARY KEY,
status VARCHAR(20),
time_appointed DATETIME,
time_completed DATETIME,
FOREIGN KEY (job_id) REFERENCES Active_Job(job_id)
);
according to the code, what would be the ERD of the database and GRD of the database. please give graphical representation of ERD and GRD.

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

Students also viewed these Databases questions

Question

What are some areas of gender-role strain for men and women today?

Answered: 1 week ago