Task: Database Revision
Legacy System: LAMP (MySql v5.5)
Current System: Node Express MySql v8.023
- Task: Database Revision
- Legacy System: LAMP (MySql v5.5)
- Current System: Node Express MySql
v8.023
Not sure if current configuration would be considered a staging envenvironmentenvironment and how to determine best practices to enhance to a production environment?
CREATE TABLE table_1 (
strno INT NULL,
strfrac VARCHAR(255) NULL,
strdir VARCHAR(255) NULL,
strname VARCHAR(255) NULL,
strtype VARCHAR(255) NULL,
strunit VARCHAR(255) NULL,
city VARCHAR(255) NULL
CREATE TABLE table_1 (
strno INT NULL,
strfrac VARCHAR(255) NULL,
strdir VARCHAR(255) NULL,
strname VARCHAR(255) NULL,
strtype VARCHAR(255) NULL,
strunit VARCHAR(255) NULL,
city VARCHAR(255) NULL
strdir
strtype
city
strdir strtype city
For these 3 columns 3 separate tables have been created to include:
Code for all possible values in table_1;
Translated name for display to User;
Description for display to User;
- Code for all possible values in table_1;
- Translated name for display to User;
- Description for display to User;
table strdirs records
'N','North','North is a valid direction'
'S','South','South is a valid direction'
'E','East','East is a valid direction'
'W','West','West is a valid direction'
'NE','Northeast','Northeast is a valid direction'
'NW','Northwest','Northwest is a valid direction'
'SE','Southeast','Southeast is a valid direction'
'SW','Southwest','Southwest is a valid direction'
'N','North','North is a valid direction'
'S','South','South is a valid direction'
'E','East','East is a valid direction'
'W','West','West is a valid direction'
'NE','Northeast','Northeast is a valid direction'
'NW','Northwest','Northwest is a valid direction'
'SE','Southeast','Southeast is a valid direction'
'SW','Southwest','Southwest is a valid direction'
table strtypes records
'ALLY','Alley','An Alley is a valid street type for a location address'
'ANX','Annex','An Annex is a valid street type for a location address'
'AVE','Avenue','An Avenue is a valid street type for a location address'
'BEND','Bend','A Bend is a valid street type for a location address'
'BLVD','Boulevard','A Boulevard is a valid street type for a location address'
'BYP','Bypass','A Bypass is a valid street type for a location address'
'CYN','Canyon','A Canyon is a valid street type for a location address'
'CIR','Circle','A Circle is a valid street type for a location address'
'ALLY','Alley','An Alley is a valid street type for a location address'
'ANX','Annex','An Annex is a valid street type for a location address'
'AVE','Avenue','An Avenue is a valid street type for a location address'
'BEND','Bend','A Bend is a valid street type for a location address'
'BLVD','Boulevard','A Boulevard is a valid street type for a location address'
'BYP','Bypass','A Bypass is a valid street type for a location address'
'CYN','Canyon','A Canyon is a valid street type for a location address'
'CIR','Circle','A Circle is a valid street type for a location address'
table cities records
'BC','Boulder City','Boulder City is a beautiful city in southern Nevada'
'BUNK','Bunkerville','Bunkerville is a beautiful city in southern Nevada'
'CNTY','County','County is a beautiful city in southern Nevada'
'ENT','Enterprise','Enterprise is a beautiful city in southern Nevada'
'GLEN','Glendale','Glendale is a beautiful city in southern Nevada'
'HEND','Henderson','Henderson is a beautiful city in southern Nevada'
'ISPR','Indian Springs','Indian Springs is a beautiful city in southern Nevada'
'LAUG','Laughlin','Laughlin is a beautiful city in southern Nevada'
'BC','Boulder City','Boulder City is a beautiful city in southern Nevada'
'BUNK','Bunkerville','Bunkerville is a beautiful city in southern Nevada'
'CNTY','County','County is a beautiful city in southern Nevada'
'ENT','Enterprise','Enterprise is a beautiful city in southern Nevada'
'GLEN','Glendale','Glendale is a beautiful city in southern Nevada'
'HEND','Henderson','Henderson is a beautiful city in southern Nevada'
'ISPR','Indian Springs','Indian Springs is a beautiful city in southern Nevada'
'LAUG','Laughlin','Laughlin is a beautiful city in southern Nevada'
strdirs - ALTER TABLE table_1 ADD FOREIGN KEY (strdir) REFERENCES strdirs(id);
strtypes - ALTER TABLE table_1 ADD FOREIGN KEY (strtype) REFERENCES strtypes(id);
cities - ALTER TABLE table_1 ADD FOREIGN KEY (city) REFERENCES cities(id);
strdirs - ALTER TABLE table_1 ADD FOREIGN KEY (strdir) REFERENCES
strdirs(id); strtypes - ALTER TABLE table_1 ADD FOREIGN KEY (strtype)
REFERENCES strtypes(id); cities - ALTER TABLE table_1 ADD FOREIGN KEY
(city) REFERENCES cities(id);