-
-
Notifications
You must be signed in to change notification settings - Fork 146
Expand file tree
/
Copy pathlearn-sequelize.js
More file actions
80 lines (71 loc) · 1.86 KB
/
learn-sequelize.js
File metadata and controls
80 lines (71 loc) · 1.86 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
const { Genre, Movie, Actor } = require("./models");
/*
Write a function that creates a new Genre in the database
- currently, the genre table has 3 entries: Action, Comedy, and Drama
- add one more Genre of your choice
- duplicate entries are not allowed (try it to learn about errors)
*/
function insertNewGenre() {
// Add code here
}
/*
Write a function that creates a new Movie in the database
- currently, there are 5 movies
- add one more Movie of your choice.
- the movie CANNOT be from year 2008 (try it to learn about errors)
*/
function insertNewMovie() {
// Add code here
}
/*
Write a function that returns the title of the movie with ID=2
*/
function getMovieWithId2() {
// Add code here
}
/*
Write a function that returns an array of all the actor names
*/
function getAllActors() {
// Add code here
}
/*
Write a function that returns an array of all the movie titles from 2008
*/
function getAllMoviesFrom2008() {
// Add code here
}
/*
Write a function that deletes the genre you added in the first function: insertNewGenre()
*/
function deleteGenreYouAdded() {
// Add code here
}
/*
Write a function that associates:
- the actor "Rosario Dawson" with the movie "Eagle Eye"
- the actor and movie record already exist in the database
- add the association record to the database
*/
function associateRosarioToEagleEye() {
// Add code here
}
/*
Write a function that associates:
- the actor "Robert Downey Jr." with the movie "Tropic Thunder"
- the actor and movie record already exist in the database
- add the association record to the database
*/
async function associateRobertToTropicThunder() {
// Add code here
}
module.exports = {
insertNewGenre,
insertNewMovie,
getMovieWithId2,
getAllActors,
getAllMoviesFrom2008,
deleteGenreYouAdded,
associateRosarioToEagleEye,
associateRobertToTropicThunder,
};