Skip to content

Database Setup

aghar11 edited this page Apr 8, 2024 · 3 revisions

Entity Relationship Diagram

ER Diagram

Relational Database Schema

"Users" ( "UserId", "Email", "Password", "FirstName", "LastName" );

"Platforms" ( "PlatformId", "Name" );

“Connections" ( "UserId", "PlatformId", "Handle", "Token", "TokenExpiration" );

"OrderStatuses" ( "OrderStatusId", "Name" );

"Orders" ( "OrderId", "OrderDate", "OrderStatusId", "ListingId", "UserId", "Price", "Description" );

"ListingTypes" ( "ListingTypeId", "Name", "PlatformId" );

"Listings" ( "ListingId", "PlatformId", "ListingTypeId", "UserId", "Price" );

Primary and Foreign Keys

Primary Keys

Italicized

Foreign Keys

Connections

Connections.UserId to Users.UserId

Connections.PlatformId to Platforms.PlatformId

Orders

Orders.OrderStatusId to OrderStatuses.OrderStatusId

Orders.ListingId to Listings.ListingId

Orders.UserId to Users.UserId

ListingTypes

ListingTypes.PlatformId to Platforms.PlatformId

Listings

Listings.PlatformId to Platforms.PlatformId

Listings.ListingTypeId to ListingTypes.ListingTypeId

Listings.UserId to Connections.UserId

Clone this wiki locally