You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
498 B

DROP TABLE IF EXISTS facture;
CREATE TABLE facture (
numfacture INT NOT NULL AUTO_INCREMENT,
numtable INT NOT NULL,
numserveur INT NOT NULL,
datefacture DATE NOT NULL,
PRIMARY KEY (numfacture)
);
LOAD DATA LOCAL INFILE './cafe/facture.csv' INTO TABLE facture
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 LINES
(
numfacture,
numtable,
numserveur,
@datefacture
)
SET datefacture = STR_TO_DATE(@datefacture, "%d-%b-%y");
-- TODO: other tables