Git Product home page Git Product logo

fullstack-nanodegree-vm's Introduction

Intro to Relational Databases

Setup Environment

First we need to provide an environment for the database to run on. The cloned repo is already a Vagrant environment. For convinience, install Vagrant along with Virtualbox to save your time configuring operating system and libraries. Then clone this repo and use Git bash to start Vagrant at the cloned repo directory. For example, ``` cd path/to/your/repo vagrant up ``` This will start up a Ubuntu machine in virtual box, you can check if it is running by using the command ``` vagrant status ``` This will show you the status of the machines that are currently running. To ssh into the virtual machine, use ``` vagrant ssh ``` Learn more commands at the Vagrant's documentation (https://docs.vagrantup.com/v2/cli/index.html). The following will explain how the tournament database works.

How to build up the database

Once connected to Ubuntu, cd to the tournament folder. Use the following command to build the database. It will drop existing tournament database and create a new one. ``` cd /vagrant/tournament psql -f tournament.sql ```

How to import the database schema

To import the database shcema, simply go into the psql command line and use the \i command: ``` psql \i tournament.sql ```

What are the required setup in order to run the application successfully

Write a client application for using the tournament library we provided. Here are the methods included:
function name Description Corresponding test functions
connect Connects to the database. none
deleteMatches Remove all the matches records from the database. testDeleteMatches
deletePlayers Remove all the player records from the database. testDelete
countPlayers Returns the number of players currently registered. testCount
registerPlayer Adds a player to the tournament database. testRegister, testRegisterCountDelete
playerStandings Returns a list of the players and their win records, sorted by wins. testStandingsBeforeMatches
reportMatch Record the winner and loser of a match. testReportMatches
swissPairings Returns a list of pairs of players for the next round of a match. The return value will a list with values: (id1, name1, id2, name2) testPairings

How to run the test cases

Under the tournament folder there is a test file named tournament_test.py. Simply run the test by ``` python tournament_test.py ``` It should contain 8 tests for the tournament.py file.

fullstack-nanodegree-vm's People

Contributors

gges5110 avatar karlud avatar lobrown avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.