从脚本创建关系图



我有一个经过大量计算的长脚本,我想跟踪列的来源。例如列";标识符";以及";concat_var";在下例的表z中。我可以这样做吗;自动地";以某种方式呈现在图表中?

-- borrowed from https://stackoverflow.com/q/7745609/808921
CREATE TABLE IF NOT EXISTS `docs` (
`id` int(6) unsigned NOT NULL,
`rev` int(3) unsigned NOT NULL,
`content` varchar(200) NOT NULL,
PRIMARY KEY (`id`,`rev`)
) DEFAULT CHARSET=utf8;
INSERT INTO `docs` (`id`, `rev`, `content`) VALUES
('1', '1', 'The earth is flat'),
('2', '1', 'One hundred angels can dance on the head of a pin'),
('1', '2', 'The earth is flat and rests on a bull's horn'),
('1', '3', 'The earth is like a ball.');
CREATE TABLE x (
SELECT * FROM docs WHERE rev = 1);

CREATE TABLE y (
SELECT * FROM docs WHERE rev != 1);
CREATE TABLE z (
SELECT
CONCAT(a.content, ' - ', b.content) AS concat_var
, a.id AS identifier
FROM
x AS a
INNER JOIN
y AS b
ON
a.id = b.id);

市场上很少有这样的产品:https://dbmstools.com/categories/data-dictionary-tools/redshift

最新更新