我有一个数据记录应用程序,我已经创建了一个表,如下所示 -
CREATE TABLE IF NOT EXISTS `waterheater`.`heatertest550001_data`
` (
`Index_Records` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`Time_Stamp` DATETIME DEFAULT NULL,
`Water_Temperature` FLOAT DEFAULT NULL,
`Body_Temperature` FLOAT DEFAULT NULL,
`Body_Shell_Top_Temperature` FLOAT DEFAULT NULL,
`Body_Shell_Bottom_Temperature` FLOAT DEFAULT NULL,
`Ambient_Temperature` FLOAT DEFAULT NULL,
`Voltage` FLOAT DEFAULT NULL,
`Current` FLOAT DEFAULT NULL,
`Wattage` FLOAT DEFAULT NULL,
`Energy` FLOAT DEFAULT NULL,
`Power_Factor` FLOAT DEFAULT NULL,
`Notice` VARCHAR(45) DEFAULT NULL,
`LVTIMESTAMP` DOUBLE DEFAULT NULL,
PRIMARY KEY (`Index_Records`),
UNIQUE INDEX `INDEX_UNIQUE` (`Index_Records`)
) ENGINE=INNODB DEFAULT CHARSET=UTF8;
要附加相同表格的信息,我要创建另一个表格,如下所示 -
CREATE TABLE IF NOT EXISTS `waterheater`.`heatertest550001_info` (
`Index_Records` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`ReportNumber` VARCHAR(45) DEFAULT NULL,
`ProjectNumber` VARCHAR(45) DEFAULT NULL,
`TestDiscipline` VARCHAR(45) DEFAULT 'Electrical',
`Customer` VARCHAR(45) DEFAULT NULL,
`Manufacturer` VARCHAR(45) DEFAULT NULL,
`Program` VARCHAR(45) DEFAULT 'NABL',
`TestLabLocation` VARCHAR(45) DEFAULT '(b)UL Manesar',
`ItemUnderTest` VARCHAR(45) DEFAULT 'Storage Electrical Water Heater',
`Model` VARCHAR(45) DEFAULT NULL,
`NumberOfSamples` VARCHAR(45) DEFAULT NULL,
`SampleIdentification` VARCHAR(45) DEFAULT NULL,
`ManufacturerSerialNumber` VARCHAR(45) DEFAULT NULL,
`IUTCondition` VARCHAR(45) DEFAULT NULL,
`DateOfReceipt` DATETIME DEFAULT NULL,
`ApplicableStandard` VARCHAR(45) DEFAULT 'IS2082:1993 & IS 302-2-21:1992',
`DateOfTestingStartDate` DATETIME DEFAULT NULL,
`DateOfTestingStopDate` DATETIME DEFAULT NULL,
`DurationSecondsOfTesting` FLOAT DEFAULT NULL,
`DurationTestText` VARCHAR(45) DEFAULT NULL,
`LabAmbientTemperature` FLOAT DEFAULT '23',
`LabAmbientHumidity` FLOAT DEFAULT '70',
`DateOfReporting` DATETIME DEFAULT NULL,
`TestIncharge` VARCHAR(45) DEFAULT NULL,
`GeneralRemarks` VARCHAR(45) DEFAULT NULL,
`IUTRatedVoltage` FLOAT DEFAULT NULL,
`IUTRatedCurrent` FLOAT DEFAULT NULL,
`IUTRatedFrequency` FLOAT DEFAULT NULL,
`IUTRatedPower` FLOAT DEFAULT NULL,
`IUTRatedCapacity` FLOAT DEFAULT NULL,
`IUTApplianceSort` VARCHAR(45) DEFAULT 'Class 1',
`IUTRatedWaterProofDegree` VARCHAR(45) DEFAULT 'IP X4',
`IUTRatedPressure` FLOAT DEFAULT '0.80',
`IUTApplianceType` VARCHAR(45) DEFAULT NULL,
`IUTRatedStandingLoss` FLOAT DEFAULT NULL,
`CalcWaterTemperature` FLOAT DEFAULT NULL,
`CalcAmbientTemperature` FLOAT DEFAULT NULL,
`CalcVoltage` FLOAT DEFAULT NULL,
`CalcCurrent` FLOAT DEFAULT NULL,
`CalcFrequency` FLOAT DEFAULT NULL,
`CalcPower` FLOAT DEFAULT NULL,
`CalcCapacity` FLOAT DEFAULT NULL,
`CalcApplianceSort` VARCHAR(45) DEFAULT 'Class 1',
`CalcRatedWaterProofDegree` VARCHAR(45) DEFAULT 'IP X4',
`CalcPressure` FLOAT DEFAULT '0.80',
`CalcApplianceType` VARCHAR(45) DEFAULT NULL,
`CalcStandingLoss` FLOAT DEFAULT NULL,
`CalcStandingLossRate` FLOAT DEFAULT NULL,
`CalcStandingLoss24h` FLOAT DEFAULT NULL,
`EnergyConsumptionTest` FLOAT DEFAULT NULL,
`EnergyConsumption24h` FLOAT DEFAULT NULL,
`MaxRecords` FLOAT DEFAULT NULL,
PRIMARY KEY (`Index_Records`),
UNIQUE KEY `Index_Records_UNIQUE` (`Index_Records`)
) ENGINE=INNODB DEFAULT CHARSET=UTF8;
我确定必须有更好的方法来做到这一点。有人可以帮忙!并谢谢。