Data modelling

10
DATA MODELLING By David O’ Connor Submitted on 30th November 2014

Transcript of Data modelling

Page 1: Data modelling

DATA MODELLINGBy David O’ Connor

Submitted on 30th November 2014

Page 2: Data modelling

DATA MODELPayment

Payment_Id {pk}Pay_DateAmountMethodType

OwnerOwner_ID {pk}Forename SurnameStreetTownCountyPhone_NumberEmail

RegOwnerRegOwnerDate {pk}Owner_ID {pk}RegNo {pk}ForenameSurnameStreetTownCounty

VehicleRegNo {pk}MakeModelColourNRDPIN

Licence Authority

LA_Code {pk}Description

Assessment

Ass_Code {pk}DescriptionR3 R6R12

1…*

Is for

1

Is reg. with

0…*

1

Belongs to

Refers to

Refers to

1…*1…*

1

1

Page 3: Data modelling

RELATIONAL SCHEMA

Owner (Owner_ID, Forename, Surname, Street, Town, County, Phone_Number, Email)

 

Vehicle (RegNo, Make, Model, Colour, NRD, PIN)

Payment (Payment_Id, Pay_Date, Amount, Method, Type)

Licence Authority (LA_Code, Description)

RegOwner (RegOwnerDate, Owner_ID, RegNo, Forename, Surname, Street, Town, County)

 

Assessment (Ass_Code, Description, R3, R6, R12)

Page 4: Data modelling

DATABASE SCHEMA Schema: Car Taxation Renewal

Relation: Owner

Attributes:

Owner_ID int (6) NOT NULL,

Forename char (10) NOT NULL,

Surname char (30) NOT NULL,

Street char (20),

Town char (20),

County char (10),

Phone_Number int (15)

Email char (30)

PRIMARY KEY: Owner_ID

Page 5: Data modelling

Relation: Vehicle

Attributes:

RegNo char (15) NOT NULL,

Make char (20) NOT NULL,

Model char (20) NOT NULL,

Colour char (10) NOT NULL,

NRD char (10) NOT NULL,

PIN int (5)

PRIMARY KEY: RegNo

FOREIGN KEY: RegNo references RegOwner

Page 6: Data modelling

Relation: Payment

Attributes:

Payment_Id int (6) NOT NULL,

Pay_Date char (10) NOT NULL,

Amount int (6) NOT NULL,

Method char (20) NOT NULL,

Type char (10)

PRIMARY KEY: Payment_Id

FOREIGN KEY: RegNo references Vehicle

Page 7: Data modelling

Relation: Licence Authority

Attributes:

LA_Code int (5) NOT NULL,

Description char (15),

PRIMARY KEY: LA_Code

FOREIGN KEY: RegNo references Vehicle

Page 8: Data modelling

Relation: RegOwner

Attributes:

RegOwnerDate char (10) NOT NULL,

Owner_ID int (10) NOT NULL,

RegNo char (15) NOT NULL,

Forename char (10),

Surname char (30),

Street char (20),

Town char (20),

County char (10),

PRIMARY KEY: RegOwnerDate, Owner_ID, RegNo

FOREIGN KEY: Owner_ID references Owner

Page 9: Data modelling

Relation: Assessment

Attributes:

Ass_Code int (6),

Description char (20),

R3 int (6),

R6 int (6),

R12 int (6)

PRIMARY KEY: Ass_Code

FOREIGN KEY: RegNo references Vehicle

Page 10: Data modelling

QUESTIONS?