Code Monkey home page Code Monkey logo

sql-n64-lab's Introduction

Exercise - SQL 64

List of SQL Commands (important resource)

Codecademy SQL Commands (also great)

Primary Key

screen shot 2017-12-19 at 8 45 19 am

NOT NULL

screen shot 2017-12-19 at 8 47 19 am

Take the following schema for a N64 SQL database

 CREATE TABLE Games (
   id INTEGER PRIMARY KEY,
   title TEXT NOT NULL,
   year INTEGER NOT NULL,
   developers TEXT,
   genre TEXT
 );

Create a database with this schema and seed it with some sample data

INSERT INTO Games(title, year, developers, genre) VALUES('The Legend of Zelda: The Ocarina of Time', 1998, 'Nintendo EAD', 'Action-Adventure');
INSERT INTO Games(title, year, developers, genre) VALUES('Super Smash Bros.', 1999, 'Hal Laboratory', 'Fighting');
INSERT INTO Games(title, year, developers, genre) VALUES('Super Mario 64', 1996, 'Nintendo EAD', 'Platforming');
INSERT INTO Games(title, year, developers, genre) VALUES('Golden Eye 007', 1997, 'Rare', 'First-Person Shooter');
INSERT INTO Games(title, year, developers, genre) VALUES('Mario Kart 64', 1996, 'Nintendo EAD', 'Racing');
INSERT INTO Games(title, year, developers, genre) VALUES('Star Fox 64', 1997, 'Nintendo EAD', 'Rail/Scrolling Shooter');
INSERT INTO Games(title, year, developers, genre) VALUES('Perfect Dark', 2000, 'Rare', 'First-Person Shooter');
INSERT INTO Games(title, year, developers, genre) VALUES('Star Wars: Shadow of the Empire', 1996, 'Lucas Arts', 'Action');
INSERT INTO Games(title, year, developers, genre) VALUES('Banjo-Kazooie', 1998, 'Rare', 'Platforming');
INSERT INTO Games(title, year, developers, genre) VALUES('Mario Party', 1998, 'Hudson Soft', 'Party Game');
INSERT INTO Games(title, year, developers, genre) VALUES('Tony Hawk''s Pro Skater' , 1996, 'Neversoft', 'Extreme Sports');

Queries

Use SQL queries to complete the following tasks

  1. Select the title of all games

  2. Show all the years in the database.

  3. Show the title of each game made by 'Rare'.

  4. Select all games that were made before 1998.

  5. Find the average release year of all games.

  6. Show the developer names of each game, in alphabetical order.

  7. Show the titles of games not made by 'Nintendo EAD'.

  8. Add the the game 'F-Zero X', released in 1998, made by 'Nintendo EAD', and with the genre 'Racing'.

  9. Show all the game titles in descending order of their release year.

  10. Remove all games not made by 'Hudson Soft'.

  11. Show the average release year for games that were made by Rare or have the title Tony Hawk''s Pro Skater in order of their title

  12. Show the id and title and genre of all games that were either:

Made before 1997,

Made by Hal Laboratory,

Or, have the genre Platforming AND are made by Rare.

sql-n64-lab's People

Contributors

alicht avatar awongh avatar jase-d-ace avatar

Watchers

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