Giter Site home page Giter Site logo

vijaybandi / canadian-federal-election-2015-database Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sqlauto/canadian-federal-election-2015-database

0.0 1.0 0.0 121 KB

SQL Server database used to store data relating to the 2015 federal election.

canadian-federal-election-2015-database's Introduction

Canadian federal election 2015 Database

Description

SQl Server database used to store data relating to the 2015 federal election.

Database Schema

TABLE SCHEMA:

  • Province = {provinceName, provincePopulation, provinceGDP}

  • Riding = {ridingName, ridingPopulation, provinceName}

  • Party = {partyID, partyName, leaderFirstName, leaderLastName, partyWeb}

  • Ballots = {ridingName, candidateFirstName, candidateLastName, partyID, votes}

Bolded attributes = primary key

Italicized attributes = foreign attributes

Bolded + italicized attributes = foreign keys

Constraints

THE BEHAVIOUR OF THE FOREIGN KEYS IS GIVEN BELOW:

  • provinceName in Riding: do not allow deletion or update of referenced attributes

  • ridingName in Ballots: do not allow deletion of referenced attributes, cascade changes to referenced attributes

  • partyID in Ballots: do not allow deletion of referenced attributes, cascade changes to referenced attributes

IN ADDITION TO THE FOREIGN KEY AND PRIMARY KEY CONTRAINTS WE HAVE THE FOLLOWING CONSTRAINTS:

  • The attribute set {candidateFirstName, candidateLastName, partyID} should be specified as a candidate key in the Ballots table (no pun intended)

  • The partyID attribute in Ballots should not be null

  • The partyWeb attribute should be specified as a candidate key in the Party table

  • The leaderFirstName and leaderLastName attributes in the Party table should not be null

  • The votes attribute in the Ballots table should not be null, and should be greater or equal to zero

  • The sum of the votes for a riding should be less than the population of that riding

View

THE VIEW CONTAINS THE FOLLOWING ATTRIBUTES:

  • ridingName

  • mpFirstName (the first name of the candidate with the most votes in the riding)

  • mpLastName (the last name of the candidate with the most votes in the riding)

  • mpParty (the party name of the candidate with the most votes in the riding)

  • mpVotes (the votes cast for the candidate with the most votes in the riding)

  • totalVotes (the total number of votes cast in the riding)

Data

THE DATA WAS TAKEN FROM THE FOLLOWING WEBSITES:

Political parties

Province population

Province GDP

Riding population

canadian-federal-election-2015-database's People

Contributors

montreai avatar

Watchers

 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.