Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
klazarz committed Apr 25, 2024
2 parents 3e49b33 + 1da0e40 commit af947ab
Show file tree
Hide file tree
Showing 108 changed files with 1,143 additions and 1,558 deletions.
20 changes: 12 additions & 8 deletions 23cfree/apex-property-graphs/apex-property-graphs.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,29 +99,33 @@ This lab assumes:
![Install the application](images/install-application.png)
8. Click Run Application.
![Run the application](images/run-application.png)
8. Click Install Supporting Objects.
![Install supporting objects](images/install-supporting-objects.png)
9. Click Run Application.
![Run the application](images/run-application.png)
9. Login.
10. Login.
**NOTE:** admin is case-sensitive.
![Log back in](images/login-final.png)
10. Click Property Graph queries with SQL box.
11. Click Property Graph queries with SQL box.
![Property graph queries selection](images/property-graph-queries.png)
11. Scroll through output to see the queries that you had ran in the prior lab visualized.
12. Scroll through output to see the queries that you had ran in the prior lab visualized.
![Final scroll through the output](images/final-output.png)
12. Click the hamburger menu in the upper left corner of the application and click "Using the Graph Visualization Plugin".
13. Click the hamburger menu in the upper left corner of the application and click "Using the Graph Visualization Plugin".
13. Scroll through the output to see the Graph Viz plugin utilized.
14. Scroll through the output to see the Graph Viz plugin utilized.
![Graph viz](images/graph-viz.png)
14. You have now completed this lab.
15. You have now completed this lab.
## Learn More
* [Oracle Property Graph](https://docs.oracle.com/en/database/oracle/property-graph/index.html)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 23cfree/apex-property-graphs/images/run-application.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 23cfree/property-graphs-setup/images/connect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 14 additions & 1 deletion 23cfree/property-graphs-setup/property-graphs-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,13 @@ This lab assumes you have:
![Command to start SQL](images/startup-sql.png)
2. On the left side menu, you'll see hol23c_freepdb1 underneath Oracle Connections. Double click it to open the connection.
2. On the left side menu, you'll see hol23c_freepdb1 underneath Oracle Connections. Double click it to open the connection.
>**Note:** If you do **not** see the hol23c_freepdb1 connection available on the menu, please complete Task 3: Add the user connection and then go to step 4.
![Open the connection](images/hol23c-connection.png)
3. Fill out the connection information with your password. The default password we will be using throughout this lab is Welcome123. If you have changed yours, please use that one. After you click okay, you should be connected to your user.
![Login information](images/login-connection.png)
Expand Down Expand Up @@ -117,8 +119,19 @@ This lab assumes you have:
10. Your schema setup is now complete.
## (Optional) Task 3: Add the user connection
1. If you do not already have the hol23c_freepdb1 connection, then click the box that says 'Create a Connection Manually'.
![Create a connection manually](images/create-connection.png)
2. Fill out the fields inside of the box to match this image exactly. Make sure that the password you fill out is what you set it to for the user in Lab 1. To ensure it works, click the 'Test' button and ensure it says 'Status: Success' in the bottom left corner.
![Test connection](images/new-db-connection.png)
3. Click 'Connect'.
![Connect](images/connect.png)
## Learn More
* [Oracle Property Graph](https://docs.oracle.com/en/database/oracle/property-graph/index.html)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions 23cfree/property-graphs/property-graphs.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Watch the video below for a quick walk-through of the lab.
</if>

## Task 1 : Define a graph view on these tables
1. In your SQL Developer window, click on the tab named hol23c_freepdb1, not the CreateKeys.sql tab that you are currently in.
1. In your SQL Developer window, click on the tab named hol23c_freepdb1 or hol23c, not the CreateKeys.sql tab that you are currently in.

![Open hol23c tab](images/sql-hol23-tab.png)
Expand Down Expand Up @@ -244,7 +244,9 @@ A common query in analyzing money flows is to see if there is a sequence of tran
Now, let's insert some more data into BANK\_TRANSFERS. We will see that when rows are inserted in to the BANK\_TRANSFERS table, the BANK\_GRAPH is updated with corresponding edges.
Run this
Run this by clicking the button to run the entire script, instead of the green play button.
![Run script icon](images/run-script-icon.png)
```
<copy>
Expand Down Expand Up @@ -295,6 +297,8 @@ A common query in analyzing money flows is to see if there is a sequence of tran
12. So let’s insert more transfers which create some circular payment chains.
We will be adding transfers from accounts **599**, **982**, and **407** into account **39**.
Run this by clicking the button to run the entire script, instead of the green play button.
```
<copy>
Expand Down
44 changes: 23 additions & 21 deletions 23cfree/sql-extended/sql-extended.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ This lab assumes you have:
<copy>
SELECT name FROM race where race_id = 204;
INSERT INTO race_dv VALUES ('{"raceId" : 204,
"name" : "Miami Grand Prix",
"laps" : 57,
"date" : "2022-05-08T00:00:00",
"podium" : {}}');
INSERT INTO race_dv VALUES ('{"_id" : 204,
"name" : "Miami Grand Prix",
"laps" : 57,
"date" : "2022-05-08T00:00:00",
"podium" : {}}');
SELECT name FROM race where race_id = 204;
</copy>
Expand All @@ -43,13 +45,13 @@ This lab assumes you have:
```
<copy>
SELECT json_serialize(data PRETTY)
FROM race_dv WHERE json_value(data, '$.raceId') = 205;
FROM race_dv WHERE json_value(data, '$._id') = 205;
INSERT INTO race
VALUES(205, 'Japanese Grand Prix', 53, TO_DATE('2022-10-08','YYYY-MM-DD'), '{}');
SELECT json_serialize(data PRETTY)
FROM race_dv WHERE json_value(data, '$.raceId') = 205;
FROM race_dv WHERE json_value(data, '$._id') = 205;
</copy>
```
![Image alt text](images/task_1_2.png " ")
Expand All @@ -62,7 +64,7 @@ This lab assumes you have:
<copy>
SELECT json_serialize(data PRETTY)
FROM race_dv WHERE json_value(data, '$.raceId') = 204;
FROM race_dv WHERE json_value(data, '$._id') = 204;
UPDATE race
SET name = 'Miami Grand Prix',
Expand All @@ -80,7 +82,7 @@ This lab assumes you have:
COMMIT;
SELECT json_serialize(data PRETTY)
FROM race_dv WHERE json_value(data, '$.raceId') = 204;
FROM race_dv WHERE json_value(data, '$._id') = 204;
</copy>
```
Expand All @@ -91,7 +93,7 @@ This lab assumes you have:
```
<copy>
SELECT json_serialize(data PRETTY)
FROM race_dv WHERE json_value(data, '$.raceId') = 205;
FROM race_dv WHERE json_value(data, '$._id') = 205;
</copy>
```
![Image alt text](images/task_2_2.png " ")
Expand All @@ -104,7 +106,7 @@ This lab assumes you have:
UPDATE race_dv
SET data = ('{"_metadata": {"etag" : "BECAB2B6E186FEFB59EBD977418BA26F"},
"raceId" : 205,
"_id" : 205,
"name" : "Japanese Grand Prix",
"laps" : 53,
"date" : "2022-03-20T00:00:00",
Expand All @@ -127,13 +129,9 @@ This lab assumes you have:
"position" : 3,
"driverId" : 104,
"name" : "Carlos Sainz Jr"}]}')
WHERE json_value(data, '$.raceId') = 205;
WHERE json_value(data, '$._id') = 205;
COMMIT;
SELECT name, race_date FROM race where race_id = 205;
SELECT race_id, driver_id, position from driver_race_map where race_id = 205;
</copy>
```
![Image alt text](images/task_2_3.png " ")
Expand All @@ -143,7 +141,10 @@ This lab assumes you have:
1. We're going to delete a couple entries, but we want to see the current state of these tables first. Copy the code below and click **Run Script**.
```
<copy>
SELECT json_serialize(data PRETTY) FROM race_dv WHERE json_value(data, '$.raceId') = 204;
SELECT name, race_date FROM race where race_id = 205;
SELECT race_id, driver_id, position from driver_race_map where race_id = 205;
SELECT json_serialize(data PRETTY) FROM race_dv WHERE json_value(data, '$._id') = 204;
SELECT json_serialize(data PRETTY) FROM driver_dv WHERE json_value(data, '$.race.raceId') = 204;
SELECT * FROM race where race_id = 204;
Expand Down Expand Up @@ -171,7 +172,7 @@ This lab assumes you have:
```
<copy>
SELECT json_serialize(data PRETTY) FROM race_dv WHERE json_value(data, '$.raceId') = 204;
SELECT json_serialize(data PRETTY) FROM race_dv WHERE json_value(data, '$._id') = 204;
SELECT json_serialize(data PRETTY) FROM driver_dv WHERE json_value(data, '$.race.raceId') = 204;
SELECT * FROM race where race_id = 204;
Expand All @@ -184,13 +185,14 @@ This lab assumes you have:
```
<copy>
SELECT json_serialize(data PRETTY) FROM race_dv WHERE json_value(data, '$.raceId') = 205;
SELECT json_serialize(data PRETTY) FROM race_dv WHERE json_value(data, '$._id') = 205;
SELECT json_serialize(data PRETTY) FROM driver_dv WHERE json_value(data, '$.race.raceId') = 205;
SELECT * FROM race where race_id = 205;
DELETE FROM race_dv dv WHERE dv.data.raceId = 205;
DELETE FROM race_dv dv WHERE dv.data."_id" = 205;
SELECT json_serialize(data PRETTY) FROM race_dv WHERE json_value(data, '$.raceId') = 205;
SELECT json_serialize(data PRETTY) FROM race_dv WHERE json_value(data, '$._id') = 205;
SELECT json_serialize(data PRETTY) FROM driver_dv WHERE json_value(data, '$.race.raceId') = 205;
SELECT * FROM race where race_id = 205;
Expand Down
20 changes: 10 additions & 10 deletions 23cfree/sql-json/sql-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ This lab assumes you have:
```
<copy>
SELECT json_serialize(data PRETTY)
FROM race_dv WHERE json_value(data, '$.raceId') = 201;
FROM race_dv WHERE json_value(data, '$._id') = 201;
</copy>
```
Expand All @@ -50,7 +50,7 @@ This lab assumes you have:
<copy>
UPDATE race_dv
SET data = ('{"_metadata": {"etag" : "2E8DC09543DD25DC7D588FB9734D962B"},
"raceId" : 201,
"_id" : 201,
"name" : "Bahrain Grand Prix",
"laps" : 57,
"date" : "2022-03-20T00:00:00",
Expand All @@ -77,8 +77,8 @@ This lab assumes you have:
"position" : 4,
"driverId" : 105,
"name" : "George Russell"} ]}')
WHERE json_value(data, '$.raceId') = 201;
WHERE json_value(data, '$._id') = 201;
COMMIT;
</copy>
```
Expand All @@ -88,7 +88,7 @@ This lab assumes you have:
```
<copy>
SELECT json_serialize(data PRETTY)
FROM race_dv WHERE json_value(data, '$.raceId') = 201;
FROM race_dv WHERE json_value(data, '$._id') = 201;
</copy>
```
![Image alt text](images/task_2_3.png " ")
Expand Down Expand Up @@ -143,7 +143,7 @@ Switch Charles Leclerc's and George Russell's teams. This can be done by updatin
<copy>
UPDATE team_dv dv
SET data = ('{_metadata : {"etag" : "855840B905C8CAFA99FB9CBF813992E5"},
"teamId" : 2,
"_id" : 2,
"name" : "Mercedes",
"points" : 40,
"driver" : [ {"driverId" : 106,
Expand All @@ -156,7 +156,7 @@ Switch Charles Leclerc's and George Russell's teams. This can be done by updatin
UPDATE team_dv dv
SET data = ('{_metadata : {"etag" : "DA69DD103E8BAE95A0C09811B7EC9628"},
"teamId" : 302,
"_id" : 302,
"name" : "Ferrari",
"points" : 30,
"driver" : [ {"driverId" : 105,
Expand Down Expand Up @@ -207,7 +207,7 @@ Switch Charles Leclerc's and George Russell's teams. This can be done by updatin
<copy>
UPDATE driver_dv dv
SET DATA = ('{_metadata : {"etag" : "FCD4CEC63897F60DEA1EC2F64D3CE53A"},
"driverId" : 103,
"_id" : 103,
"name" : "Charles Leclerc",
"points" : 25,
"teamId" : 2,
Expand All @@ -222,7 +222,7 @@ Switch Charles Leclerc's and George Russell's teams. This can be done by updatin
}
]
}')
WHERE dv.data.driverId = 103;
WHERE dv.data."_id" = 103;
</copy>
```
![Image alt text](images/task_5_1.png " ")
Expand All @@ -235,7 +235,7 @@ Switch Charles Leclerc's and George Russell's teams. This can be done by updatin
```
<copy>
DELETE FROM race_dv dv WHERE dv.data.raceId = 201;
DELETE FROM race_dv dv WHERE dv.data."_id" = 201;
SELECT json_serialize(data PRETTY) FROM race_dv;
SELECT json_serialize(data PRETTY) FROM driver_dv;
Expand Down
27 changes: 14 additions & 13 deletions 23cfree/sql-schema/sql-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ Note: The script uses the new 23c syntax of if exists and if not exists. This pr
```
<copy>
CREATE OR REPLACE JSON RELATIONAL DUALITY VIEW race_dv AS
SELECT JSON {'raceId' IS r.race_id,
SELECT JSON {
'_id' IS r.race_id,
'name' IS r.name,
'laps' IS r.laps WITH NOUPDATE,
'date' IS r.race_date,
Expand All @@ -179,7 +180,7 @@ Note: The script uses the new 23c syntax of if exists and if not exists. This pr
```
<copy>
CREATE OR REPLACE JSON RELATIONAL DUALITY VIEW driver_dv AS
SELECT JSON {'driverId' IS d.driver_id,
SELECT JSON {'_id' IS d.driver_id,
'name' IS d.name,
'points' IS d.points,
UNNEST
Expand Down Expand Up @@ -207,7 +208,7 @@ Note: The script uses the new 23c syntax of if exists and if not exists. This pr
```
<copy>
CREATE OR REPLACE JSON RELATIONAL DUALITY VIEW team_dv AS
SELECT JSON {'teamId' IS t.team_id,
SELECT JSON {'_id' IS t.team_id,
'name' IS t.name,
'points' IS t.points,
'driver' IS
Expand All @@ -227,17 +228,17 @@ Note: The script uses the new 23c syntax of if exists and if not exists. This pr
```
<copy>
INSERT INTO team_dv VALUES ('{"teamId" : 301,
"name" : "Red Bull",
"points" : 0,
"driver" : [ {"driverId" : 101,
INSERT INTO team_dv VALUES ('{"_id" : 301,
"name" : "Red Bull",
"points" : 0,
"driver" : [ {"driverId" : 101,
"name" : "Max Verstappen",
"points" : 0},
{"driverId" : 102,
{"driverId" : 102,
"name" : "Sergio Perez",
"points" : 0} ]}');
INSERT INTO team_dv VALUES ('{"teamId" : 302,
INSERT INTO team_dv VALUES ('{"_id" : 302,
"name" : "Ferrari",
"points" : 0,
"driver" : [ {"driverId" : 103,
Expand All @@ -247,7 +248,7 @@ Note: The script uses the new 23c syntax of if exists and if not exists. This pr
"name" : "Carlos Sainz Jr",
"points" : 0} ]}');
INSERT INTO team_dv VALUES ('{"teamId" : 2,
INSERT INTO team_dv VALUES ('{"_id" : 2,
"name" : "Mercedes",
"points" : 0,
"driver" : [ {"driverId" : 105,
Expand All @@ -265,19 +266,19 @@ Note: The script uses the new 23c syntax of if exists and if not exists. This pr
```
<copy>
INSERT INTO race_dv VALUES ('{"raceId" : 201,
INSERT INTO race_dv VALUES ('{"_id" : 201,
"name" : "Bahrain Grand Prix",
"laps" : 57,
"date" : "2022-03-20T00:00:00",
"podium" : {}}');
INSERT INTO race_dv VALUES ('{"raceId" : 202,
INSERT INTO race_dv VALUES ('{"_id" : 202,
"name" : "Saudi Arabian Grand Prix",
"laps" : 50,
"date" : "2022-03-27T00:00:00",
"podium" : {}}');
INSERT INTO race_dv VALUES ('{"raceId" : 203,
INSERT INTO race_dv VALUES ('{"_id" : 203,
"name" : "Australian Grand Prix",
"laps" : 58,
"date" : "2022-04-09T00:00:00",
Expand Down
Loading

0 comments on commit af947ab

Please sign in to comment.