Code Monkey home page Code Monkey logo

lab-sql-9's Introduction

logo_ironhack_blue 7

Lab | SQL Queries 9

In this lab, you will be using the Sakila database of movie rentals. You have been using this database for a couple labs already, but if you need to get the data again, refer to the official installation link.

The database is structured as follows: DB schema

Instructions

  • Insert values in the table rentals_may using the table rental, filtering values only for the month of May.

  • Create a table rentals_june to store the data from rental table with information for the month of June.

  • Insert values in the table rentals_june using the table rental, filtering values only for the month of June.

  • Check the number of rentals for each customer for May.

  • Check the number of rentals for each customer for June.

  • Create a Python connection with SQL database and retrieve the results of the last two queries (also mentioned below) as dataframes:

    • Check the number of rentals for each customer for May

    • Check the number of rentals for each customer for June

      Hint: You can store the results from the two queries in two separate dataframes.

  • Write a function that checks if customer borrowed more or less books in the month of June as compared to May.

    Hint: For this part, you can create a join between the two dataframes created before, using the merge function available for pandas dataframes. Here is a link to the documentation for the merge function.

lab-sql-9's People

Contributors

sandrabosk avatar haggarw3 avatar caaarov 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.