Code Monkey home page Code Monkey logo

school-domain-querying-001's Introduction

##Objectives:

  1. Build a simple Object Relational Mapper.
  2. Learn what SQL joins are and how to use them.
  3. Learn how to Create, Read, Update and Delete data (CRUD).

###Right now your ORM Student class has methods that will:

  1. Insert students into the database with their associated attributes.
  2. Update a student's attributes in the database and have it persist(continue to exist).
  3. Delete students from the database.
  4. Create a new instance of a student from the database.(Students will exist in the database in a row, you will create an instance (object) so you can use that object.)
  5. Find a student by their name or id.
  6. Add a course to a student.
  7. Retrieve all of the courses of a student.

After completing this lab, your Course, Department and Registration classes will have similar functionality and the ability to talk to each other. In order to make this happen, your tables will use SQL joins. You will be able to do things like find all courses by department name or add a course to a particular student.

###A Note On Integration Tests Integration testing tests how your models interact with each other. In order for the integration tests to pass completely, you will need to build methods that relate Course and Student to Department. They will go in the Course and Student classes.

###Department

def course
  #find all courses by department_id
end

def add_course(course)
  #add a course to a department and save it
end

###Course

def department
  #successfully gets department
end
 
def department=(department)
  #set department id when deparment is set
end
def students
  #find all students by course_id
end

def add_student(student)
  #add a student to a particular course and save them
end

Resources

school-domain-querying-001's People

Contributors

arelenglish avatar octosteve avatar changamanda avatar benjagross avatar deniznida avatar kthffmn avatar annjohn avatar fislabstest avatar sarogers avatar roseweixel avatar rolandobrown avatar jmburges avatar jeffkatzy avatar ipc103 avatar drewprice avatar nigelfloe avatar fs-lms-test-bot avatar ahimmelstoss avatar

Watchers

 avatar Mat Balez avatar Mohawk Greene avatar Victoria Thevenot avatar  avatar  avatar  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.