Un exemple de creation de bdd et de quoi alimenter pour des test ;p
Creation d'une base de test
CREATE DATABASE csutest;
USE csutest;
-- Table 1: Employees
CREATE TABLE Employees (
employee_id INT PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50),
department VARCHAR(50)
);
-- Table 2: Orders
CREATE TABLE Orders (
order_id INT PRIMARY KEY,
employee_id INT,
product_name VARCHAR(50),
quantity INT,
order_date DATE,
FOREIGN KEY (employee_id) REFERENCES Employees(employee_id)
);
Alimenter la base de test
USE csutest;
-- Insert sample data into Employees table
INSERT INTO Employees (employee_id, first_name, last_name, department)
VALUES
(1, 'John', 'Doe', 'HR'),
(2, 'Jane', 'Smith', 'Marketing'),
(3, 'Michael', 'Johnson', 'IT'),
(4, 'Emily', 'Davis', 'Finance'),
(5, 'David', 'Brown', 'Sales'),
(6, 'Olivia', 'Taylor', 'HR'),
(7, 'Daniel', 'Anderson', 'IT'),
(8, 'Sophia', 'Wilson', 'Marketing'),
(9, 'James', 'Miller', 'Finance'),
(10, 'Isabella', 'Thompson', 'Sales');
-- Insert sample data into Orders table
INSERT INTO Orders (order_id, employee_id, product_name, quantity, order_date)
VALUES
(1, 3, 'Product A', 5, '2023-06-01'),
(2, 5, 'Product B', 10, '2023-06-02'),
(3, 7, 'Product C', 3, '2023-06-03'),
(4, 2, 'Product A', 8, '2023-06-04'),
(5, 4, 'Product B', 6, '2023-06-05'),
(6, 8, 'Product C', 2, '2023-06-06'),
(7, 1, 'Product A', 4, '2023-06-07'),
(8, 9, 'Product B', 7, '2023-06-08'),
(9, 6, 'Product C', 9, '2023-06-09'),
(10, 10, 'Product A', 3, '2023-06-10');