jeudi 30 juillet 2015

Making a hierarchy in sqlite

Here is my tables

CREATE TABLE sells( 'product_id' INT NOT NULL, 'alinea' INT, 'price' INT);

And

CREATE TABLE ger_sells( 'sells_product_id' INT, 'sells_alinea' INT, 'description' TEXT,

FOREIGN KEY('sells_product_id') REFERENCES sells (product_id) ON UPDATE CASCADE ON DELETE RESTRICT

FOREIGN KEY('sells_alinea') REFERENCES sells (alinea) ON UPDATE CASCADE ON DELETE RESTRICT);

I would like to do a something like this in query

product_id alinea

200

--------------a

--------------b

205 ---------1

206
--------------1
Maybe add description too. Is it possible to do in sqlite?

Aucun commentaire:

Enregistrer un commentaire