-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocedure_calls.sql
More file actions
76 lines (50 loc) · 2.07 KB
/
procedure_calls.sql
File metadata and controls
76 lines (50 loc) · 2.07 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
USE blog_site;
-- *****************************************************************************************
-- Getting the number of likes on each post
set @like_count = 0; -- output variable
call CountLikesOnPost(1, @like_count);
select @like_count AS LikeCount; -- result
call CountLikesOnPost(2, @like_count);
select @like_count AS LikeCount;
call CountLikesOnPost(3, @like_count);
select @like_count AS LikeCount;
-- *****************************************************************************************
-- Searching for posts by keyword
call SearchPostsByKeyword('Maggi');
call SearchPostsByKeyword('Football');
call SearchPostsByKeyword('language');
-- *****************************************************************************************
-- Getting posts of by category
call GetPostsByCategory('Sports');
call GetPostsByCategory('Programming');
call GetPostsByCategory('Health & Wellness');
call GetPostsByCategory('Academics');
-- *****************************************************************************************
-- Getting posts by user
call GetPostsByUser(1);
call GetPostsByUser(2);
call GetPostsByUser(3);
-- *****************************************************************************************
-- Editing posts
call EditPost(
2,
'Updated Intro to Python',
'Here is an updated overview of Python programming, including its uses in various fields like web development, data science, and machine learning.');
call EditPost(
3,
'Updated Intro to C++',
'Here is an introduction to C++, covering its importance in system programming and application development.');
call EditPost(
4,
'Updated How to make Maggi',
'New recipe update: How to make Maggi with additional spices for extra flavor.');
-- *****************************************************************************************
-- Deleting posts
call DeletePost(1);
call DeletePost(2);
call DeletePost(3);
-- *****************************************************************************************
-- Deleting users
call DeleteUser(8);
call DeleteUser(9);
call DeleteUser(10);