[sql] завод
Viewer
- CREATE TABLE Table_И (
- Column_К_ INT NOT NULL,
- Column_Н_ VARCHAR NOT NULL,
- Column_К__ INT NOT NULL,
- Column_П__ VARCHAR NOT NULL,
- Column_С_ VARCHAR NOT NULL,
- Column_Б_ VARCHAR NOT NULL,
- PRIMARY KEY (Column_К_)
- );
- CREATE UNIQUE INDEX изделия_idx
- ON Table_И
- ( Column_К_ );
- CREATE TABLE Table_Ц (
- Column_К_ INT NOT NULL,
- Column_Н_ VARCHAR NOT NULL,
- Column_К_ INT NOT NULL,
- PRIMARY KEY (Column_К_)
- );
- CREATE TABLE Table_З (
- Column_К_ INT NOT NULL,
- Column_К_ INT NOT NULL,
- PRIMARY KEY (Column_К_)
- );
- ALTER TABLE Table_З ADD CONSTRAINT изделия_заказы_fk
- FOREIGN KEY (Column_К_)
- REFERENCES Table_И (Column_К_)
- ON DELETE NO ACTION
- ON UPDATE NO ACTION;
- ALTER TABLE Table_Ц ADD CONSTRAINT изделия_цех_fk
- FOREIGN KEY (Column_К_)
- REFERENCES Table_И (Column_К_)
- ON DELETE NO ACTION
- ON UPDATE NO ACTION;
Editor
You can edit this paste and save as new: