Let's start a new assignment project together, Get Exclusive Free Assistance Now!

Need Help? Call Us :

Place Order

HS2021 Database Design And Use

Mar 13,23

Question:

Assignment Description: In this assignment you will use the given case study (Case Study: City Jail) to design a database. You need to analyse the case study to identify database requirements and design a complete E-R Diagram in 3NF form. You will create tables using SQL in Oracle 12c based on your E-R Diagram.

Case Study: City Jail .
Your company receives the following memo. MEMO To: Database Consultant From: City Jail Information Director Subject: Establishing a Crime-Tracking Database System It was a pleasure meeting with you last week. I look forward to working with your company create a much needed crime-tracking system. As you requested, our project group has outlined the crime-tracking data needs we anticipate. Our goal is to simplify the process of tracking criminal activity and provide a more efficient mechanism for data analysis and reporting. Please review the data needs outlined below and contact me with any questions. Criminals: Name, address, phone number, violent offender status (yes/no), probation status (yes/no) and aliases.
Crimes: classification (felony, misdemeanour, other), date charged, appeal status (closed, can appeal, in appeal), hearing date, appeal cutoff date (always 60 days after the hearing date), arresting officers (can be more than one officer), crime codes (such as burglary, forgery, assault; hundreds of codes exist), amount of file, court fee, amount paid, payment due date, and charge status( pending, guilty, not guilty) Sentencing: start date, end date, number of violations (such as not reporting to probation officer), and type of sentences (jail period, house arrest, probation) Appeals: appeal filling date, appeal hearing date, status (pending, approved and disapproved) Note: Each crime case can be appealed up to three times. Police officers: name, precinct, badge number, phone contact, status (active/inactive).
Additional notes:
A single crime can involve multiple crime charges, such as burglary and assault.
Criminals can be assigned multiple sentences. For example, a criminal might be required to serve a jail sentence followed by a period of probation. HS2021 Database Design and Use Trimester 1 2018 2 Assignment requirements:
Create an Entity Relationship Diagram based on the memo. The E-R Diagram should include entities, attributes (columns), primary keys, and relationships between the entities. Make sure your E-R Diagram is normalised to Third Normal Form and is ready to be deployed in Oracle 12c SQL developer.
Create all the tables using SQL queries in Oracle 12c SQL developer. Make sure tables are created with attributes and constraints (i.e. PRIMARY KEY, FOREIGN KEY, CHECK constraints, etc.)
Execute all SQL queries in Oracle SQL developer 12c to implement the “City Jail” database in Oracle 12c. Please ensure all tables are created without errors.
Report structure and assignment submission:
1. Content of your report
a. Prepare a report which will detail an E-R diagram and justification your choice of entities and attributes.
b. Explain the normalization process of the ER diagram in details.
c. Write down all the assumptions you have considered while preparing the ER diagram.
d. Include all the CREATE TABLE statements in the Appendix.
2. Assignment Submission Guideline: You need to submit one Word document on Blackboard
3. Assignment Date Due: Friday Week 6 Friday by 5:00 PM Marking Guide: Assignment components marks Quality of ERD 30% Quality of other report tasks (normalisation process, assumptions) 20% Quality of CREATE TABLE statements 50% TOTAL 100%

Answer:

Introduction

Assignment

Database

City Jail Case Study

Table of Contents

Title Page No
ERD Diagram 3
SQL Table Creation 4
Conclusion 7
References 8
Appendix 9

ERD Diagram

The ERD Diagram for the given case study related with city jail is shown below:

SQL Tables creation

Create table Aliases( Alias_id int, Criminal_id int, Alias

Varchar(15)

);

Create table Criminals( Criminal_id int, Last Varchar(10), First Varchar(10),

Street Varchar(10), City Varchar(10),

State Varchar(20),

Zip char(30),

Phone char(40),

V_Status char(2) default ‘n’ constraint Criminals_V_Status_Ck check(V_Status=’y’ or V_Status=’N’),

P_Status char(2) default ‘n’ constraint Criminals_P_Status_Ck check(P_Status=’y’ or P_Status=’n’)

);

Create table Crimes( Crime_id int, Criminal_id int,

Classification char(2) Constraints Crime_Classification_Ck check(Classification in(‘f’, ‘m’, ‘o’, ‘u’)),

Status char(3) Constraints Crimes_Status_Ck check(Status in(‘cl’, ‘ca’, ‘ia’)),

Hearing_Date date, Appeal_Cut_Date DATE

);

Create table Sentences( Sentence_id int, Criminal_id int, Prob_id int, Violations int,

Type char(2) constraint Sentences_Type_Ck check(type in(‘j’, ‘h’, ‘p’)), Start_Date date,

End_Date date

);

create table Prob_Officers( Prob_id int,

Last varchar(10), First varchar(15),

Street varchar(50), City varchar(60),

State varchar(6), Zip char(7),

Phone char(15), Email char(20),

Status varchar(2) Default ‘a’ constraint Prob_Officers_Status_Ck check Status in(‘a’, iI’)),

Mgr_id int

);

create table Crime_Charges(

Charge_Id int, Crime_Id int, Crime_Code int,

Charge_Status char(1) constraint Crime_Charges_Status_Ck check(Charge_Status in(‘pd’, ‘gl’, ‘ng’)),

Court_Fee Decimal(8,9), Fine_Amount

Decimal(8,9), Amount_Paid Decimal (8,9), Pay_Due_Date date

);

Create Table Crime_Officers( Crime_Id int, Officer_Id int

);

create table Officers( Officer_Id int, Last varchar(1), First varchar(10), Badge varchar(12),

PrecInt char(3), Phone char(10),

Status char(2) default ‘a’ constraint Officers_Status_Ck check(Status in(‘a’,

‘i’))

);

create table Appeals( Appeal_Id int, Crime_Id int, Filling_Date date, Hearing_Date date,

Status char(2) default ‘p’ constraint Appeals_Status_Ck check(Status in(‘p’, ‘a’, ‘d’))

);

create Crime_Codes( Crime_Code int, Code_Description varchar(25)

)

Conclusion

The above assignment was based on creating ERD Diagram and writing SQL queries for city jail case study.

References

Al-Masree, H. K. (2015). Extracting Entity Relationship Diagram (ERD) From Relational Database Schem. International Journal of Database Theory and Application, 8(3), 15–26. https://doi.org/10.14257/ijdta.2015.8.3.02

Diederich, J., & Milton, J. (1988). New methods and fast algorithms for database normalization. ACM Transactions on Database Systems (TODS), 13(3), 339–365. https://doi.org/10.1145/44498.44499

S.N, K. (2020). Tuning SQL Queries for Better Performance. International Journal of Psychosocial Rehabilitation, 24(5), 7002–7005. https://doi.org/10.37200/ijpr/v24i5/pr2020703

Appendix

Normalization Table

0 responses on "HS2021 Database Design And Use"

Leave a Message

Your email address will not be published. Required fields are marked *