When creating a new batch of records, using Excel then exporting as CSV which is much shorter than creating MySQL then exporting is this a best practice?
Should there not be a column for auto increment index? As in the Northwind import there existed indexes and foreign keys.
I need to create three tables, PURCHASE connects to SALES, and a third SUMMARY table that populates with data from the first two with calculated columns.
- purchaseid (integer auto incremented)
- purchaseinv (varchar 20)
- purchaseymd (date)
- purchasebank (varchar 20)
- purchasetier (varchar 20)
- purchasepoints (integer 20)
- purchasecost (decimal 6,6)
- purchasetotal (decimal 13,6)
LOAD CSV WITH HEADERS FROM "path/filename.csv" AS ROW
SET p = row,
p.purchaseid = toInteger(row.purchaseid),
p.purchaseinv = toInteger(row.purchaseinv),
p.purchaseymd = toDate(row.purchaseymd),
p.purchasebank = toVarchar(row.purchasebank),
p.purchasetier = toVarchar(row.purchasetier),
p.purchasepoints = toInteger(row.purchasepoints),
p.purchasecost = toDecimal(row,purchasecost),
p.purchasetotal = (row.purchasepoints * row.purchasecost)
How would I set the number of digits and decimals?
Would one modify each individual field attributes using SET?
CREATE INDEX ON :Purchase(purchaseid)