Giter VIP home page Giter VIP logo

sql-basics's Introduction

SQL Basics

This assignment will review basic knowledge of the SQL language.

Assignment

You will create a SQL script called solution.sql that does the following when run against a new SQLite database:

Users Table

Your script will create a table named users with an autoincrementing integer primary key called id, a name text field that must always be assigned a value, and a birthdate datetime field.

Your script will insert the following users into the table:

  • Alice with ID 1 and birthdate '1999-01-02'
  • Bob with ID 2 and birthdate '2001-06-15'
  • Carol with ID 3 and birthdate '2000-04-17'

Games Table

Your script will create a table named games with an autoincrementing integer primary key called id, a name text field that must always be assigned a value, and a times_played field that defaults to zero and must always have a value.

Your script will insert the following games into the table:

  • Chess with ID 1 and 7 times played.
  • Go with ID 2 and 4 times played.
  • Checkers with ID 3 and 12 times played.

Testing

If you would like to confirm that your solution exactly meets expectations, you may run make test to confirm that the expected output of my solution exactly matches your solution. This command should result in no differences between the expected output and your output.

The test script is located in tests.sql and the expected output is located in test-expected.txt.

sql-basics's People

Contributors

jncraton avatar

Watchers

 avatar James Cloos 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.