Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

With the details below, draw an ERD: CREATE TABLE warehouse ( id serial PRIMARY KEY, name VARCHAR (255) NOT NULL, address

With the details below, draw an ERD:

 

CREATE TABLE warehouse (
   id serial PRIMARY KEY,
   name VARCHAR (255) NOT NULL,
   address VARCHAR (255) NOT NULL,
   capacity INTEGER NOT NULL,
   occupied INTEGER NOT NULL,
   loading_bays INTEGER NOT NULL,
   access_points INTEGER NOT NULL,
   description VARCHAR (255)
);

CREATE TABLE employee (
   id serial PRIMARY KEY,
   first_name VARCHAR (255) NOT NULL,
   last_name VARCHAR (255) NOT NULL,
   contact_phone VARCHAR (255) NOT NULL,
   contact_email VARCHAR (255) NOT NULL,
   start_date DATE NOT NULL,
   termination_date DATE,
   driver_licence_number VARCHAR (255) NOT NULL,
   driver_licence_expiry_date DATE NOT NULL
);

CREATE TABLE vehicle (
   id serial PRIMARY KEY,
   registration_number VARCHAR (255) NOT NULL,
   type VARCHAR (255) NOT NULL,
   seating_capacity INTEGER NOT NULL,
   carrying_capacity INTEGER NOT NULL,
   load_space INTEGER NOT NULL,
   maximum_load_area_height INTEGER NOT NULL,
   maximum_load_area_width INTEGER NOT NULL,
   maximum_load_area_depth INTEGER NOT NULL,
   status VARCHAR (255) NOT NULL
);

CREATE TABLE customer (
   id serial PRIMARY KEY,
   first_name VARCHAR (255) NOT NULL,
   last_name VARCHAR (255) NOT NULL,
   phone VARCHAR (255) NOT NULL,
   email VARCHAR (255) NOT NULL,
   address VARCHAR (255) NOT NULL
);

CREATE TABLE invoice (
   id serial PRIMARY KEY,
   date DATE NOT NULL,
   customer_id INTEGER REFERENCES customer (id),
   payment_status BOOLEAN NOT NULL
);

CREATE TABLE line_item (
   id serial PRIMARY KEY,
   invoice_id INTEGER REFERENCES invoice (id),
   product_id INTEGER REFERENCES product (id),
   product_description VARCHAR (255) NOT NULL,
   sold_price DECIMAL NOT NULL
);

CREATE TABLE product (
   id serial PRIMARY KEY,
   type_code VARCHAR (255) NOT NULL,
   unpacked_dimensions VARCHAR (255) NOT NULL,
   packed_dimensions VARCHAR (255) NOT NULL,
   unpacked_weight DECIMAL NOT NULL,
   packed_weight DECIMAL NOT NULL
);

CREATE TABLE delivery_request (
   id serial PRIMARY KEY,
   request_date DATE NOT NULL,
   requested_delivery_date DATE NOT NULL,
   actual_delivery_date DATE,
   delivery_address VARCHAR (255) NOT NULL,
   contact_name VARCHAR (255) NOT NULL,
   contact_phone_number

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions

Question

Describe the Hay guide chart-profile method of job evaluation.

Answered: 1 week ago

Question

=+b) Obtain a forecast for the week of May 28, 2007.

Answered: 1 week ago

Question

A clubs general manager performs what types of duties? AppendixLO1

Answered: 1 week ago