
CREATE TABLE Customers (
    CustomerID INTEGER PRIMARY KEY,
    Name TEXT NOT NULL,
    Age INTEGER,
    City TEXT
);

CREATE TABLE Orders (
    OrderID INTEGER PRIMARY KEY,
    CustomerID INTEGER,
    OrderDate TEXT,
    TotalAmount REAL,
    FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID)
);

CREATE TABLE Products (
    ProductID INTEGER PRIMARY KEY,
    Name TEXT NOT NULL,
    Price REAL
);

CREATE TABLE OrderDetails (
    OrderDetailID INTEGER PRIMARY KEY,
    OrderID INTEGER,
    ProductID INTEGER,
    Quantity INTEGER,
    FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
    FOREIGN KEY (ProductID) REFERENCES Products(ProductID)
);


INSERT INTO Customers (CustomerID, Name, Age, City) VALUES
(1, 'Kovács István', 34, 'Budapest'),
(2, 'Szabó Anna', 28, 'Debrecen'),
(3, 'Tóth Béla', 45, 'Szeged'),
(4, 'Nagy Katalin', 39, 'Miskolc'),
(5, 'Fekete Tamás', 50, 'Pécs'),
(6, 'Kiss László', 29, 'Győr'),
(7, 'Molnár Éva', 41, 'Sopron'),
(8, 'Balogh Zoltán', 37, 'Nyíregyháza'),
(9, 'Lakatos Mária', 33, 'Szolnok'),
(10, 'Horváth Ferenc', 47, 'Eger');

INSERT INTO Orders (OrderID, CustomerID, OrderDate, TotalAmount) VALUES
(1, 1, '2024-01-10', 15000.50),
(2, 2, '2024-02-15', 12000.00),
(3, 3, '2024-03-12', 25000.75),
(4, 4, '2024-04-18', 18000.90),
(5, 5, '2024-05-05', 22000.00),
(6, 6, '2024-06-21', 30000.20),
(7, 7, '2024-07-30', 27000.45),
(8, 8, '2024-08-10', 19000.60),
(9, 9, '2024-09-05', 31000.80),
(10, 10, '2024-10-22', 14000.99);

INSERT INTO Products (ProductID, Name, Price) VALUES
(1, 'Laptop', 350000.00),
(2, 'Egér', 5000.00),
(3, 'Billentyűzet', 10000.00),
(4, 'Monitor', 70000.00),
(5, 'Nyomtató', 45000.00),
(6, 'Router', 25000.00),
(7, 'Pendrive', 8000.00),
(8, 'Webkamera', 15000.00),
(9, 'Fejhallgató', 12000.00),
(10, 'Számítógépház', 40000.00);

INSERT INTO OrderDetails (OrderDetailID, OrderID, ProductID, Quantity) VALUES
(1, 1, 1, 1),
(2, 1, 2, 2),
(3, 2, 3, 1),
(4, 2, 4, 1),
(5, 3, 5, 1),
(6, 3, 6, 1),
(7, 4, 7, 3),
(8, 4, 8, 1),
(9, 5, 9, 2),
(10, 5, 10, 1),
(11, 6, 1, 1),
(12, 6, 3, 2),
(13, 7, 2, 3),
(14, 7, 6, 1),
(15, 8, 4, 2),
(16, 8, 8, 1),
(17, 9, 5, 1),
(18, 9, 9, 1),
(19, 10, 7, 2),
(20, 10, 10, 1);
