Illinois Tech CS 727 - Course Project Relational Database Implementation and Applications
A Relational Database consisting of the most essential information required for eBay's service.
Includes relevant data to normal usage as well as; relationships, semantics, constraints, users, and users' needs, and interesting use cases. (A description of how a user might interact with a database, system, or process to achieve a specific goal or perform particular task)
- PostgreSQL 16+ installed on your system
- Access to
sudofor service management (if needed)
Install it using:
sudo apt-get update
sudo apt-get install -y postgresql postgresql-contribStart the PostgreSQL service:
sudo systemctl start postgresqlVerify PostgreSQL is running:
pg_isreadyIf you don't have a PostgreSQL role for your current user, create one:
sudo -u postgres createuser -s $USERThis creates a superuser role with the same name as your current system user.
Create a new database for the eBay mimic project:
createdb ebay_dbTo create all tables and load the data, run:
psql -d ebay_db -f ebay_db.sqlThis command will:
- Drop existing tables (if any) to ensure a clean slate
- Create all tables with proper constraints and relationships
- Create indexes for optimized queries
- Create functions, triggers, and stored procedures
- Insert seed data into all tables
- Create views for common queries
- Display sample query results
After running the SQL file, verify the database was created successfully:
psql -d ebay_db -c "\dt"This lists all tables in the database. You should see:
user_accountcategorylistinguser_listing_watchbidtransactionfeedback
To connect to the database interactively:
psql -d ebay_dbOnce connected, you can run SQL queries, view tables, and interact with the database.
# Start PostgreSQL
sudo systemctl start postgresql
# Create database
createdb ebay_db
# Load schema and data
psql -d ebay_db -f ebay_db.sql
# Connect to database
psql -d ebay_db
# List all tables
psql -d ebay_db -c "\dt"
# View a specific table
psql -d ebay_db -c "SELECT * FROM user_account LIMIT 5;"