Jump to content

Run SQL query/queries on server


tinkertron

Recommended Posts

I don't know much about MySQL. I do know how to create a db, but not tables. The whole VARCHAR and DATE and all that mobojambo has given me a headache. So i'm asking for help. Not sure is this is some quick and easy, or if I should be paying someone to do it, but I'll ask nicely, please. Here's what i'm looking for.

 

Officer Name  > 15 Characters

AssignmentDate  > MM/DD/YY

LastName > 15 Characters

FirstName > 15 Characters

StateID > 0#######

TDCJID > 0#######

InstantOffense > 40 Characters

DischargeDate > MM/DD/YY

ArrestDate > MM/DD/YY

BookingNumber > ########

Allegation1 > 40 Characters

Allegation2 > 40 Characters

Allegation3 > 40 Characters

Allegation4 > 40 Characters

Allegation5 > 40 Characters

Allegation6 > 40 Characters

Allegation7 > 40 Characters

Allegation8 > 40 Characters

Allegation9 > 40 Characters

OffenseType > 5 Characters

CourtDate > MM/DD/YY

InterviewDate > MM/DD/YY

HearingDate > MM/DD/YY

HearingType > 14 Characters

BoardDate > MM/DD/YY

BoardDecision > 11 Characters

Status > 30 Characters

 

Thank you...

Link to comment
Share on other sites

Hi

 

Most of that would either be VARCHAR (you already have the max lengths) or INTEGER (just validate them before inserting them to check they are in the range you accept). Do not store the dates in MMDDYY format as it is pretty useless for anything except display to some people (at least if it is stored in YYYYMMDD format it can easily be sorted). Store it as a date field in the database and convert it to the format you want to display in your script to read the database.

 

All the best

 

Keith

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.