CREATE DATABASE drivehub;

USE drivehub;

CREATE TABLE users (
  id INT AUTO_INCREMENT PRIMARY KEY,
  username VARCHAR(50),
  password VARCHAR(255),
  role ENUM('admin', 'user') DEFAULT 'user'
);

CREATE TABLE cars (
  id INT AUTO_INCREMENT PRIMARY KEY,
  make VARCHAR(50),
  model VARCHAR(50),
  year INT,
  price INT,
  user_id INT,
  FOREIGN KEY (user_id) REFERENCES users(id)
);