Following the Northwind example, whereas the data is imported, I would need to know how to create a "table" AND I know this is NOT a term used in Neo4j.
You're currently returning the node record by saying RETURN n in your Cypher.
If you want to instead return individual properties the result will be closer to looking like a table (and can be accessed as such programmatically as well).
ie:
MATCH
(n:Supplier)
RETURN
n.country AS country,
n.contactName AS name,
n.contactTitle AS title,
n.phone AS phone
etc
That'll give you one row in the response for each :Supplier node and will include the properties ad individual columns.
This (RETURN) would create the individual columns? As in the example the data is imported, I want to create a new table. Is it better to create a new table with thousands of rows OUTSIDE of Neo4j? Then import it? I was hoping to be able to create a new table with thousands of rows/records using Cypher.
Neo4j isn’t designed to store data in a tabular format. It’s intended to store Nodes and Relationships between those Nodes. Both Nodes and Relationships can have properties on them. Thus it’s possible to import any type of data (including tabular data), but it excels at highly related data.
You can use LOAD CSV to import tabular data, though you’ll need to map it to nodes and relationships during the import.
@ryan.boyd Thank you for your time and quick replies. I am trying to create a PURCHASE entity with 8 nodes/rows, with the 8th being a calculated node QUANTITY PURCHASED * UNIT PRICE.
Once I create and populate this entity, then I need to create a USAGE/SALES entity.
@ryan.boyd Companies like Amazon, Walmart, etc... has consumer data with name, address, city, etc... then connects various activities / relationships to that data. I am trying to do the same with the relationship being an inventory relationship based on an action / activity.
Q: I know how to create a NODE which is ONE row (record?), but not how to create multiple rows (records?).
You have to create one node for each row as each row in your table will have a different supplier id;
//row 1....
CREATE (s:Supplier {supplierid: 1, name:"Exotic Liquids'})
//row 2.....................
CREATE (s1:Supplier {supplierid: 2, name:"Clear Liquids'})
Q: The data is transactional relationship related, FIFO, whereas Purchases are related to Usage in calculating current inventory and value.
FIFO (First In First Out) applies to purchases or suppliers?
Also I do not see SupplierID in your 'Purchase' node. How do you connect purchase order with supplier id?
@ameyasoft Thank you for your kindness. I am creating the FIFO tables in MySQL with an HTML front end to perform the calculations, then hope to port MySQL over to Neo4j just as the Northwind example.
Neo4j is said to be faster and more stable than MySQL could ever be, thus the necessity of the move. I believe there are many applicable backend challenges that Neo4j can apply, especially with transactional relationship calculations, which is FIFO. May I please take you up on your offer and communicate back upon the completion of the back end three MySQL tables?
@ameyasoft supplier is not of my making, as such no supplierID. Yes, the two keys would be necessary to connect the two "tables" / collection of "nodes". I am setting up the same in MySQL with a html front end. Q. I need to create data input fields (html front) to Neo4j (back), have you seen any instructions of how to do so?