Outline | Value |
---|---|
Course | CSI 2532 |
Date | Winter 2020 |
Professor | Andrew Forward |
Team | Ali Haidar 8328785 Ivor Benderavage 8171462 Haifa Besrour 300102272 |
Below are different models and SQL queries that can be used on our database
CREATE TABLE athletes (
id int,
identifier varchar(50),
created timestamp,
modified timestamp,
name varchar(50),
dob date,
identified_gender varchar(6),
PRIMARY KEY (id)
);
INSERT INTO athletes (id, name, identified_gender, dob)
VALUES
(1, 'Andrew', 'm', '1975-12-01'),
(2, 'Ayana', 'F', '1998-06-11'),
(3, 'Hayden', 'm', '1996-07-24'),
(4, 'August', 'm', '1999-09-09');
SELECT *
FROM athletes
WHERE identified_gender = 'F';
UPDATE athletes
SET identified_gender = 'M'
WHERE identified_gender = 'm';
SELECT *
FROM athletes
WHERE identified_gender = 'M';
DELETE FROM athletes;
SELECT count(*)
FROM athletes;
Below are different models and SQL queries that can be used on our database
The schema is also available.
The SQL queries can also be found here
Our migrations can also be accessed
Our application is a PHP frontend for the PostgreSQL database which can be used to perform read-only queries on the database.
Setup instructions on Linux:
- Install and set up postgreSQL (Instructions for Arch Linux here). (Or use an installation wizard)
- Follow the instructions to create a user and a DB. Create a user called
webuser
and a database calledTestSql
-
Run
permissions.sql
. This will give thewebuser
user the permissions we want (i.e. read-only queries only!) -
Add our tables to the database by running
schema.sql
-
Populate the database by running
seed.sql
or entering information manually -
Start the local PHP server:
php -S 127.0.0.1:7000 application/index.php
- Navigate to http://localhost:7000 in your browser to access the app.
Below are different models and SQL queries that can be used on our database
The schema for delivrable 3 is also available.
The seed used to populate de database.