0

I'm currently learning MySQL, and I have a learning project to do. I have to build 4 tables that all have information about a certain object. Is it ok for each table to have the same primary key?

This is the code I have written so far

CREATE TABLE main_table(
    PA_ID INT PRIMARY KEY AUTO_INCREMENT,
    model_number VARCHAR(20),
    freq_low DECIMAL(3,1),
    freq_high DECIMAL(3,1),
    gate_len DECIMAL (3,2),
    psat DECIMAL (3,1),
    PAE DECIMAL (3,1),
    gain DECIMAL(3,1),
    powr DECIMAL (3,1),
    chip_dim VARCHAR(20),
    chip_size VARCHAR(20),
    chip_thickness INT,
    pad_dimen VARCHAR(20)
)
CREATE TABLE max_rating(
    PA_ID INT PRIMARY KEY AUTO_INCREMENT,
    parameter VARCHAR(20),
    parameter_desc VARCHAR(40),
    min DECIMAL(5,1),
    max DECIMAL(5,1),
    unit VARCHAR(10)
)
CREATE TABLE recc_rating(
    PA_ID INT PRIMARY KEY AUTO_INCREMENT,
    parameter VARCHAR(20),
    parameter_desc VARCHAR(40),
    value DECIMAL(4,1),
    unit VARCHAR(10)
)

In this situation, the PA_ID would be the primary key of the three tables. Is that ok? Additionally, how would I be able to link all three tables?

Ryan L
  • 1
  • 1

0 Answers0