CREATE TABLE cpu (
  id INTEGER PRIMARY KEY,
  manufacturer TEXT DEFAULT "unknown manufacturer",
  model TEXT NOT NULL UNIQUE,
  releasedyear TEXT DEFAULT 2025,
  bits TEXT DEFAULT "64 bit",
  igpu BOOL DEFAULT FALSE,
  igpusize TEXT DEFAULT "Unknown integrated Graphics",
  cores TEXT DEFAULT "Unknown cores",
  threads TEXT "Unknown threads",
  l1cache TEXT DEFAULT "unknown l1cache",
  l2cache TEXT DEFAULT "unknown l2cache",
  l3cache TEXT DEFAULT "unknown l3cache",
  pcielanes TEXT DEFAULT "unknown PCIE lanes",
  mainclock TEXT DEFAULT "unknown main clock speed",
  boostclock TEXT DEFAULT "unknown boost clock speed",
  architecture TEXT DEFAULT "x86_64",
  microcode TEXT DEFAULT "honeycomb UNKNOWN microcode",
  kerneldriver TEXT DEFAULT "unknown kernel driver",
  comment TEXT DEFAULT "no comment"
);

CREATE TABLE gpu (
  id INTEGER PRIMARY KEY,
  model TEXT NOT NULL UNIQUE,
  mainclock TEXT DEFAULT "unknown main clock speed",
  boostclock TEXT DEFAULT "unkown boost clock speed",
  ram TEXT NOT NULL,
  shadercores TEXT DEFAULT "unknown shader cores or N/A (AMD)"
);

INSERT INTO cpu(manufacturer, model, releasedyear, igpu, igpusize, cores, threads, l1cache, l2cache, l3cache, pcielanes, mainclock, boostclock, microcode, comment)
VALUES(          'AMD',     '7800x3d', 2024, true, '512 Mb', 8, 16, '64Kb per core', '1Mb per core', '96Mb (shared)', 'Gen 5 @ 24 lanes', '4.2 Ghz', '5.0 Ghz', '0x0a601209 as of 30 Jan, 2025', 'Must update MB firmware before posting this CPU');

-- SELECT * from cpu WHERE model='7800x3d'; -- will return all fields which match that "model" - since model is UNIQUE; it will be 1 result
-- UPDATE cpu SET manufacturer = 'new manufacturer' WHERE model='CPUMODEL' -- This will update the manufacturer for that model - VERY IMPORTANT to have WHERE = or it will UPDATE THE ENTIRE TABLE!!!
-- DELETE FROM cpu WHERE model='CPUMODEL' - this will delte an entry in the table "cpu" that matches model - VERY IMPORT to have a WHERE here or it wipes the whole table!

-- INSERT INTO cpu(model, mainclock) VALUES ('CPUMODEL', '3.0 Ghz'); -- This will create the model (REQUIRED) and mainclock fields set.
-- ALTER TABLE cpu ADD COLUMN vendor TEXT; -- this would add a field to the CPU table called vendor
-- DROP TABLE cpu -- this would delete the table cpu
