Giter Site home page Giter Site logo

java-filmorate's Introduction

java-filmorate

Template repository for Filmorate project.

list of features for review:

  • add-director
  • add-common-films
  • add-feed
  • add-recommendations
  • add-most-populars
  • add-search
  • add-reviews
  • add-remove-endpoint

This is an image of database link for image of db

examples of basic database queries:

  • get all films:
    SELECT *
    FROM films

  • get film by id (parametr: int id):
    SELECT *
    FROM films AS f
    WHERE f.id = (entered id)

  • get popular film (parametr: int count):
    SELECT *
    FROM films AS f
    LEFT OUTER JOIN likes_by_users AS l ON f.id = l.id_film
    GROUP BY f.id
    ORDER BY COUNT(l.id_film) DESC
    LIMIT count

  • get all users:
    SELECT *
    FROM users

  • get user by id (parametr: int id):
    SELECT *
    FROM users AS u
    WHERE u.id = (entered id)

  • get friends by id (parametr: int id):
    SELECT *
    FROM users AS u
    WHERE u.id IN (SELECT id_friend
    FROM friends AS f
    WHERE f.id_user = (entered id)
    AND f.id_status = 2 (подтверждённая дружба))

  • get common friends by id user and id other user (parameters: int id, int otherId)
    SELECT *
    FROM users AS u
    WHERE u.id IN (SELECT id_friend
    FROM friends AS f
    WHERE f.id_user = (entered id)
    AND f.id_status = 2 (подтверждённая дружба))
    AND u.id IN (SELECT id_friend
    FROM friends AS f
    WHERE f.id_user = (entered otherId)
    AND f.id_status = 2 (подтверждённая дружба))

java-filmorate's People

Contributors

vladbakumenko avatar pavlovandrei avatar anastassvirs avatar anton-phedorenko avatar wintiki84 avatar

Watchers

 avatar

Forkers

ipilin

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.