List total number of projects, then same for tasks (COUNT)
select count(*) from projects;
List incomplete tasks (single-table; WHERE) (how many are there?)
import React, { useState, useEffect } from 'react'; | |
import './App.css'; | |
import axios from 'axios' | |
/* | |
Basically useState will change the variable and manage its value, while useEffect will fire a function *when* it changes? | |
-Alex, react Expert | |
*/ |
import React, { useState } from 'react'; | |
import './App.css' | |
import CoolComponent, { LessCoolComponent } from './CoolComponent' | |
// conditional rendering | |
const Counter = () => { | |
const [clickNumber, setClickNumber] = useState(0) |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name='viewport' content='width=device-width, initial-scale=1'> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> | |
<div class="header">Header</div> | |
<div class="container"> | |
<div class="big">A</div> |
import React, { useState } from 'react'; | |
const HelloWorld = (props) => { | |
return ( | |
<h1>Hello {props.name}!</h1> | |
) | |
} | |
// display a number | |
// a button to increase the number |
SELECT name, | |
FROM projects | |
JOIN tasks ON projects.id = tasks.project_id; | |
SELECT name, | |
count(tasks.id) as total, | |
FROM projects | |
JOIN tasks ON projects.id = tasks.project_id | |
GROUP BY projects.id; |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Document</title> | |
</head> | |
<body> | |
<h1>Heyo what up!</h1> | |
<h2>Heyo what up!</h2> | |
<h3>Heyo what up!</h3> | |
<h4>Heyo what up!</h4> |
const express = require('express') | |
const dogRoutes = express.Router() | |
const dogs = { | |
1: { | |
name: 'Jack' | |
}, | |
2: { | |
name: 'Freddy' | |
}, |
List total number of projects, then same for tasks (COUNT)
select count(*) from projects;
List incomplete tasks (single-table; WHERE) (how many are there?)
class Mystery < ApplicationRecord | |
validates :title, presence: true | |
belongs_to :pyramid | |
# solve the mystery | |
# tagline for the mystery | |
def tagline | |
"Come see #{title} at the #{pyramid.name}!" | |
end |
# this is the blueprint for THIS thing | |
class Pokemon | |
attr_reader :species, :health | |
attr_accessor :name | |
def initialize species, name | |
# Save the species, save the name | |
@species = species | |
@name = name | |
@health = 100 |