vault backup: 2024-04-15 19:20:46

This commit is contained in:
2024-04-15 19:20:46 +01:00
parent 30bfa6f243
commit 9d548c7912
22 changed files with 23784 additions and 26 deletions

6
.obsidian/app.json vendored
View File

@@ -1,7 +1,7 @@
{
"showInlineTitle": true,
"useMarkdownLinks": true,
"promptDelete": false,
"promptDelete": true,
"showLineNumber": true,
"attachmentFolderPath": "images",
"pdfExportSettings": {
@@ -10,5 +10,7 @@
"margin": "2",
"downscalePercent": 100
},
"readableLineLength": false
"readableLineLength": false,
"alwaysUpdateLinks": true,
"newFileLocation": "current"
}

View File

@@ -1,7 +1,7 @@
{
"accentColor": "",
"accentColor": "#4f78d8",
"theme": "obsidian",
"cssTheme": "Dracula Official",
"cssTheme": "Things",
"nativeMenus": true,
"baseFontSize": 16
}

View File

@@ -1,9 +1,10 @@
[
"obsidian-git",
"dataview",
"obsidian-excel-to-markdown-table",
"obsidian-linter",
"omnisearch",
"obsidian-diagrams-net",
"obsidian-full-calendar"
"obsidian-full-calendar",
"obsidian-style-settings",
"url-into-selection"
]

View File

@@ -0,0 +1,19 @@
{
"title@@vibrant": true,
"title@@dim-light-mode": false,
"title@@enable-mica": true,
"title@@no-top-space": false,
"title@@fab-enabled-desktop": true,
"title@@custom-page-header": true,
"title@@more-drag-desktop": false,
"title@@hide-toolbar-desktop": false,
"title@@space-above-document": true,
"title@@button-shapes-mobile": true,
"title@@win-menu": false,
"things-style@@no-kanban-styles": false,
"things-style@@fancy-highlight": true,
"things-style@@fancy-code": true,
"things-style@@active-line": true,
"things-style@@link-decoration": "None",
"things-style@@default-font-color": false
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,10 @@
{
"id": "obsidian-style-settings",
"name": "Style Settings",
"version": "1.0.8",
"minAppVersion": "0.11.5",
"description": "Offers controls for adjusting theme, plugin, and snippet CSS variables.",
"author": "mgmeyers",
"authorUrl": "https://github.com/mgmeyers/obsidian-style-settings",
"isDesktopOnly": false
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
{
"id": "url-into-selection",
"name": "Paste URL into selection",
"description": "Paste URL \"into\" selected text.",
"isDesktopOnly": false,
"js": "main.js",
"version": "1.7.0"
}

View File

@@ -0,0 +1,7 @@
{
"name": "AnuPpuccin",
"version": "1.4.5",
"minAppVersion": "0.16.0",
"author": "Anubis",
"authorUrl": "https://github.com/AnubisNekhet"
}

8490
.obsidian/themes/AnuPpuccin/theme.css vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
{
"name": "Material Flat",
"version": "1.4.0",
"minAppVersion": "0.16.0",
"author": "Threethan, Joschua",
"authorUrl": "https://github.com/Threethan/"
}

2576
.obsidian/themes/Material Flat/theme.css vendored Normal file

File diff suppressed because one or more lines are too long

7
.obsidian/themes/Things/manifest.json vendored Normal file
View File

@@ -0,0 +1,7 @@
{
"name": "Things",
"version": "2.1.20",
"minAppVersion": "1.0.0",
"author": "@colineckert",
"authorUrl": "https://twitter.com/colineckert"
}

1628
.obsidian/themes/Things/theme.css vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -18,8 +18,21 @@
"source": false
}
}
},
{
"id": "d83bb0bbeeb86eec",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Semester 2/Database Systems/Trimester 2 Assignment.md",
"mode": "source",
"source": false
}
}
}
]
],
"currentTab": 1
}
],
"direction": "vertical"
@@ -86,7 +99,7 @@
"state": {
"type": "backlink",
"state": {
"file": "Semester 2/Programming 2/Week 10 Revision/Q5.md",
"file": "Semester 2/Database Systems/Trimester 2 Assignment.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
@@ -103,7 +116,7 @@
"state": {
"type": "outgoing-link",
"state": {
"file": "Semester 2/Programming 2/Week 10 Revision/Q5.md",
"file": "Semester 2/Database Systems/Trimester 2 Assignment.md",
"linksCollapsed": false,
"unlinkedCollapsed": true
}
@@ -126,7 +139,7 @@
"state": {
"type": "outline",
"state": {
"file": "Semester 2/Programming 2/Week 10 Revision/Q5.md"
"file": "Semester 2/Database Systems/Trimester 2 Assignment.md"
}
}
},
@@ -166,8 +179,22 @@
"switcher:Open quick switcher": false
}
},
"active": "671043c113c40804",
"active": "d83bb0bbeeb86eec",
"lastOpenFiles": [
"Semester 2/Database Systems/Week 8/Week 8 Database Systems.md",
"Semester 2/Database Systems/Week 10/Week 10 Database Systems.md",
"Semester 2/Database Systems/Week 9/Week 9 Database Systems.md",
"Semester 2/Database Systems/Trimester 2 Assignment.md",
"images/Pasted image 20240415190127.png",
"images/Pasted image 20240415190010.png",
"images/Pasted image 20240415175614.png",
"images/Pasted image 20240415135455.png",
"images/Pasted image 20240415134042.png",
"Semester 2/Programming 2/Week 10 Revision/Q5.md",
"Semester 2/Programming 2/Assessment 3 Revision/Parameter Passing WS2.md",
"Semester 2/Programming 2/Assessment 3 Revision/Parameter Passing WS1.md",
"Semester 2/HCI/Week 3/Week 3 Human Computer Interfaces.md",
"Semester 2/Programming 2/Assessment 3 Revision/Parameter Passing WS3.md",
"Semester 2/Programming 2/Project/Part 2/package.bluej",
"Semester 2/Programming 2/Project/Part 2",
"Semester 2/Programming 2/Project/Part 4 Complete.zip",
@@ -179,41 +206,26 @@
"Semester 2/Programming 2/Project/Part 4 Complete/doc/package-frame.html",
"Semester 2/Programming 2/Project/Part 4 Complete/doc/logfile.txt",
"Semester 2/Programming 2/Project/Part 4 Complete/doc/index.html",
"Semester 2/Programming 2/Project/Part 4 Complete/doc/constant-values.html",
"images/Pasted image 20240319234142.png",
"images/Pasted image 20240319225420.png",
"Semester 2/Programming 2/Week 10 Revision/Q4.md",
"Semester 2/Programming 2/Week 10 Revision/Q5.md",
"images/Pasted image 20240319224232.png",
"Semester 2/Programming 2/Week 10 Revision/Q3.md",
"Semester 2/Database Systems/Week 10/Week 10 Database Systems.md",
"images/Pasted image 20240319163053.png",
"images/Pasted image 20240319162824.png",
"images/Pasted image 20240319161202.png",
"images/Pasted image 20240319160609.png",
"Semester 2/Programming 2/Week 10 Revision/Q1.md",
"Semester 2/Database Systems/Week 2/Week 2 Database Systems.md",
"Semester 2/Database Systems/Week 1/Week 1 Database Systems.md",
"Semester 1/Database Systems/Week 10/Week 10 Database Systems.md",
"Semester 2/Database Systems/Week 3/Week 3 Database Systems.md",
"Semester 2/Database Systems/Week 4/Week 4 Database Systems.md",
"Semester 2/Database Systems/Week 9/Week 9 Database Systems.md",
"images/Pasted image 20240312161933.png",
"images/Pasted image 20240312161927.png",
"Semester 2/Database Systems/Week 8/Week 8 Database Systems.md",
"Semester 2/Database Systems/Week 7/Week 7 Database Systems.md",
"Semester 2/Database Systems/Week 6/Week 6 Database Systems.md",
"Semester 2/Computer Systems Internals & Linux/Week 6/Week 6 Computer Systems Internals.md",
"Semester 2/Programming 2/Assessment 3 Revision/Parameter Passing WS3.md",
"Semester 2/Computer Systems Internals & Linux/Untitled.md",
"Semester 2/Programming 2/Assessment 3 Revision/Parameter Passing WS2.md",
"Semester 2/Programming 2/Assessment 3 Revision/Parameter Passing WS1.md",
"Semester 2/Database Systems/Week 5/Week 5 Database Systems.md",
"Semester 2/HCI/Week 2/Week 2 Human Computer Interfaces.md",
"Semester 2/HCI/Week 3/Week 3 Human Computer Interfaces.md",
"Semester 1/Database Systems/Week 11/Week 11 Database Systems.md",
"Semester 1/Database Systems/Week 5/Week 5 Database Systems.md",
"Semester 1/Database Systems/Week 3/Week 3 Database Systems.md",
"Database Systems/Untitled.canvas",
"Untitled 1.canvas",
"Untitled.canvas"

View File

@@ -0,0 +1,136 @@
# Q1
### a)
#### i)
1 tuple = 24 + 5 + 10 + 20 + 6 = 65b
1 block = 1024 - 24 = 1000b
1000 / 65 = 15.38, 15 tuples can be stored in 1 block
800 / 15 = 53.33, **54** blocks are needed to store all tuples in this relation.
#### ii)
65 - 20 = 45b
1000 / 45 = 22.22, 22 tuples per block
800 / 22 = 36.36, **37** blocks for this projection.
#### iii)
If the "street" attribute is unneeded, less IO operations are needed to retrieve the relevant data from disk, making the query more efficient. As a result, this also uses less disk space, and optimises memory usage for processing.
### b)
#### i)
![](Pasted%20image%2020240415135455.png)
#### ii)
Root Node: $\pi$ ( factory.name )
Leaf Nodes: factory, order
#### iii)
Line-by-line:
1. This is the final attribute we want to obtain. Placing this here ensures only the necessary data is output; reduces IO operations and memory usage, as only the required data is given.
2. Exists to join the 2 tables together based on the condition that the order's factory ID = factory's ID, allowing the projection root node to have the necessary data from the factory table to obtain the factory's name.
3. There is an argument for this being above or below the theta join, however I have placed this here due to the heuristic principles of query optimisation, moving selection operations down the tree. This exists to "filter" the result on the condition that the order is urgent. By placing this selection after the theta join, we can "filter" more selectively and reduce the dataset size to optimise memory usage, similar to the adjacent selection operation.
4. This exists to "filter" the dataset on the condition that the quantity is larger than 20 units. By placing this at the start, we ensure filtering is executed earlier, as to not waste compute resources. This reduces the dataset size, allowing the following operations to be more optimised, as there is less data to be processed.
# Q2
# **a)**
*Consistency: Database should be in a consistent state, prior to a transaction and after. e.g. Following constraints, relationships, etc.
Isolation: All transactions should by fully independent from concurrently executing transactions.
Durability: When a transaction is committed, it's effect should be permanent in the database, withstanding system failures or restarts.*
*Atomicity: A transaction must be completed, or aborted. If a transaction fails, a DBMS ensures the rollback of data to allow the database to remain consistent.
Consistency: A DBMS would enforce constraints on a transaction, assuring the defined rules / relationships are followed.
Isolation: Reduces concurrency issues by restricting access to shared data until a transaction is committed.
Durability: Guarantees data is permanent once committed, preventing inconsistency after failures.*
### b)
To guarantee consistency, a DBMS handles the enforcement of atomicity, consistency, isolation and durability, along with concurrency control to prevent conflicts.
Transfer of crates:
```sql
UPDATE warehouses
SET crates = crates - 3
WHERE wname = 'warehouse1'
UPDATE warehouses
SET crates = crates + 3
WHERE wname = 'warehouse2';
```
### c)
By allowing concurrent execution of transactions, system resources are allocated more efficiently due to multiple operations occurring simultaneously. This has an effect of being more performant, since more transactions can be processed per second.
### d)
#### i)
Transaction 1 updates multiple values while Transaction 2 is reading, as can be seen in t4, as 10 units are added to W1, so the sum would be 10 units too low.
#### ii)
Inconsistent Analysis
### e)
#### i)
![](Pasted%20image%2020240415190010.png)
#### ii)
The graph is not serialisable, since there is a directed cycle in the precedence graph - the graph is cyclic.
# Q3
### a)
An exclusive lock is used when a transaction must update / write to an item to avoid conflicts.
### b)
2-phase locking consists of a growing phase and a shrinking phase. A transaction must acquire a read or write lock on an item before operation (growing phase), after which it must release all locks and acquire no more (shrinking phase). Transactions do not have to simultaneously acquire locks, but must adhere to these rules.
### c)
#### i)
![](Pasted%20image%2020240415190127.png)
#### ii)
Deadlock does not occur, since there are no cycles in the graph
### d)
#### i)
The recovery manager would first identify in-progress transactions at the time of failure
# Q4
### a)
#### i)
```sql
SELECT partName
FROM part
WHERE partPrice > 100;
```
#### ii)
```sql
SELECT
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB