Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CREATE TABLE person ( person _ id SMALLINT UNSIGNED PRIMARY KEY, first _ name VARCHAR ( 2 0 ) , last _ name VARCHAR (

CREATE TABLE person (
person_id SMALLINT UNSIGNED PRIMARY KEY,
first_name VARCHAR(20),
last_name VARCHAR(20),
email VARCHAR(20),
active VARCHAR(20),
last_update TIMESTAMP,
address_id SMALLINT UNSIGNED,
FOREIGN KEY (address_id) REFERENCES address(address_id) ON DELETE RESTRICT ON UPDATE RESTRICT
);
CREATE TABLE staff (
person_id SMALLINT UNSIGNED PRIMARY KEY,
picture BLOB,
username VARCHAR(20),
password VARCHAR(20),
store_id TINYINT UNSIGNED,
FOREIGN KEY (person_id) REFERENCES person(person_id) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (store_id) REFERENCES store(store_id) ON DELETE RESTRICT ON UPDATE RESTRICT
);
CREATE TABLE customer (
person_id SMALLINT UNSIGNED PRIMARY KEY,
create_date TIMESTAMP,
FOREIGN KEY (person_id) REFERENCES person(person_id) ON DELETE CASCADE ON UPDATE CASCADE
);

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

Oracle 11G SQL

Authors: Joan Casteel

2nd Edition

1133947360, 978-1133947363

Students also viewed these Databases questions

Question

What are the approaches to global staffing?

Answered: 1 week ago