MySQL made Easy for Engineers / Technologists
Automation, Control & Plant Intelligence - Articles, Analysis, Reviews, Interviews & Views
Create Table in MySQL
In any relational database or MySQL, the goal is to store information in an Orderly fashion. The table gets this done by making the table up of columns and rows.
The columns specify what the data is going to be, while the rows contain the actual data.
Below is how you could imagine a MySQL table.
(C = Column, R = Row)
Example:
CREATE TABLE Alarms(AlarmID INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(AlarmID), OperName VARCHAR(30), NodeIP INT)
C1(OperatorName) | C2(AlarmAckTime) | C3(NodeName) | C4(IPAddress) | |
R1(data row 1) | R1C1(data) | R1C2(data) | R1C3(data) | R1C4(data) |
R2(data row 2) | R2C1(data) | R2C2(data) | R2C3(data) | R2C4(data) |
R3(data row 3) | R3C1(data) | R3C2(data) | R3C3(data) | R3C4(data) |
R4(data row 4) | R4C1(data) | R4C2(data) | R4C3(data) | R4C4(data) |