-
Notifications
You must be signed in to change notification settings - Fork 1
/
f.js
47 lines (44 loc) · 1.06 KB
/
f.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// marks 10%
// use knex to write to write the following SQL query for this mock db:
//
// Tables:
//
// listings
// |column name |type |
// |------------|------------|
// |id |primary key |
// |host_id |foreign key |
// |name |string |
// |-------------------------|
//
// hosts
// |column name |type |
// |------------|------------|
// |id |primary key |
// |host_url |string |
// |host_since |date |
// |-------------------------|
//
// reviews
// |column name |type |
// |------------|------------|
// |id |primary key |
// |listing_id |foreign key |
// |user_id |foreign key |
// |-------------------------|
//
// users
// |column name |type |
// |------------|------------|
// |id |primary key |
// |user_name |string |
// |friend_id |foreign key |
// |-------------------------|
//
// get the hosts and the name of their listsings
//
const knex = require('./db/client');
function f() {
// write knex query here. Rememger to call toString()
}
module.exports = f;