create database Team;

use Team;

CREATE TABLE member (
    m_id int NOT NULL,
    mname char(40) NOT NULL,
    mcity char(40),
    mmail char(8ß0) UNIQUE,
    PRIMARY KEY (m_id)
);

#

INSERT INTO
    member (m_id, mname, mcity, mmail)
VALUES (
        1001,
        'Зеленюк Іван',
        'Острог',
        'ivan.zelenyuk@oa.edu.ua'
    ),
    (
        1002,
        'Нікітюк Анна',
        'Рівне',
        'anna.nikitiuk@oa.edu.ua'
    );

REPLACE INTO
    member (m_id, mname, mcity, mmail)
VALUES (
        1003,
        'Довгий Петро',
        'Острог',
        'dovhyi.petro@oa.edu.ua'
    ),
    (
        1004,
        'Остренко Давид',
        'Рівне',
        'davyd.ostrenko@oa.edu.ua'
    );

REPLACE INTO
    member (m_id, mname, mcity, mmail)
VALUES (
        1003,
        'Вартова Світлана',
        'Нетішин',
        'svitlana.vartova@oa.edu.ua'
    );

REPLACE INTO
    member
VALUES (
        1003,
        'Вартова Світлана',
        'Рівне',
        'svitlana.vartova@oa.edu.ua'
    );

REPLACE INTO
    member
VALUES (
        1001,
        'Зеленюк Іван',
        'Рівне',
        'ivan.zelenyuk@oa.edu.ua'
    );

UPDATE member SET mcity = "Рівне" WHERE m_id = 1001;

# Tasks

use LuckyShrub;

replace into
    Orders (
        OrderID,
        ClientID,
        ProductID,
        Quantity,
        Cost
    )
values (9, 'Cl1', 'P1', 10, 5000.00),
    (10, 'Cl2', 'P2', 5, 100.00);

replace into
    Orders (
        OrderID,
        ClientID,
        ProductID,
        Quantity,
        Cost
    )
values (9, 'Cl1', 'P1', 10, 500.00);

#

replace into
    Starters (Name, Price, Type)
values (
        'Cheese bread',
        9.50,
        'Indian'
    );

replace into
    Starters (Name, Price, Type)
values (
        'Cheese bread',
        9.75,
        'Indian'
    );