Loading color scheme

CREATE Statement

Boston v5.3 will support the CREATE statement and as below:

The CREATE statement is used to insert new rows/tuples into your database.



CREATE <NodePropertyIdentification> (THAT <PredicateNodePropertyIdentification> (AND <PredicateNodePropertyIdentification>)*)?

<PredicateNodePropertyIdentification> := <Predicate> <NodePropertyIdentification>


Target Model Element

The first not property identification is for the model element that you want to create an instance of in the database. E.g. CREATE (Issue:'1') ... will create an instance of the Issue model element in the database.

NB If the target model element/first node property identification, e.g. '1' in (Issue:'1') has a data type of AutoCounter, regardless of what value you supply if the primary key for the model element is AutoCounter and the model element has one field as the primary key, the next number in sequence for the primary key of that model element will be found and used.

To explicitly specify the value to be used for the primary key of the target model element in a CREATE statement, use the caret symbol, ^, as in (Issue^6).


Node Property Identification and the CREATE statement

Unless the caret symbol, ^, is used in a node property identification, the identification value/s will be used to find a value in the primary unique index/key for the specified model element. The subsequent primary key of the instance of the model element will be used when inserting the appropriate value in the database for that model element.

E.g. In the example below, (Person:'Cathy') refers to an instance of the model element, Person. If the primary key value for that instance is  7, say, then 7 will be the value stored against the new Issue instance for the relationship 'was authored by'.
This makes it easy to reference an instance of a model element by its primary unique key value/s. To explicitly specify 7, say, for the instance, use the caret symbol as in (Person^7).

NB If the primary unique index has more than one field, append those with a comma between each identifier in a property node identification. E.g. (Person:'Cathy','Jones').
The order of the identifiers in a property node identification is taken from the ordinal position of the corresponding attribute/s in the corresponding table in the Entity Relationship view of the schema, and similarly the corresponding ordinal position of the corresponding properties for the node in the related Property Graph Schema for the given model element.