SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
CREATE DATABASE easyrent; USE easyrent; -- Users Table CREATE TABLE users ( user_id INT AUTO_INCREMENT PRIMARY KEY, username VARCHAR(50) NOT NULL, email VARCHAR(100) NOT NULL UNIQUE, password VARCHAR(255) NOT NULL, role ENUM('owner', 'renter') DEFAULT 'renter' ); -- Products Table CREATE TABLE products ( product_id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100) NOT NULL, description TEXT, price DECIMAL(10, 2), owner_id INT, FOREIGN KEY (owner_id) REFERENCES users(user_id) );

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear