-
Notifications
You must be signed in to change notification settings - Fork 0
/
g.js
46 lines (43 loc) · 1.1 KB
/
g.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
// marks 20%
// 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 user_name of user with id of 10 along with all the listing names said user made a review for.
const knex = require('./db/client');
function g() {
// knex query here. remember to call .toString
}
module.exports = g;