CREATE TABLE Customers(
       custNo TEXT PRIMARY KEY,
       name TEXT,
       born INTEGER, 
       bonus INTEGER, 
       address TEXT, 
       email TEXT
);

CREATE TABLE Products(
       number TEXT PRIMARY KEY, 
       prodName TEXT, 
       description TEXT, 
       price REAL,
       manufID TEXT
);

CREATE TABLE Manufacturers(
       ID TEXT PRIMARY KEY, 
       manufName TEXT, 
       phone TEXT
);

CREATE TABLE Orders(
       orderNo TEXT PRIMARY KEY, 
       deliver TEXT, 
       status TEXT, 
       custNo TEXT
);

CREATE TABLE BelongsTo(
       orderNo TEXT, 
       productNo TEXT, 
       count INTEGER,
       PRIMARY KEY (orderNo, productNo)
);

INSERT INTO Products
VALUES('T-33441', 'Samsung Galaxy A5', 'cellphone', 250.0, 'S123');
INSERT INTO Products
VALUES('R-55336', 'IPad Air 2', 'tablet', 495.0, 'M554');
INSERT INTO Products
VALUES('T-77445', 'Superstar Track M', 'jacket', 30.0, 'A432');
INSERT INTO Products
VALUES('S-65221', 'Brasserie 24', 'pan', 33.50,'F542');

INSERT INTO Manufacturers
VALUES('R122', 'Nike', '09-8011');
INSERT INTO Manufacturers
VALUES('M554', 'Apple', '09-5001');
INSERT INTO Manufacturers
VALUES('S123', 'Samsung', '020-7300');
INSERT INTO Manufacturers
VALUES('L711', 'Sony', '020-6500');
INSERT INTO Manufacturers
VALUES('F542', 'Fiskars', '020-43910');
INSERT INTO Manufacturers
VALUES('A432', 'Adidas', '09-70911');

INSERT INTO Customers
VALUES('112233', 'Teemu Teekkari', 1995, 55, 'Servinkuja 3', 'tteekkari@gmail.com');
INSERT INTO Customers
VALUES('554422', 'Riina Raksalainen', 1993, 43, 'Otaranta 8', 'riinar@yahoo.com');
INSERT INTO Customers
VALUES('37856', 'Antti Virta', 1970, 12, 'Aaltokatu 4', 'antti@hotmail.com');
INSERT INTO Customers
VALUES('77233', 'Nina Teekkari', 1991, 20, 'Servinkuja 3', 'nite@hotmail.com');

INSERT INTO Orders
VALUES('469666', 'Post', 'delivered', '112233');
INSERT INTO Orders
VALUES('469677', 'DHL', 'packed', '112233');
INSERT INTO Orders
VALUES('469688', 'Post', 'returned','37856');
INSERT INTO Orders
VALUES('469699', 'pickup', 'waiting', '37856');
INSERT INTO Orders
VALUES('469700', 'Post', 'returned','77233');

INSERT INTO BelongsTo
VALUES('469666', 'T-33441', 1);
INSERT INTO BelongsTo
VALUES('469666', 'S-65221', 2);
INSERT INTO BelongsTo
VALUES('469688', 'T-77445', 3);
INSERT INTO BelongsTo
VALUES('469699', 'T-33441', 1);
