Giter Site home page Giter Site logo

backend-sqlruby's Introduction

SQL Joins and Starting Ruby

This week we will finish our introduction to SQL, and start Ruby.

SQL Exercises: A practice SQL environment is at https://www.w3schools.com/sql/trysql.asp?filename=trysql_select_all

Note: It is not possible to do these exercises in Firefox. Use Chrome, or if you have a different browser, try it to see if it works.

Several exercises are described in sql.txt. Create a new git branch called sql-ruby-lesson. As you solve each exercise, paste the sql statement you used into sql.txt

Ruby Exercise: You will use the ruby development environment you set up on your machine for Backend 1. Write a program which asks the user for a number of years, and then prints out how many hours are in that many years. Then it asks for a number of decades, and prints out the number of minutes are in that many decades. Then it asks for the user's age, and prints out the number of seconds old the user is. Call this program years_to_hours.rb.

Here is the first part of the program:

puts "Enter a number of years"
years = gets.chomp # this returns a string
years = years.to_i # this converts a string to an integer
hours = years * 365 * 24
puts "That's #{hours} hours."

When you have completed both the SQL exercises and the ruby program, push them to github and issue a pull request.

backend-sqlruby's People

Contributors

jrmcgarvey avatar

Stargazers

 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.