advancedTop 15 Database Design Questions

Design a database for a ride-sharing platform (Uber-like).

users(id UUID, role CHECK IN ('rider','driver'), name, phone UNIQUE, email UNIQUE) vehicles(id, driver_id FK UNIQUE, plate UNIQUE, model, status) trips(id UUID PK, rider_id FK, driver_id FK NULLABLE, pickup_location POINT, dropoff_location POINT, status, fare DECIMAL, started_at, completed_at) trip_locations(trip_id FK, recorded_at TIMESTAMPTZ, location POINT, speed DECIMAL, PRIMARY KEY(trip_id, r

This is a Pro chapter

Sign in, then upgrade to Pro or Power to unlock this and the full Databases Mastery library.

Design a database for a ride-sharing platform (Uber-like).

Next Step

Continue to Design a warehouse inventory management system.← Back to all SQL questions