SlideShare a Scribd company logo
1 of 25
TASK 01
(a) RELATIONAL SCHEMA
Customer (
CustomerID
, CustomerName, CustomerAddress, CustomerContactNum)
Parcel (
ParcelID
, ParcelWeightInGrams, FromAddress, ToAddress,
DateCollected, ParselValue, Charges, Status)
Delivered (DeliverdDate)
Returned (ReturnedDate)
Lost (LostEntryDate)
Invoice (
InvoiceID,
InvoiceDate, InvoiceAmount)
Claim (
ClaimID
, ClaimLodgedDate, ClaimSettledAmount, ClaimPaidDate)
Employee (
EmployeeID
, EmployeeName, EmployeeStartDate)
On the basis of relationship that exist between the entities, the
table can be further broken down as;
Since one customer can order for multiple parcels therefore, 1
to many relationship exists between them.
· Parcel (
ParcelID
, ParcelWeightInGrams, FromAddress, ToAddress,
DateCollected, ParselValue, Charges, Status,
CustomerID
) Foreign Key:
CustomerID
Since there is 1 to1 relationship between Parcel and Delivered,
Parcel and Returned, Parcel and Lost.
· Delivered (ParcelID,DeliverdDate) Primary Key: ParcelID
· Returned (ParcelID,ReturnedDate) Primary Key: ParcelID
· Lost (ParcelID,LostEntryDate) Primary Key: ParcelID
Since 1 to 1 relation exists between Parcel and Claim.
· Claim (
ClaimID
, ClaimLodgedDate, ClaimSettledAmount, ClaimPaidDate,
ParcelID
)
Foreign Key:
parcelID
Since 1 to 1 relation exists between LostParcel and Claim.
· Lost (
LostId
,LostEntryDate,
ParcelID
)
Primary Key: LostID
Foreign Key
: ParcelID
Since there is 1 to 1 relationship between Parcel and Invoice
1.
Invoice (
InvoiceID,
InvoiceDate, InvoiceAmount,
ParcelID
)
Foreign Key:
parcelID
Since there is 1 employee can be responsible for multiple
Parcel. Therefore,
2.
Parcel (
ParcelID
, ParcelWeightInGrams, FromAddress, ToAddress,
DateCollected, ParselValue, Charges, Status,
CustomerID, EmployeeID
)
Foreign Key:
CustomerID,EmployeeID
Since 1 to many relationship exists between Employee and
· Delivered (
DeliveredID
, ParcelID,DeliverdDate,
EmployeeID
) Primary Key: DeliveredID
· Returned (
ReturnedID
, ParcelID,ReturnedDate,
EmployeeID
) Primary Key: ReturnedID
· Lost (
LostId
,ParcelID,LostEntryDate,
EmployeeID
) Primary Key:
LostId
Foreign key:
EmployeeID,ParcelID
TASK 01
(b) NORMALIZATION
1.
Parcel (
ParcelID
, ParcelWeightInGrams, FromAddress, ToAddress,
DateCollected, ParselValue, Charges, Status,
CustomerID, EmployeeID
)
In this one customer can order multiple parcels, therefore
customerID is not enough to uniquely identify a tuple. There is
no partial key dependency. The primary key is the only key that
identifies the tuple, therefore, this table is 2NF.
For 3NF, there must be a transitive dependency, but in this table
here is no attribute that can further identify a tuple uniquely,
therefor it is already in 3NF
2.
Delivered (
DeliveredID
, ParcelID,DeliverdDate,
EmployeeID
)
In this table, there is no partial key dependency, therefore it is
already in 2NF.
Every attribute is fully dependent on DeliveredID, there is no
transitive dependency among the attributes because no one
attribute can uniquely identify any other attribute. Therefore,
we say it is already in 3NF
TASK 02 INTEGRITY CONSTRAINTS
Attribute
Data type
Integrity constraint implemented
Error message
DeliveredID
Autonumber
Primary Key
NULL
DeliverdDate
Date/Time
EmployeeID
Number
Foreign Key -Indexed
ParcelID
Number
Foreign Key -Indexed
Attribute
Data type
Integrity constraint implemented
Error message
ParcelID
Autonumber
Primary Key
ParcelWeightInGrams
Number
Decimal upto 2 places
FromAddress
LongText
ToAddress
LongText
DateCollected
Date/Time
Status
Shortext
In LOOKUP,
Display Control=List Box
Row source Type= Value Type
RowSource =
"Collected";"Transit";"Delivered";"Returned";"Lost"
EmployeeID,CustomerID
Number
Charges
Number
TASK 03IMPLEMENTATION REPORT
1.
Any two interesting things/procedures you have learnt by doing
this assignment.
How to add dropdown menu in status was one interesting thing
to learn about.
While creating relationship, how to link the primary and foreign
key with each other.
2.
Any one of the assignment tasks that was relatively difficult /
complex to solve but has been successfully completed by you.
Running queries were the most difficult work.
-- phpMyAdmin SQL Dump
-- version 3.3.9
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 24, 2019 at 11:53 AM
-- Server version: 5.5.8
-- PHP Version: 5.3.5
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @
[email protected]
@CHARACTER_SET_CLIENT */;
/*!40101 SET @
[email protected]
@CHARACTER_SET_RESULTS */;
/*!40101 SET @
[email protected]
@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `db2`
--
-- --------------------------------------------------------
--
-- Table structure for table `claim`
--
CREATE TABLE IF NOT EXISTS `claim` (
`ClaimID` int(11) NOT NULL AUTO_INCREMENT,
`ClaimLodgedDate` datetime NOT NULL,
`ClaimSettledAmount` int(11) NOT NULL,
`ClaimPaidDate` date NOT NULL,
`ParcelID` int(11) NOT NULL,
PRIMARY KEY (`ClaimID`),
KEY `ParcelID` (`ParcelID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
AUTO_INCREMENT=2 ;
--
-- Dumping data for table `claim`
--
INSERT INTO `claim` (`ClaimID`, `ClaimLodgedDate`,
`ClaimSettledAmount`, `ClaimPaidDate`, `ParcelID`) VALUES
(1, '2018-09-05 00:00:00', 1500, '2018-09-05', 5);
-- --------------------------------------------------------
--
-- Table structure for table `customer`
--
CREATE TABLE IF NOT EXISTS `customer` (
`CustomerID` int(11) NOT NULL AUTO_INCREMENT,
`CustomerName` varchar(255) NOT NULL,
`CustomerAddress` varchar(255) NOT NULL,
`CustomerContactNum` int(255) NOT NULL,
PRIMARY KEY (`CustomerID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
AUTO_INCREMENT=9 ;
--
-- Dumping data for table `customer`
--
INSERT INTO `customer` (`CustomerID`, `CustomerName`,
`CustomerAddress`, `CustomerContactNum`) VALUES
(1, 'Patrick A Evans', '3146 Hood Avenue, San Diego, 92123',
619),
(2, 'Russell T Foret', '1855 Colony Street,Stamford, 06901',
203),
(4, 'Byron J Christianson', '4412 Hide A Way Road, San Jose,
95118', 2147483647),
(5, 'Stanley D Alfonso', '1234 West Virginia Avenue, Colonie,
12205', 51833438),
(6, 'Ned S Clifford', '3321 Eagles Nest Drive,
Woodland,95695', 53090847),
(7, 'Nelson B Kelley', '2924 Stanton Hollow Road,
Randolph,02368', 78130881),
(8, 'Lawrence M Jaffe', '2426 John Calvin Drive,
CULEBRA,00775', 78745096);
-- --------------------------------------------------------
--
-- Table structure for table `delivered`
--
CREATE TABLE IF NOT EXISTS `delivered` (
`DeliveredID` int(11) NOT NULL AUTO_INCREMENT,
`ParcelID` int(11) NOT NULL,
`DeliveredDate` date NOT NULL,
`EmployeeID` int(11) NOT NULL,
PRIMARY KEY (`DeliveredID`),
KEY `ParcelID` (`ParcelID`),
KEY `EmployeeID` (`EmployeeID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
AUTO_INCREMENT=2 ;
--
-- Dumping data for table `delivered`
--
INSERT INTO `delivered` (`DeliveredID`, `ParcelID`,
`DeliveredDate`, `EmployeeID`) VALUES
(1, 8, '2019-05-22', 4);
-- --------------------------------------------------------
--
-- Table structure for table `employee`
--
CREATE TABLE IF NOT EXISTS `employee` (
`EmployeeID` int(11) NOT NULL AUTO_INCREMENT,
`EmployeeName` varchar(255) NOT NULL,
`EmployeeStartDate` date NOT NULL,
PRIMARY KEY (`EmployeeID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
AUTO_INCREMENT=7 ;
--
-- Dumping data for table `employee`
--
INSERT INTO `employee` (`EmployeeID`, `EmployeeName`,
`EmployeeStartDate`) VALUES
(1, 'Tommy M Horton', '2015-02-24'),
(2, 'Howard V Giddings', '2015-09-25'),
(3, 'Vincent L Figueroa', '2016-02-03'),
(4, 'Nathan M Ross', '2015-08-26'),
(5, 'Jeff C Mixson', '2015-03-14'),
(6, 'Robert G Cornejo', '2016-02-26');
-- --------------------------------------------------------
--
-- Table structure for table `invoice`
--
CREATE TABLE IF NOT EXISTS `invoice` (
`InvoiceID` int(11) NOT NULL AUTO_INCREMENT,
`ParcelID` int(11) NOT NULL,
`InvoiceDate` date NOT NULL,
`InvoiceAmount` int(11) NOT NULL,
PRIMARY KEY (`InvoiceID`),
KEY `ParcelID` (`ParcelID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
AUTO_INCREMENT=7 ;
--
-- Dumping data for table `invoice`
--
INSERT INTO `invoice` (`InvoiceID`, `ParcelID`,
`InvoiceDate`, `InvoiceAmount`) VALUES
(1, 4, '2017-08-11', 1500),
(2, 5, '2018-12-07', 2000),
(3, 6, '2019-05-30', 2550),
(4, 7, '2018-05-08', 2500),
(5, 3, '2018-02-02', 1000),
(6, 8, '2019-05-22', 1500);
-- --------------------------------------------------------
--
-- Table structure for table `lost`
--
CREATE TABLE IF NOT EXISTS `lost` (
`LostID` int(11) NOT NULL AUTO_INCREMENT,
`ParcelID` int(11) NOT NULL,
`LostEntryDate` date NOT NULL,
`EmployeeID` int(11) NOT NULL,
PRIMARY KEY (`LostID`),
UNIQUE KEY `ParcelID` (`ParcelID`),
KEY `EmployeeID` (`EmployeeID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
AUTO_INCREMENT=2 ;
--
-- Dumping data for table `lost`
--
INSERT INTO `lost` (`LostID`, `ParcelID`, `LostEntryDate`,
`EmployeeID`) VALUES
(1, 5, '2018-09-05', 5);
-- --------------------------------------------------------
--
-- Table structure for table `parcel`
--
CREATE TABLE IF NOT EXISTS `parcel` (
`ParcelID` int(11) NOT NULL AUTO_INCREMENT,
`ParcelWeightInGrams` decimal(11,2) NOT NULL,
`FromAddress` varchar(2500) NOT NULL,
`ToAddress` varchar(2500) NOT NULL,
`DateCollected` date NOT NULL,
`ParselValue` int(11) NOT NULL,
`Charges` int(11) NOT NULL,
`Status`
enum('Collected','Transit','Delivered','Returned','Lost') NOT
NULL,
`CustomerID` int(11) NOT NULL,
`EmployeeID` int(11) NOT NULL,
PRIMARY KEY (`ParcelID`),
KEY `CustomerID` (`CustomerID`),
KEY `EmployeeID` (`EmployeeID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
AUTO_INCREMENT=9 ;
--
-- Dumping data for table `parcel`
--
INSERT INTO `parcel` (`ParcelID`, `ParcelWeightInGrams`,
`FromAddress`, `ToAddress`, `DateCollected`, `ParselValue`,
`Charges`, `Status`, `CustomerID`, `EmployeeID`) VALUES
(3, '200.00', '2376 North Bend River Road, Somerset, 42501',
'4748 Bubby Drive,MORGANTOWN, 26501', '2018-02-02',
220, 1000, 'Collected', 4, 3),
(4, '352.00', '3469 Roosevelt Road,Dodge City,67801', '4269
Short Street,Austin,78723', '2017-08-11', 356, 1500, 'Returned',
6, 4),
(5, '198.00', '111 Lawman Avenue,Alexandria,22301', '2830
Hide A Way Road,Santa Clara,95050', '2018-12-07', 469, 2000,
'Lost', 2, 6),
(6, '146.00', '34 Sussex Court,Waco,76706', '1855 Hillcrest
Circle,Crystal,55429', '2019-05-30', 789, 2550, 'Transit', 7, 5),
(7, '436.00', '1049 Atha Drive,Bakersfield,93311', '1057 Froe
Street,TALMO,30575', '2018-05-08', 965, 2500, 'Collected', 1,
2),
(8, '716.00', '1057 Froe Street,TALMO,30575', '1049 Atha
Drive,Bakersfield,93311', '2019-05-22', 369, 1500, 'Delivered',
5, 5);
-- --------------------------------------------------------
--
-- Table structure for table `returned`
--
CREATE TABLE IF NOT EXISTS `returned` (
`ReturnedID` int(11) NOT NULL AUTO_INCREMENT,
`ParcelID` int(11) NOT NULL,
`ReturnedDate` date NOT NULL,
`EmployeeID` int(11) NOT NULL,
PRIMARY KEY (`ReturnedID`),
KEY `ParcelID` (`ParcelID`),
KEY `EmployeeID` (`EmployeeID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
AUTO_INCREMENT=2 ;
--
-- Dumping data for table `returned`
--
INSERT INTO `returned` (`ReturnedID`, `ParcelID`,
`ReturnedDate`, `EmployeeID`) VALUES
(1, 4, '2017-11-09', 4);
--
-- Constraints for dumped tables
--
--
-- Constraints for table `claim`
--
ALTER TABLE `claim`
ADD CONSTRAINT `claim_ibfk_1` FOREIGN KEY
(`ParcelID`) REFERENCES `parcel` (`ParcelID`) ON DELETE
CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `delivered`
--
ALTER TABLE `delivered`
ADD CONSTRAINT `delivered_ibfk_1` FOREIGN KEY
(`ParcelID`) REFERENCES `parcel` (`ParcelID`) ON DELETE
CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `delivered_ibfk_2` FOREIGN KEY
(`EmployeeID`) REFERENCES `employee` (`EmployeeID`) ON
DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `invoice`
--
ALTER TABLE `invoice`
ADD CONSTRAINT `invoice_ibfk_1` FOREIGN KEY
(`ParcelID`) REFERENCES `parcel` (`ParcelID`) ON DELETE
CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `lost`
--
ALTER TABLE `lost`
ADD CONSTRAINT `lost_ibfk_1` FOREIGN KEY
(`ParcelID`) REFERENCES `parcel` (`ParcelID`) ON DELETE
CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `lost_ibfk_2` FOREIGN KEY
(`EmployeeID`) REFERENCES `employee` (`EmployeeID`) ON
DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `parcel`
--
ALTER TABLE `parcel`
ADD CONSTRAINT `parcel_ibfk_1` FOREIGN KEY
(`CustomerID`) REFERENCES `customer` (`CustomerID`),
ADD CONSTRAINT `parcel_ibfk_2` FOREIGN KEY
(`EmployeeID`) REFERENCES `employee` (`EmployeeID`);
--
-- Constraints for table `returned`
--
ALTER TABLE `returned`
ADD CONSTRAINT `returned_ibfk_1` FOREIGN KEY
(`ParcelID`) REFERENCES `parcel` (`ParcelID`) ON DELETE
CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `returned_ibfk_2` FOREIGN KEY
(`EmployeeID`) REFERENCES `employee` (`EmployeeID`) ON
DELETE CASCADE ON UPDATE CASCADE;

More Related Content

Similar to TASK 01 (a) RELATIONAL SCHEMA Customer (CustomerID, Cu

Introduction to Dating Modeling for Cassandra
Introduction to Dating Modeling for CassandraIntroduction to Dating Modeling for Cassandra
Introduction to Dating Modeling for CassandraDataStax Academy
 
Database Implementation Final Document
Database Implementation Final DocumentDatabase Implementation Final Document
Database Implementation Final DocumentConor O'Callaghan
 
SQL FILE FROM MOODLEUSE [master]GO Object Databa.pdf
SQL FILE FROM MOODLEUSE [master]GO Object Databa.pdfSQL FILE FROM MOODLEUSE [master]GO Object Databa.pdf
SQL FILE FROM MOODLEUSE [master]GO Object Databa.pdfarrowit1
 
DN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project A
DN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project ADN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project A
DN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project ADataconomy Media
 
CMS Project Phase II InstructionsIn this phase, you will create t.docx
CMS Project Phase II InstructionsIn this phase, you will create t.docxCMS Project Phase II InstructionsIn this phase, you will create t.docx
CMS Project Phase II InstructionsIn this phase, you will create t.docxmary772
 
on SQL Managment studio(For the following exercise, use the Week 5.pdf
on SQL Managment studio(For the following exercise, use the Week 5.pdfon SQL Managment studio(For the following exercise, use the Week 5.pdf
on SQL Managment studio(For the following exercise, use the Week 5.pdfformaxekochi
 
Sql Question #3
Sql Question #3Sql Question #3
Sql Question #3Kai Liu
 
Project 01 - Data Exploration and Reporting
Project 01 - Data Exploration and ReportingProject 01 - Data Exploration and Reporting
Project 01 - Data Exploration and ReportingAmarnathVenkataraman
 
Work in TDW
Work in TDWWork in TDW
Work in TDWsaso70
 
It's painful how much data rules the world
It's painful how much data rules the worldIt's painful how much data rules the world
It's painful how much data rules the worldJean-Georges Perrin
 
Powering Heap With PostgreSQL And CitusDB (PGConf Silicon Valley 2015)
Powering Heap With PostgreSQL And CitusDB (PGConf Silicon Valley 2015)Powering Heap With PostgreSQL And CitusDB (PGConf Silicon Valley 2015)
Powering Heap With PostgreSQL And CitusDB (PGConf Silicon Valley 2015)Dan Robinson
 
解决Ora 14098分区交换索引不匹配错误
解决Ora 14098分区交换索引不匹配错误解决Ora 14098分区交换索引不匹配错误
解决Ora 14098分区交换索引不匹配错误maclean liu
 
Data warehouse or conventional database: Which is right for you?
Data warehouse or conventional database: Which is right for you?Data warehouse or conventional database: Which is right for you?
Data warehouse or conventional database: Which is right for you?Data Con LA
 
Baksik3 enug baksik_xmlinvoice
Baksik3 enug baksik_xmlinvoiceBaksik3 enug baksik_xmlinvoice
Baksik3 enug baksik_xmlinvoiceENUG
 
List of Coversions in Oracle Apps
List of Coversions in Oracle AppsList of Coversions in Oracle Apps
List of Coversions in Oracle AppsPrem Kumar
 

Similar to TASK 01 (a) RELATIONAL SCHEMA Customer (CustomerID, Cu (20)

Introduction to Dating Modeling for Cassandra
Introduction to Dating Modeling for CassandraIntroduction to Dating Modeling for Cassandra
Introduction to Dating Modeling for Cassandra
 
Normalization
NormalizationNormalization
Normalization
 
Database Implementation Final Document
Database Implementation Final DocumentDatabase Implementation Final Document
Database Implementation Final Document
 
SQL FILE FROM MOODLEUSE [master]GO Object Databa.pdf
SQL FILE FROM MOODLEUSE [master]GO Object Databa.pdfSQL FILE FROM MOODLEUSE [master]GO Object Databa.pdf
SQL FILE FROM MOODLEUSE [master]GO Object Databa.pdf
 
DN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project A
DN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project ADN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project A
DN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project A
 
CMS Project Phase II InstructionsIn this phase, you will create t.docx
CMS Project Phase II InstructionsIn this phase, you will create t.docxCMS Project Phase II InstructionsIn this phase, you will create t.docx
CMS Project Phase II InstructionsIn this phase, you will create t.docx
 
on SQL Managment studio(For the following exercise, use the Week 5.pdf
on SQL Managment studio(For the following exercise, use the Week 5.pdfon SQL Managment studio(For the following exercise, use the Week 5.pdf
on SQL Managment studio(For the following exercise, use the Week 5.pdf
 
project
projectproject
project
 
Sql Question #3
Sql Question #3Sql Question #3
Sql Question #3
 
Project 01 - Data Exploration and Reporting
Project 01 - Data Exploration and ReportingProject 01 - Data Exploration and Reporting
Project 01 - Data Exploration and Reporting
 
Work in TDW
Work in TDWWork in TDW
Work in TDW
 
Banking Database
Banking DatabaseBanking Database
Banking Database
 
Benforta
BenfortaBenforta
Benforta
 
Benforta
BenfortaBenforta
Benforta
 
It's painful how much data rules the world
It's painful how much data rules the worldIt's painful how much data rules the world
It's painful how much data rules the world
 
Powering Heap With PostgreSQL And CitusDB (PGConf Silicon Valley 2015)
Powering Heap With PostgreSQL And CitusDB (PGConf Silicon Valley 2015)Powering Heap With PostgreSQL And CitusDB (PGConf Silicon Valley 2015)
Powering Heap With PostgreSQL And CitusDB (PGConf Silicon Valley 2015)
 
解决Ora 14098分区交换索引不匹配错误
解决Ora 14098分区交换索引不匹配错误解决Ora 14098分区交换索引不匹配错误
解决Ora 14098分区交换索引不匹配错误
 
Data warehouse or conventional database: Which is right for you?
Data warehouse or conventional database: Which is right for you?Data warehouse or conventional database: Which is right for you?
Data warehouse or conventional database: Which is right for you?
 
Baksik3 enug baksik_xmlinvoice
Baksik3 enug baksik_xmlinvoiceBaksik3 enug baksik_xmlinvoice
Baksik3 enug baksik_xmlinvoice
 
List of Coversions in Oracle Apps
List of Coversions in Oracle AppsList of Coversions in Oracle Apps
List of Coversions in Oracle Apps
 

More from alehosickg3

Watch the movie Dirt. Write a note. The notes do not have to be in .docx
Watch the movie Dirt. Write a note. The notes do not have to be in .docxWatch the movie Dirt. Write a note. The notes do not have to be in .docx
Watch the movie Dirt. Write a note. The notes do not have to be in .docxalehosickg3
 
Watch the PBS video, States Grapple with Funding Education amid Bu.docx
Watch the PBS video, States Grapple with Funding Education amid Bu.docxWatch the PBS video, States Grapple with Funding Education amid Bu.docx
Watch the PBS video, States Grapple with Funding Education amid Bu.docxalehosickg3
 
Watch the 1985 movie Fletch, starring Chevy Chase, and write.docx
Watch the 1985 movie Fletch, starring Chevy Chase, and write.docxWatch the 1985 movie Fletch, starring Chevy Chase, and write.docx
Watch the 1985 movie Fletch, starring Chevy Chase, and write.docxalehosickg3
 
Watch the documentary and answer one or more of the following qu.docx
Watch the documentary and answer one or more of the following qu.docxWatch the documentary and answer one or more of the following qu.docx
Watch the documentary and answer one or more of the following qu.docxalehosickg3
 
Watch one or more of the following videos discussing randomness, sta.docx
Watch one or more of the following videos discussing randomness, sta.docxWatch one or more of the following videos discussing randomness, sta.docx
Watch one or more of the following videos discussing randomness, sta.docxalehosickg3
 
Watch one of the following moviesA Beautiful Mind (2001).docx
Watch one of the following moviesA Beautiful Mind (2001).docxWatch one of the following moviesA Beautiful Mind (2001).docx
Watch one of the following moviesA Beautiful Mind (2001).docxalehosickg3
 
Watch BNET Videos video titled Modernizing Inventory Management o.docx
Watch BNET Videos video titled Modernizing Inventory Management o.docxWatch BNET Videos video titled Modernizing Inventory Management o.docx
Watch BNET Videos video titled Modernizing Inventory Management o.docxalehosickg3
 
Was the Scientific Revolution intended to be a war on tradition and .docx
Was the Scientific Revolution intended to be a war on tradition and .docxWas the Scientific Revolution intended to be a war on tradition and .docx
Was the Scientific Revolution intended to be a war on tradition and .docxalehosickg3
 
WarehousingCompanies use cross-docking to improve the performanc.docx
WarehousingCompanies use cross-docking to improve the performanc.docxWarehousingCompanies use cross-docking to improve the performanc.docx
WarehousingCompanies use cross-docking to improve the performanc.docxalehosickg3
 
War and Peace Please respond to the followingBased on the lect.docx
War and Peace Please respond to the followingBased on the lect.docxWar and Peace Please respond to the followingBased on the lect.docx
War and Peace Please respond to the followingBased on the lect.docxalehosickg3
 
Wang, Woo, Choon, Quek, Yang, and Liu (2012) found that using Facebo.docx
Wang, Woo, Choon, Quek, Yang, and Liu (2012) found that using Facebo.docxWang, Woo, Choon, Quek, Yang, and Liu (2012) found that using Facebo.docx
Wang, Woo, Choon, Quek, Yang, and Liu (2012) found that using Facebo.docxalehosickg3
 
W4 Assignment DeterrenceIntroduction to CriminologyCrime and C.docx
W4 Assignment DeterrenceIntroduction to CriminologyCrime and C.docxW4 Assignment DeterrenceIntroduction to CriminologyCrime and C.docx
W4 Assignment DeterrenceIntroduction to CriminologyCrime and C.docxalehosickg3
 
Vulnerable Population Summary and Proposed ProgramThe first of you.docx
Vulnerable Population Summary and Proposed ProgramThe first of you.docxVulnerable Population Summary and Proposed ProgramThe first of you.docx
Vulnerable Population Summary and Proposed ProgramThe first of you.docxalehosickg3
 
Voices of DemocracyThe documents created at the inception of Ameri.docx
Voices of DemocracyThe documents created at the inception of Ameri.docxVoices of DemocracyThe documents created at the inception of Ameri.docx
Voices of DemocracyThe documents created at the inception of Ameri.docxalehosickg3
 
Vital statistics collected by federal, state, & local governments ar.docx
Vital statistics collected by federal, state, & local governments ar.docxVital statistics collected by federal, state, & local governments ar.docx
Vital statistics collected by federal, state, & local governments ar.docxalehosickg3
 
Visual Representation and Analysis of DataStateTotal.docx
Visual Representation and Analysis of DataStateTotal.docxVisual Representation and Analysis of DataStateTotal.docx
Visual Representation and Analysis of DataStateTotal.docxalehosickg3
 
Vladimir Putin was recently reelected to another term as President o.docx
Vladimir Putin was recently reelected to another term as President o.docxVladimir Putin was recently reelected to another term as President o.docx
Vladimir Putin was recently reelected to another term as President o.docxalehosickg3
 
Vissing (2011) explains culture as an organized system of living an.docx
Vissing (2011) explains culture as an organized system of living an.docxVissing (2011) explains culture as an organized system of living an.docx
Vissing (2011) explains culture as an organized system of living an.docxalehosickg3
 
Visit the Endeavour Space Shuttle (I Already went there) at the .docx
Visit the Endeavour Space Shuttle (I Already went there) at the .docxVisit the Endeavour Space Shuttle (I Already went there) at the .docx
Visit the Endeavour Space Shuttle (I Already went there) at the .docxalehosickg3
 
Visit the Endeavour Space Shuttle (any day) at the Science Cente.docx
Visit the Endeavour Space Shuttle (any day) at the Science Cente.docxVisit the Endeavour Space Shuttle (any day) at the Science Cente.docx
Visit the Endeavour Space Shuttle (any day) at the Science Cente.docxalehosickg3
 

More from alehosickg3 (20)

Watch the movie Dirt. Write a note. The notes do not have to be in .docx
Watch the movie Dirt. Write a note. The notes do not have to be in .docxWatch the movie Dirt. Write a note. The notes do not have to be in .docx
Watch the movie Dirt. Write a note. The notes do not have to be in .docx
 
Watch the PBS video, States Grapple with Funding Education amid Bu.docx
Watch the PBS video, States Grapple with Funding Education amid Bu.docxWatch the PBS video, States Grapple with Funding Education amid Bu.docx
Watch the PBS video, States Grapple with Funding Education amid Bu.docx
 
Watch the 1985 movie Fletch, starring Chevy Chase, and write.docx
Watch the 1985 movie Fletch, starring Chevy Chase, and write.docxWatch the 1985 movie Fletch, starring Chevy Chase, and write.docx
Watch the 1985 movie Fletch, starring Chevy Chase, and write.docx
 
Watch the documentary and answer one or more of the following qu.docx
Watch the documentary and answer one or more of the following qu.docxWatch the documentary and answer one or more of the following qu.docx
Watch the documentary and answer one or more of the following qu.docx
 
Watch one or more of the following videos discussing randomness, sta.docx
Watch one or more of the following videos discussing randomness, sta.docxWatch one or more of the following videos discussing randomness, sta.docx
Watch one or more of the following videos discussing randomness, sta.docx
 
Watch one of the following moviesA Beautiful Mind (2001).docx
Watch one of the following moviesA Beautiful Mind (2001).docxWatch one of the following moviesA Beautiful Mind (2001).docx
Watch one of the following moviesA Beautiful Mind (2001).docx
 
Watch BNET Videos video titled Modernizing Inventory Management o.docx
Watch BNET Videos video titled Modernizing Inventory Management o.docxWatch BNET Videos video titled Modernizing Inventory Management o.docx
Watch BNET Videos video titled Modernizing Inventory Management o.docx
 
Was the Scientific Revolution intended to be a war on tradition and .docx
Was the Scientific Revolution intended to be a war on tradition and .docxWas the Scientific Revolution intended to be a war on tradition and .docx
Was the Scientific Revolution intended to be a war on tradition and .docx
 
WarehousingCompanies use cross-docking to improve the performanc.docx
WarehousingCompanies use cross-docking to improve the performanc.docxWarehousingCompanies use cross-docking to improve the performanc.docx
WarehousingCompanies use cross-docking to improve the performanc.docx
 
War and Peace Please respond to the followingBased on the lect.docx
War and Peace Please respond to the followingBased on the lect.docxWar and Peace Please respond to the followingBased on the lect.docx
War and Peace Please respond to the followingBased on the lect.docx
 
Wang, Woo, Choon, Quek, Yang, and Liu (2012) found that using Facebo.docx
Wang, Woo, Choon, Quek, Yang, and Liu (2012) found that using Facebo.docxWang, Woo, Choon, Quek, Yang, and Liu (2012) found that using Facebo.docx
Wang, Woo, Choon, Quek, Yang, and Liu (2012) found that using Facebo.docx
 
W4 Assignment DeterrenceIntroduction to CriminologyCrime and C.docx
W4 Assignment DeterrenceIntroduction to CriminologyCrime and C.docxW4 Assignment DeterrenceIntroduction to CriminologyCrime and C.docx
W4 Assignment DeterrenceIntroduction to CriminologyCrime and C.docx
 
Vulnerable Population Summary and Proposed ProgramThe first of you.docx
Vulnerable Population Summary and Proposed ProgramThe first of you.docxVulnerable Population Summary and Proposed ProgramThe first of you.docx
Vulnerable Population Summary and Proposed ProgramThe first of you.docx
 
Voices of DemocracyThe documents created at the inception of Ameri.docx
Voices of DemocracyThe documents created at the inception of Ameri.docxVoices of DemocracyThe documents created at the inception of Ameri.docx
Voices of DemocracyThe documents created at the inception of Ameri.docx
 
Vital statistics collected by federal, state, & local governments ar.docx
Vital statistics collected by federal, state, & local governments ar.docxVital statistics collected by federal, state, & local governments ar.docx
Vital statistics collected by federal, state, & local governments ar.docx
 
Visual Representation and Analysis of DataStateTotal.docx
Visual Representation and Analysis of DataStateTotal.docxVisual Representation and Analysis of DataStateTotal.docx
Visual Representation and Analysis of DataStateTotal.docx
 
Vladimir Putin was recently reelected to another term as President o.docx
Vladimir Putin was recently reelected to another term as President o.docxVladimir Putin was recently reelected to another term as President o.docx
Vladimir Putin was recently reelected to another term as President o.docx
 
Vissing (2011) explains culture as an organized system of living an.docx
Vissing (2011) explains culture as an organized system of living an.docxVissing (2011) explains culture as an organized system of living an.docx
Vissing (2011) explains culture as an organized system of living an.docx
 
Visit the Endeavour Space Shuttle (I Already went there) at the .docx
Visit the Endeavour Space Shuttle (I Already went there) at the .docxVisit the Endeavour Space Shuttle (I Already went there) at the .docx
Visit the Endeavour Space Shuttle (I Already went there) at the .docx
 
Visit the Endeavour Space Shuttle (any day) at the Science Cente.docx
Visit the Endeavour Space Shuttle (any day) at the Science Cente.docxVisit the Endeavour Space Shuttle (any day) at the Science Cente.docx
Visit the Endeavour Space Shuttle (any day) at the Science Cente.docx
 

Recently uploaded

Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxdhanalakshmis0310
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 

Recently uploaded (20)

Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 

TASK 01 (a) RELATIONAL SCHEMA Customer (CustomerID, Cu

  • 1. TASK 01 (a) RELATIONAL SCHEMA Customer ( CustomerID , CustomerName, CustomerAddress, CustomerContactNum) Parcel ( ParcelID , ParcelWeightInGrams, FromAddress, ToAddress, DateCollected, ParselValue, Charges, Status) Delivered (DeliverdDate) Returned (ReturnedDate) Lost (LostEntryDate) Invoice ( InvoiceID, InvoiceDate, InvoiceAmount) Claim ( ClaimID , ClaimLodgedDate, ClaimSettledAmount, ClaimPaidDate) Employee ( EmployeeID , EmployeeName, EmployeeStartDate) On the basis of relationship that exist between the entities, the table can be further broken down as;
  • 2. Since one customer can order for multiple parcels therefore, 1 to many relationship exists between them. · Parcel ( ParcelID , ParcelWeightInGrams, FromAddress, ToAddress, DateCollected, ParselValue, Charges, Status, CustomerID ) Foreign Key: CustomerID Since there is 1 to1 relationship between Parcel and Delivered, Parcel and Returned, Parcel and Lost. · Delivered (ParcelID,DeliverdDate) Primary Key: ParcelID · Returned (ParcelID,ReturnedDate) Primary Key: ParcelID · Lost (ParcelID,LostEntryDate) Primary Key: ParcelID Since 1 to 1 relation exists between Parcel and Claim. · Claim ( ClaimID , ClaimLodgedDate, ClaimSettledAmount, ClaimPaidDate, ParcelID ) Foreign Key: parcelID Since 1 to 1 relation exists between LostParcel and Claim. · Lost ( LostId ,LostEntryDate,
  • 3. ParcelID ) Primary Key: LostID Foreign Key : ParcelID Since there is 1 to 1 relationship between Parcel and Invoice 1. Invoice ( InvoiceID, InvoiceDate, InvoiceAmount, ParcelID ) Foreign Key: parcelID Since there is 1 employee can be responsible for multiple Parcel. Therefore, 2. Parcel ( ParcelID , ParcelWeightInGrams, FromAddress, ToAddress, DateCollected, ParselValue, Charges, Status, CustomerID, EmployeeID ) Foreign Key: CustomerID,EmployeeID Since 1 to many relationship exists between Employee and
  • 4. · Delivered ( DeliveredID , ParcelID,DeliverdDate, EmployeeID ) Primary Key: DeliveredID · Returned ( ReturnedID , ParcelID,ReturnedDate, EmployeeID ) Primary Key: ReturnedID · Lost ( LostId ,ParcelID,LostEntryDate, EmployeeID ) Primary Key: LostId Foreign key: EmployeeID,ParcelID TASK 01 (b) NORMALIZATION 1. Parcel ( ParcelID , ParcelWeightInGrams, FromAddress, ToAddress, DateCollected, ParselValue, Charges, Status, CustomerID, EmployeeID ) In this one customer can order multiple parcels, therefore customerID is not enough to uniquely identify a tuple. There is
  • 5. no partial key dependency. The primary key is the only key that identifies the tuple, therefore, this table is 2NF. For 3NF, there must be a transitive dependency, but in this table here is no attribute that can further identify a tuple uniquely, therefor it is already in 3NF 2. Delivered ( DeliveredID , ParcelID,DeliverdDate, EmployeeID ) In this table, there is no partial key dependency, therefore it is already in 2NF. Every attribute is fully dependent on DeliveredID, there is no transitive dependency among the attributes because no one attribute can uniquely identify any other attribute. Therefore, we say it is already in 3NF TASK 02 INTEGRITY CONSTRAINTS Attribute Data type Integrity constraint implemented
  • 7. ParcelID Number Foreign Key -Indexed Attribute Data type Integrity constraint implemented Error message ParcelID Autonumber Primary Key
  • 8. ParcelWeightInGrams Number Decimal upto 2 places FromAddress LongText ToAddress LongText DateCollected Date/Time
  • 9. Status Shortext In LOOKUP, Display Control=List Box Row source Type= Value Type RowSource = "Collected";"Transit";"Delivered";"Returned";"Lost" EmployeeID,CustomerID Number Charges Number
  • 10. TASK 03IMPLEMENTATION REPORT 1. Any two interesting things/procedures you have learnt by doing this assignment. How to add dropdown menu in status was one interesting thing to learn about. While creating relationship, how to link the primary and foreign key with each other. 2. Any one of the assignment tasks that was relatively difficult / complex to solve but has been successfully completed by you. Running queries were the most difficult work. -- phpMyAdmin SQL Dump -- version 3.3.9 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: May 24, 2019 at 11:53 AM -- Server version: 5.5.8
  • 11. -- PHP Version: 5.3.5 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; /*!40101 SET @ [email protected] @CHARACTER_SET_CLIENT */; /*!40101 SET @ [email protected] @CHARACTER_SET_RESULTS */; /*!40101 SET @ [email protected] @COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `db2` -- -- -------------------------------------------------------- -- -- Table structure for table `claim`
  • 12. -- CREATE TABLE IF NOT EXISTS `claim` ( `ClaimID` int(11) NOT NULL AUTO_INCREMENT, `ClaimLodgedDate` datetime NOT NULL, `ClaimSettledAmount` int(11) NOT NULL, `ClaimPaidDate` date NOT NULL, `ParcelID` int(11) NOT NULL, PRIMARY KEY (`ClaimID`), KEY `ParcelID` (`ParcelID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; -- -- Dumping data for table `claim` -- INSERT INTO `claim` (`ClaimID`, `ClaimLodgedDate`, `ClaimSettledAmount`, `ClaimPaidDate`, `ParcelID`) VALUES (1, '2018-09-05 00:00:00', 1500, '2018-09-05', 5);
  • 13. -- -------------------------------------------------------- -- -- Table structure for table `customer` -- CREATE TABLE IF NOT EXISTS `customer` ( `CustomerID` int(11) NOT NULL AUTO_INCREMENT, `CustomerName` varchar(255) NOT NULL, `CustomerAddress` varchar(255) NOT NULL, `CustomerContactNum` int(255) NOT NULL, PRIMARY KEY (`CustomerID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ; -- -- Dumping data for table `customer` -- INSERT INTO `customer` (`CustomerID`, `CustomerName`, `CustomerAddress`, `CustomerContactNum`) VALUES
  • 14. (1, 'Patrick A Evans', '3146 Hood Avenue, San Diego, 92123', 619), (2, 'Russell T Foret', '1855 Colony Street,Stamford, 06901', 203), (4, 'Byron J Christianson', '4412 Hide A Way Road, San Jose, 95118', 2147483647), (5, 'Stanley D Alfonso', '1234 West Virginia Avenue, Colonie, 12205', 51833438), (6, 'Ned S Clifford', '3321 Eagles Nest Drive, Woodland,95695', 53090847), (7, 'Nelson B Kelley', '2924 Stanton Hollow Road, Randolph,02368', 78130881), (8, 'Lawrence M Jaffe', '2426 John Calvin Drive, CULEBRA,00775', 78745096); -- -------------------------------------------------------- -- -- Table structure for table `delivered` -- CREATE TABLE IF NOT EXISTS `delivered` ( `DeliveredID` int(11) NOT NULL AUTO_INCREMENT,
  • 15. `ParcelID` int(11) NOT NULL, `DeliveredDate` date NOT NULL, `EmployeeID` int(11) NOT NULL, PRIMARY KEY (`DeliveredID`), KEY `ParcelID` (`ParcelID`), KEY `EmployeeID` (`EmployeeID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; -- -- Dumping data for table `delivered` -- INSERT INTO `delivered` (`DeliveredID`, `ParcelID`, `DeliveredDate`, `EmployeeID`) VALUES (1, 8, '2019-05-22', 4); -- -------------------------------------------------------- -- -- Table structure for table `employee`
  • 16. -- CREATE TABLE IF NOT EXISTS `employee` ( `EmployeeID` int(11) NOT NULL AUTO_INCREMENT, `EmployeeName` varchar(255) NOT NULL, `EmployeeStartDate` date NOT NULL, PRIMARY KEY (`EmployeeID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; -- -- Dumping data for table `employee` -- INSERT INTO `employee` (`EmployeeID`, `EmployeeName`, `EmployeeStartDate`) VALUES (1, 'Tommy M Horton', '2015-02-24'), (2, 'Howard V Giddings', '2015-09-25'), (3, 'Vincent L Figueroa', '2016-02-03'), (4, 'Nathan M Ross', '2015-08-26'), (5, 'Jeff C Mixson', '2015-03-14'),
  • 17. (6, 'Robert G Cornejo', '2016-02-26'); -- -------------------------------------------------------- -- -- Table structure for table `invoice` -- CREATE TABLE IF NOT EXISTS `invoice` ( `InvoiceID` int(11) NOT NULL AUTO_INCREMENT, `ParcelID` int(11) NOT NULL, `InvoiceDate` date NOT NULL, `InvoiceAmount` int(11) NOT NULL, PRIMARY KEY (`InvoiceID`), KEY `ParcelID` (`ParcelID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; -- -- Dumping data for table `invoice`
  • 18. -- INSERT INTO `invoice` (`InvoiceID`, `ParcelID`, `InvoiceDate`, `InvoiceAmount`) VALUES (1, 4, '2017-08-11', 1500), (2, 5, '2018-12-07', 2000), (3, 6, '2019-05-30', 2550), (4, 7, '2018-05-08', 2500), (5, 3, '2018-02-02', 1000), (6, 8, '2019-05-22', 1500); -- -------------------------------------------------------- -- -- Table structure for table `lost` -- CREATE TABLE IF NOT EXISTS `lost` ( `LostID` int(11) NOT NULL AUTO_INCREMENT, `ParcelID` int(11) NOT NULL, `LostEntryDate` date NOT NULL,
  • 19. `EmployeeID` int(11) NOT NULL, PRIMARY KEY (`LostID`), UNIQUE KEY `ParcelID` (`ParcelID`), KEY `EmployeeID` (`EmployeeID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; -- -- Dumping data for table `lost` -- INSERT INTO `lost` (`LostID`, `ParcelID`, `LostEntryDate`, `EmployeeID`) VALUES (1, 5, '2018-09-05', 5); -- -------------------------------------------------------- -- -- Table structure for table `parcel` --
  • 20. CREATE TABLE IF NOT EXISTS `parcel` ( `ParcelID` int(11) NOT NULL AUTO_INCREMENT, `ParcelWeightInGrams` decimal(11,2) NOT NULL, `FromAddress` varchar(2500) NOT NULL, `ToAddress` varchar(2500) NOT NULL, `DateCollected` date NOT NULL, `ParselValue` int(11) NOT NULL, `Charges` int(11) NOT NULL, `Status` enum('Collected','Transit','Delivered','Returned','Lost') NOT NULL, `CustomerID` int(11) NOT NULL, `EmployeeID` int(11) NOT NULL, PRIMARY KEY (`ParcelID`), KEY `CustomerID` (`CustomerID`), KEY `EmployeeID` (`EmployeeID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ; --
  • 21. -- Dumping data for table `parcel` -- INSERT INTO `parcel` (`ParcelID`, `ParcelWeightInGrams`, `FromAddress`, `ToAddress`, `DateCollected`, `ParselValue`, `Charges`, `Status`, `CustomerID`, `EmployeeID`) VALUES (3, '200.00', '2376 North Bend River Road, Somerset, 42501', '4748 Bubby Drive,MORGANTOWN, 26501', '2018-02-02', 220, 1000, 'Collected', 4, 3), (4, '352.00', '3469 Roosevelt Road,Dodge City,67801', '4269 Short Street,Austin,78723', '2017-08-11', 356, 1500, 'Returned', 6, 4), (5, '198.00', '111 Lawman Avenue,Alexandria,22301', '2830 Hide A Way Road,Santa Clara,95050', '2018-12-07', 469, 2000, 'Lost', 2, 6), (6, '146.00', '34 Sussex Court,Waco,76706', '1855 Hillcrest Circle,Crystal,55429', '2019-05-30', 789, 2550, 'Transit', 7, 5), (7, '436.00', '1049 Atha Drive,Bakersfield,93311', '1057 Froe Street,TALMO,30575', '2018-05-08', 965, 2500, 'Collected', 1, 2), (8, '716.00', '1057 Froe Street,TALMO,30575', '1049 Atha Drive,Bakersfield,93311', '2019-05-22', 369, 1500, 'Delivered', 5, 5); -- --------------------------------------------------------
  • 22. -- -- Table structure for table `returned` -- CREATE TABLE IF NOT EXISTS `returned` ( `ReturnedID` int(11) NOT NULL AUTO_INCREMENT, `ParcelID` int(11) NOT NULL, `ReturnedDate` date NOT NULL, `EmployeeID` int(11) NOT NULL, PRIMARY KEY (`ReturnedID`), KEY `ParcelID` (`ParcelID`), KEY `EmployeeID` (`EmployeeID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; -- -- Dumping data for table `returned` -- INSERT INTO `returned` (`ReturnedID`, `ParcelID`, `ReturnedDate`, `EmployeeID`) VALUES
  • 23. (1, 4, '2017-11-09', 4); -- -- Constraints for dumped tables -- -- -- Constraints for table `claim` -- ALTER TABLE `claim` ADD CONSTRAINT `claim_ibfk_1` FOREIGN KEY (`ParcelID`) REFERENCES `parcel` (`ParcelID`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `delivered` -- ALTER TABLE `delivered` ADD CONSTRAINT `delivered_ibfk_1` FOREIGN KEY (`ParcelID`) REFERENCES `parcel` (`ParcelID`) ON DELETE CASCADE ON UPDATE CASCADE,
  • 24. ADD CONSTRAINT `delivered_ibfk_2` FOREIGN KEY (`EmployeeID`) REFERENCES `employee` (`EmployeeID`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `invoice` -- ALTER TABLE `invoice` ADD CONSTRAINT `invoice_ibfk_1` FOREIGN KEY (`ParcelID`) REFERENCES `parcel` (`ParcelID`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `lost` -- ALTER TABLE `lost` ADD CONSTRAINT `lost_ibfk_1` FOREIGN KEY (`ParcelID`) REFERENCES `parcel` (`ParcelID`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `lost_ibfk_2` FOREIGN KEY (`EmployeeID`) REFERENCES `employee` (`EmployeeID`) ON DELETE CASCADE ON UPDATE CASCADE; --
  • 25. -- Constraints for table `parcel` -- ALTER TABLE `parcel` ADD CONSTRAINT `parcel_ibfk_1` FOREIGN KEY (`CustomerID`) REFERENCES `customer` (`CustomerID`), ADD CONSTRAINT `parcel_ibfk_2` FOREIGN KEY (`EmployeeID`) REFERENCES `employee` (`EmployeeID`); -- -- Constraints for table `returned` -- ALTER TABLE `returned` ADD CONSTRAINT `returned_ibfk_1` FOREIGN KEY (`ParcelID`) REFERENCES `parcel` (`ParcelID`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `returned_ibfk_2` FOREIGN KEY (`EmployeeID`) REFERENCES `employee` (`EmployeeID`) ON DELETE CASCADE ON UPDATE CASCADE;