|
|
||
|---|---|---|
| database.sql | ||
| ER_Diagram.png | ||
| ER_Diagram_Attributes.png | ||
| ER_Diagram_Update.png | ||
| LICENSE | ||
| README.md | ||
Databaskonstruktion-Assignment-1-Startup
Startup code for first assignment in Databaskonstruktion
OVERVIEW
I'm working with variant D for this assingment which is Groupleaders. For this assingment i will design a database after the requirements that a groupleader should able to find and get out information from the datbase. After the design i will implement my design into a physical database and also insert data that will help me test my database solution to see if it follows the reuirements and that you are also able to get out the ask for information from it. After this is accomplised i will implement a interface so the groupleader to be able to get said information out of the database in a easy way without having to fiddle around with the database themselfs when they most likely wont have enough computer experience for this and also it will slow down the operation if they need to get critical information out. Here follows my design, a picture of a crude drawing of my model, the realtions in the database that i ahve picked out and then the requirements i have taken from the assignment text. After my final design draft i will mark any changes that i find that i need to implement or if i find my current solutions is not working good enough.
ER-MODEL
A picture of the current ER model of my design with entites, relations and the attributes. Updated from the previous two diagrams(see png in the same folder). Missing the M to N entites to keep the diagram smaller.
RELATIONS
Agent(Name,Number, Salary, Username, Comments)
AgentInUse(AgentName,AgentNumber, OperationCode,OperationDate,)Incidentidentifier
Operation(CodeNameType, StartDate, IncidentIdentifier, EndDate, Comment, SuccesRate,Groupleader)
AidMaterials(Name,Number,Description)
AidMaterialInUse(AidName,AidNumber,OperationName, OperationStartDate,IncidentIdentfier)
Incident(Name,Number,Location, Region)
Report(Datum,Title,BelongsToIncident)
ReportClosure(ReportDatum,ReporTitle Comment , Typ)
ReportRow(Nr,ReportDatum,ReportTitle, Text)
REQUIREMENTS
Here follow some requirements i have taken from the assignment text that are associated with a groupleader that i need to design my database after to be able to accommodate them. As the datbase is oriented around a Groupleader they need to be able to keep track of operation they are leading and to assign aid materials and personal to an operation. They should also be able to change different parameters for an operation and reshedculed it if works. They should also be able to write reports for an operation in the form of a closure report.
AGENT
- A groupleader can only lead 2 operation at the same time if its not the same incident.
- A groupleader can lead up to 5 operation at the same time if they all belong to the same incident
- A groupleader can make up to 35000.
- Only a groupleader can have a zero as assigned number.
- 13 is not allowed as agent number or above 99.
- Should be able to calculate the number of successful operations a groupleader have been assigned to.
OPERATION
- A operation must have a end date when its made but should be able to change at later date.
- End date need to later than start date.
- A operation needs to be longer than a day.
- Cant be longer than 5 weeks.
- Need to have a groupleader assigned and only one.
- Can have same code name type if on different dates.
- The Success rate needs to be 1 for success or 0 for failure nothing else.
AIDMATERIALS
- Should be able to remove aids if the break or disapear during and operation.
- A groupleader should be the only one able to remove aid used in a operation they lead.
- Aids of ceratin types need a number attached to it.
- An aid can't have a number above 15 or lower than 1 else it should counts as wrong.
AIDMATERIALSINUSE
- An aid material can only be used in one operation at the time.
- An operation can have many aid materials.
INCIDENT
- A incident must have a region.
- Identifies by unique name or unique number.
- Should be able to calculate a median of incidents all observation grades.
REPORT
-
Need to be able to classify a report and also able to unclassify it by using a log.
-
Need to remove all rows and follow up reports if a report
REPORTCLOSURE
- Can have a comment of max 25 characters.
REPORTROW
- Need to be able to clssify only certain rows of a report.
