-
Notifications
You must be signed in to change notification settings - Fork 0
/
extra
46 lines (35 loc) · 1.07 KB
/
extra
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
//FOR SELECT
SELECT * FROM USER_DETAILS
//FOR INSERT INTO A TABLE
INSERT INTO USER_DETAILS(BIRTH_DATE, ID, NAME)
VALUES
(CURRENT_DATE(), 1001, 'JEWEL'),
(CURRENT_DATE(), 1002, 'RANA'),
(CURRENT_DATE(), 1003, 'SHOHEL'),
(CURRENT_DATE(), 1004, 'SELIM'),
(CURRENT_DATE(), 1005, 'BAPPI'),
(CURRENT_DATE(), 1006, 'RAJU');
INSERT INTO POST(ID, USER_ID, DESCRIPTION)
VALUES
(2001, 1001, 'I WANT TO LEARN AWS'),
(2002, 1002, 'I WANT TO LEARN SPRING BOOT'),
(2003, 1003, 'I WANT TO LEARN MICROSERVICES'),
(2004, 1004, 'I WANT TO LEARN SPRING CLOUD');
//########################## lunch docker and set up mysql #############
Launch MySQL as Docker Container
docker run --detach
--env MYSQL_ROOT_PASSWORD=dummypassword
--env MYSQL_USER=social-media-user
--env MYSQL_PASSWORD=dummypassword
--env MYSQL_DATABASE=social-media-database
--name mysql
--publish 3306:3306
mysql:8-oracle
//######### mysqlsh commands client
open mysqlsh
\connect social-media-user@localhost:3306 ,give password
\sql
use social-media-database
select * from user_details;
select * from post;
\quit