Skip to content

Instantly share code, notes, and snippets.

@viniciusmelocodes
Created November 20, 2021 03:45
Show Gist options
  • Save viniciusmelocodes/d74e075946b8e1cc890927d3a0ca228c to your computer and use it in GitHub Desktop.
Save viniciusmelocodes/d74e075946b8e1cc890927d3a0ca228c to your computer and use it in GitHub Desktop.
CREATE TABLE IF NOT EXISTS tab_treeview (
id int(12) NOT NULL AUTO_INCREMENT,
name varchar(255) NOT NULL,
title varchar(255) NOT NULL,
parent_id varchar(12) NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7;
INSERT INTO tab_treeview (id, name, title, parent_id) VALUES
(1, 'Mumbai', 'The Film City', '3'),
(2, 'New Delhi', 'Capital of India', '3'),
(3, 'India', 'Country', '0'),
(4, 'United States', 'Country', '0'),
(5, 'Washington', 'Popular City of US', '4'),
(6, 'New York', 'Popular City of US', '4'),
(7, 'Olympia', 'Capital of Washington', '5');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment