Large database design

database-design

I am new to database design and despite my research I can really only find basic examples on design which does not help for my situation.

Currently using MySQL

The problem I have is as follows:

I am building a site to manage aircraft information, then display that information and how it changes in the form of graphs (things like air speed, plane speed, wing tilt, ect ect).

At the moment I get all this data in CSV form, but different planes give different data (for example one plane might not have wing tilt).

At the moment all I have set up is a table with userID, username, and password.

The concept I do not understand is how I can store something like planeSpeed, especially since it would be a bunch of numbers because it is over the course of the flight (it gets a value every minute).

Also some users would have multiple planes.

So I am stuck visualizing this as a column would be airspeed and then have a ton of numbers in it?

Or would I somehow build a separate table for each plane and instead of userID I would have time?

Very unsure how to design this, any help or tips would be a huge help, sorry for sounding so inexperienced have never built more than a simple login before.

Best Answer

As user1786423 said in your question's comment, you will probably have a User table, an Aircraft table and a table for each type of measurement.

As a minimum, User would have an id, say idUser. I'd imagine there would be more static data about a user in there as well.

As a minimum, Aircraft would have an id, say idAircraft, and idUser. idUser would reference User.idUser. I'd imagine there would be more static data about an aircraft in there as well.

The AirspeedMeasurement table would have, based on your descriptions, columns like idAirspeedMeasurement, idAircraft, time, airSpeed. idAircraft would reference Aircraft.idAircraft.

You may want to have a parent table for all of the measurements. For example, an AircraftMeasurement table would have the columns idAircraftMeasurement, idAircraft, time. Then, the child tables would have a primary key that references idAircraftMeasurement, and wouldn't have to each store idAircraft and time.

An ER diagram would look something like this: enter image description here

Some sample data:

In this example Aircraft 1 records PlaneSpeedMeasurements and WingTiltMeasurements, whilst Aircraft 2 only records PlaneSpeedMeasurements. enter image description here

Let us know if something is unclear : ]