dimanche 13 mars 2016

SQLite select data from multiple tables

I need to fetch data from multiple tables but cannot make a query for that. Any help in this regard will be appreciated. There are some questions already posted about how to fetch data from multiple tables, but somehow i cannot grab the concept behind such query. Therefore i am posting question to ask if someone can build a query for me with the following details:

Tables:

CREATE TABLE users(id INTEGER PRIMARY KEY,user_name TEXT)
CREATE TABLE category(id INTEGER PRIMARY KEY,name TEXT,user_id INTEGER)
CREATE TABLE item(id INTEGER PRIMARY KEY,name TEXT,category_id INTEGER)
CREATE TABLE Used(id INTEGER PRIMARY KEY,frequency REAL,item_id INTEGER)

A user may have multiple categories and each category may have multiple items, and each item may have multiple frequency of use.

I want to select: all categories of a user, all items of those categories and all frequencies of those items.

Thanks.

Aucun commentaire:

Enregistrer un commentaire