Giter Site home page Giter Site logo

webdb-recitation-i's Introduction

WebDB Recitation I

I’m trying something new today. This is a project similar, but distinct from the afternoon project. The goal is to cover much of the same ground, but in a way that allows this to remain up for future cohorts to enjoy.

Queries

You can connect to a local sqlite database on the command line by running the command sqlite3 dbName.sqlite3. Navigate into the /data directory and open the dev.sqlite3 database this way. You can now run SQL queries against it. (Don’t forget to end your commands with a ;).

You can exit by pressing CTRL-d. View the tables and their schema with the commands .tables and .schema tableName.

Find all books with a publisher_id of 2

Find the title, cover_url of the book with the id of 1

Find the title and year of the oldest 3 books

Find all reviews for books with id’s 3, 4 and 5

Add a review for book 1, from user 8 with a rating of 3 and a comment of ‘Okay’

Change your review to be a rating 5 of and a comment of ‘Amazing Cover!”

Find how many different years books were published in. How many books were published in each year?

What is the average review of each book?

Which book has the longest description?

API

Write CRUD endpoints for the reviews resource. Ideally, separate out your database interactions into a ‘model’ file and import that into your ‘router’ file.

fielddata typemetadata
idunsigned intprimary key, auto
ratingfloating point number1-5, required
book_idunsigned intforeign key, 1-15, required
user_idunsigned intforeign key, 1-6, required
commentstringnot required

Handle query parameters to the GET /api/reviews endpoint that may contain limit, sortby and sortdir.

webdb-recitation-i's People

Contributors

blevs 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.