-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1DV503.html
More file actions
257 lines (232 loc) · 13.9 KB
/
1DV503.html
File metadata and controls
257 lines (232 loc) · 13.9 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
<body>
<h1>Assignments</h1>
<h2>Pre-Assignment description</h2>
<h3>READ ME!</h3>
<p>See if you fulfil the condition listed here and take appropriate action.</p>
<ul>
<li>If you did not install MySQL on your machine, start at STEP 1, else check next:</li>
<li>If you have MySQL Workbench or phpMyAdmin installed, go to STEP 3. If not, follow next instruction: - Start at STEP 2.</li>
</ul>
</p>
<h3>STEP 1</h3>
<p>Install Apache, MySQL and PHP bundle as this will be the quickest and pain-free way to start running your LAB exercises and do the assignments. </p>
<p style="font-family:verdana;color:orange"># I have installed Apache2, MySQL and PHP@8.0 by homebrew</p>
<ul>
<li>Windows & Mac users install <a href="https://www.mamp.info/en/downloads/">MAMP</a></li><p style="font-family:verdana;color:orange"># I have installed MAMP by homebrew.</p>
<li>Linux (a bit harder) users install <a href="https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-ubuntu-18-04">LAMP</a></li>
</ul>
<p>Run MAMP and start the server. The lights beside Apache Server and MySQL Server should be green. (NOTE: you do not need apache server unless you want to use phpMyAdmin).</p>
<p>Those of you who installed MAMP will have the phpMyAdmin installed and can be accessed directly in browser by following this procedure:</p>
<ul>
<li>Click 'Open WebStart page' on MAMP window; your browser should display MAMP local page.</li>
<li>Select 'TOOLS' from the menu and click 'PHPMYADMIN'; here you are!</li>
</ul>
<p>Those of you who feel comfortable with phpMyAdmin can continue using it and skip the next step and go to STEP 3.</p>
<h3>STEP 2</h3>
<p>Skip this step if you have phpMyAdmin and are comfortable using it.</p>
<p>Install MySQL <a href="https://www.mysql.com/products/workbench/">Workbench!</a></p>
<p>Run the tool and it should connect automatically. If not, check the port numbers and google for trouble shooting. If nothing works we try to solve it together.</p>
<h3>STEP 3</h3>
<p>Take a screenshot of your working MySQL Workbench or phpMyAdmin and upload it to the assignment sheet. If it is not working, upload the screenshot of the problem you are receiving.</p>
<p style="font-family:verdana;color:orange">
This text is in Verdana and red</p>
</body>
<hr>
<body>
<h1><a href="https://mymoodle.lnu.se/pluginfile.php/6857029/mod_resource/content/2/intro.pdf">Lecture1: Course Introduction</a></h1>
<h4><a href="https://miketao.oss-cn-shanghai.aliyuncs.com/Lecture_Sides/1DV503/Lecture1_Course_Introduction.pdf">Lecture1: Course Introduction</a><h4>
<h2>Two Courses</h2>
<p>
<ul>
<li>1DV503 - Database technology</li>
<li>1DT903 - Databases and data modeling</li>
<li>What is different?<ul><li>Assignments and examination will be adjusted for each separately. Major topics discussed are relatively the same.</li></ul></li>
</ul>
</p>
<h2>Some topics covered within this course</h2>
<p>
<ul>
<li>Databases and Database Management Systems (DBMS)</li>
<li>Database model (ex. Relational model)</li>
<li>Database design</li>
<li>Database programming</li>
<li>Transactions</li>
<li>...</li>
</ul>
</p>
<h2>Course Structure</h2>
<p>
<ul>
<li>A series of lectures (10 in total)<ul><li>Usually discussing theoretical aspects</li></ul></li>
<li>Three Labs/Workshops - practical exercises for DB design, SQL and programing with databases<ul><li>NOTE: Python is the programing language used in this course</li></ul></li>
<li>One written assignment</li>
<li>Two programing assignments</li>
<li>Written and Oral examinations</li>
</ul>
</p>
<h2>People</h2>
<p>
<ul>
<li>Ilir Jusufi<ul><li>Examiner of the course</li><li>I will post information on consultation hours later once my schedule for this term is fixed.</li></ul></li>
<li>5 TA's</li>
</ul>
</p>
<h2>Grading</h2>
<p>
<ul>
<li>You will be graded based on 3 modules: <ul><li>W: Written assignment</li><li>P: Programming assignments (the average of both submissions)</li><li>F: Final examination (Written + Oral)</li></ul></li>
<li>Final grade: W*0.2 + P*0.4 + F*0.4</li>
<li>NOTE: You need to pass each of the assignments separately to be able to get a grade!<ul><li>Clarification: You cannot pass the programming module by only passing one of the assignments at maximum points and getting only 50% at the other. You need to have 60% of points on both parts to get a grade!</li></ul></li>
</ul>
</p>
<h2>Grading</h2>
<img src="https://miketao.oss-cn-shanghai.aliyuncs.com/HTML/Other/1DV503_Grading.png" width="30%" height="30%" alt="1DV503_Grading"/>
<h2>Grading - additional information</h2>
<p>
<ul>
<li>WA - Written assignment - individual</li>
<li>PA Programming assignments: <ul><li>PA1 - individual</li><li>PA2 - group</li></ul></li>
<li>Examination: <ul><li>Written examination (grades E - C)</li><li>Book a oral exmination for grade (B - A) after passing the written examination</li></ul></li>
<li>NOTE: It is possible that you might lower your grade during the oral exam if you come unprepared. For instance: You got C in your written examination. While we test you during oral examination, you fail to answer a basic question, you might end up getting a lower grade than C.</li>
</ul>
</p>
<h2>Assignment questions</h2>
<p>
<ul>
<li>Each assignment will have a corresponding forum for questions and communications.<ul><li>SLACK: <a href="https://mymoodle.lnu.se/mod/url/view.php?id=3278094">https://mymoodle.lnu.se/mod/url/view.php?id=3278094</a></li><li><p style="color:red">ASSIGN FOR TUTORING GROUPS IN MOODLE to be able to submit assignments.</p></li></ul></li>
<li>You are expected to post questions in the appropriate forums/channels before you send us an email. There are around to 300 students, and we often get the same question in tens of times. <b>Therefore, post questions on forum/channels, but first check if it was answered before!</b> This will be the fastest way you will get an answer.</li>
</ul>
</p>
<h2>Pre-assignment</h2>
<p>
<ul>
<li>You will get a pre-assignment. This will not be used to grade you but will show your course activity.<ul><li><p style="color:red">Therefore, it is mandatory to submit it!</p></li></ul></li>
</ul>
</p>
<h2>Literature</h2>
<p><ul><li>Elmasri, Ramez, & Navathe, Shamkant B., <a href="https://www.amazon.com/Fundamentals-Ramez-Elmasri-ebook/dp/B09RTFSBRF/ref=sr_1_2?crid=KHQVBZLF7DR&keywords=Fundamentals+of+database+systems.+7th+edition&qid=1644316516&sprefix=%2Caps%2C778&sr=8-2">Fundamentals of database systems. 7th edition</a></li></ul></p>
</body>
<hr>
<body>
<h1><a href="https://mymoodle.lnu.se/pluginfile.php/6857031/mod_resource/content/1/intro%20db%20theory.pdf">Lecture2 Database Theory Introduction</a></h1>
<h4><a href="https://miketao.oss-cn-shanghai.aliyuncs.com/Lecture_Sides/1DV503/Lecture2_Database_Theory_Introduction.pdf">Lecture2 Database Theory Introduction</a><h4>
<h2>DBMS - Introduction</h2>
<p>
<ul>
<li>Database Management System (DBMS)<ul><li>“Powerful tool for creating and managing large amounts of data efficiently and allowing it to persist over long periods of time, safely” [UW:01]</li></ul></li>
<li>DBMS capabilities<ul><li>Persistent storage<ul><li>Large amount of data; exists independent of any processes</li></ul></li><li>Programming interface<ul><li>Easy access and modifications through a query language</li></ul></li><li>Transaction management</li><ul><li>Isolation, atomicity, and durability</li></ul></ul></li>
<li>Functionalities
<ul>
<li>Allows users to create new databases</li>
<ul>
<li>Specification of a schema (logical structure of data)</li>
<ul>
<li>Data-definition language (DDL)</li>
</ul>
</ul>
<li>Allows users to query data</li>
<ul>
<li>Query and modify the data</li>
<ul>
<li>Query language and data-manipulation language (DML), e.g. SQL</li>
</ul>
</ul>
<li>Support the storage of very large amounts of data
<ul>
<li>Secure it from accident or unauthorized use</li>
</ul>
</li>
<li>Controls access to data from many users at once
<ul>
<li>Prevent to corrupt the data accidentally</li>
</ul></ul>
</li>
<li>DBMS vs. File System</li>
<ul>
<li>Conventional file systems are inadequate as database systems!</li>
<li>Why?</li>
<li>They fail to support: </li>
<ul>
<li>Guarantee that data cannot be lost</li>
<li>Efficient search and complex queries</li>
<li>Efficient modifications to small pieces of data</li>
<li>Create a schema (only directory structures)</li>
<li>Atomic and independent execution of transactions (concurrent access)</li>
</ul></ul>
</ul>
</p>
<h2>Early DBMS</h2>
<p>
<ul>
<li>Old DBMSs: IMS (hierarchy-based) or CODASYL (graph-based)</li>
<li>Example: Airline Reservation Systems
<ul>
<li>Data
<ul>
<li>Reservations (flight no, seat, meal preference, ...)</li>
<li>Flights (departure, destination, departure/arrival times, etc.)</li>
<li>Prices</li>
</ul>
<li>Queries</li>
<ul>
<li>Flights on a given date, time, city, seats available, prices</li>
</ul>
<li>Modifications</li>
<ul><li>Booking a flight, assigning a seat, ...</li></ul>
<li>Requirements
<ul>
<li>Concurrent access by many agents (make sure that no two agents assign the same seat
simultaneously)</li>
<li>Avoid loss in case of a sudden system failure</li>
</ul>
</li>
</li>
</ul>
</li>
</ul>
</p>
<h2>Relational Databases</h2>
<p>
<ul>
<li>Based on the relational model
<ul>
<li>[E.F. Codd. A relational model for large shared data banks. Comm. ACM, 13:6,
pp. 377-387, 1971]</li>
</ul>
</li>
<li>Data is organized as tables, called relations
<ul>
<li>Columns: attributes</li>
<li>Rows: tuples</li>
<li><img src="https://miketao.oss-cn-shanghai.aliyuncs.com/HTML/Other/Data%20is%20organized%20as%20tables%2C%20called%20relations.png" width="60%" height="30%" alt="Data is organized as tables, called relations"/></li>
</ul>
</li>
<li>Separates the logical view from the physical view (storage structure) of the data</li>
</ul>
</p>
<h2>Relational Databases</h2>
<p>
<ul>
<li>Querying a Database
<ul>
<li>Find all students who have taken DA2032 in Fall 2007</li>
<li>Structured Query Language ─ SQL
<ul>
<li>SELECT student</li>
<li>FROM Enrollment</li>
<li>WHERE course = ‘DA2032’ AND semester = ‘Fall 2007’</li>
<li>Answer: Sjöberg, Arlefur, Roos, ...</li>
</ul>
</li>
<li>So-called Query Processor figures out how to answer the query efficiently!</li>
</ul>
</li>
</ul>
</p>
<h2>DB in real world</h2>
<p>To Be Continued</p>
</body>
<br />
<body>
<a href="/index.html">Home</a>
</body>