i’ve an issue with this code. I am simply studying SQL and that i dont know the right way to clear up this concern. Please assist
CREATE TABLE make investments
(
id
int(11) NOT NULL,
identifier
varchar(40) COLLATE utf8mb4_bin NOT NULL,
quantity
float NOT NULL,
price
float NOT NULL,
job
varchar(50) COLLATE utf8mb4_bin NOT NULL,
lively
tinyint(1) NOT NULL DEFAULT ‘1’,
created
datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
offered
datetime DEFAULT NULL,
soldAmount
float DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
ALTER TABLE make investments
ADD PRIMARY KEY (id
);
ALTER TABLE make investments
MODIFY id
int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;COMMIT;
CREATE TABLE corporations
(
identify
varchar(50) COLLATE utf8mb4_bin NOT NULL,
label
varchar(50) COLLATE utf8mb4_bin NOT NULL,
investRate
float DEFAULT NULL,
price
varchar(10) COLLATE utf8mb4_bin NOT NULL DEFAULT ‘stale’
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
INSERT INTO corporations
(identify
, label
, investRate
, price
) VALUES
(’24/7′, ‘TNYFVN’, NULL, ‘stale’),
(‘Ammu-Nation’, ‘AMNA’, NULL, ‘stale’),
(‘Augury Insurance coverage’, ‘AUGIN’, NULL, ‘stale’),
(‘Downtown Cab Co.’, ‘DCC’, NULL, ‘stale’),
(‘ECola’, ‘ECLA’, NULL, ‘stale’),
(‘Fleeca’, ‘FLCA’, NULL, ‘stale’),
(‘Globe Oil’, ‘GLBO’, NULL, ‘stale’),
(‘GoPostal’, ‘GPSTL’, NULL, ‘stale’),
(‘Lifeinvader’, ‘LIVDR’, NULL, ‘stale’),
(‘Los Santos Air’, ‘LSA’, NULL, ‘stale’),
(‘Los Santos Customs’, ‘LSC’, NULL, ‘stale’),
(‘Los Santos Transit’, ‘LST’, NULL, ‘stale’),
(‘Maze Financial institution’, ‘MBANK’, NULL, ‘stale’),
(‘Put up OP’, ‘PSTP’, NULL, ‘stale’),
(‘RON’, ‘RON’, NULL, ‘stale’),
(‘Up-n-Atom Burger’, ‘UNAB’, NULL, ‘stale’),
(‘Weazel’, ‘NEWS’, NULL, ‘stale’);
ALTER TABLE corporations
ADD PRIMARY KEY (identify
);
COMMIT;