MySQL: Neo4J
create table customer (id int,name varchar(100));
insert into customer values (1, 'Rachel');
create table creditcard (id int, number varchar(16));
insert into creditcard values (101, '1234567890123456');
create table merchant (id int, name varchar(100));
insert into merchant values (1001, 'Macys');
Set Relation
create table customer_creditcard (id int, cust_id int, cc_id int)
insert into customer_creditcard values (999, 1,101)
create table transaction (id int, customer_cc_id int, amount float, ts datetime);
insert into transaction(111, 999, 100.00, '2023-01-01 11:23:34')
Clear all nodes
match(n) detach delete n
CREATE (rachel:Customer {name: 'Rachel'})
CREATE (card1:CreditCard {number: '1234567890123456'})
CREATE (macys:Merchant {name: 'Macys'})
CREATE (rachel)-[:OWNS]->(card1)
CREATE (tx1:Transaction {amount: 100, timestamp: datetime()})
CREATE (card1)-[:USED_IN]->(tx1)-[:MADE_AT]->(macys)
Last updated