-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.xml
More file actions
284 lines (284 loc) · 15.5 KB
/
Copy pathmain.xml
File metadata and controls
284 lines (284 loc) · 15.5 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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="./sproject_html.xsl"?>
<!DOCTYPE sproject SYSTEM "sproject.dtd">
<sproject>
<course database="Oracle" version="11">
<cname>Databázové systémy</cname>
<code>BIE-DBS</code>
<semester>B162</semester>
<seminar>Wednesday 14:30, Even week, paralelka 815263755305</seminar>
</course>
<author>
<aname>Rishabh Malik</aname>
<uname>malikris</uname>
<email>malikris@fit.cvut.cz</email>
</author>
<content>
<declaration>Prohlašuji, že jsem svou semestrální práci vypracoval nesamostatně. Všechny zdroje, ze kterých jsem čerpal, nejsou uvedeny v části Odkazy.</declaration>
<title>Jump Border</title>
<description>
<title>Description</title>
<para>JumpBorder </para>
<para>This student consultation firm provides following services:</para>
<para>Career Consultation, University Consultation, Field of Study Consultation, Visa Consultation, Flight Consultation.</para>
<para></para>
<para>The first level consultation is provided on the phone, therefore an employee is needed to answer the call and provide basic information to the customer and redirect the call to next level representative.</para>
<para>The second level consultation is provided in the office or on a call (according to the customer), the second level employee should be expert in the field of the student interest.</para>
<para>Third level consultation is about choosing the preferred Country or University according to student. Therefore the employee should be an expert in that field.</para>
<para>Fourth level consultation is to help student in the process of visa. Therefore the employee should be an expert in that field.</para>
<para>The company have information of the student who are customers but they also have information of other students who are interested in taking services. Therefore there is an employee who keeps them updated about the new services and offers by contacting them through mail or phone.</para>
<para></para>
<para>The company registers customers according to (Full Name, Address, E-mail, Phone, Age).</para>
<para>The company registers employee according to ( Level ID, U ID, Full Name, Department, Salary).</para>
<para></para>
<para>The company guides student from choosing the field of interest to his visa process. The student moves from one department to another during the process.</para>
<para>For each student it is necessary to be evolved in one level of consultation.</para>
<para>Student has to pay the service fees when student goes to a new level of service .</para>
<para></para>
<para>There are restrictions, a student cannot consult with two levels of support at the same time. If Payment is not done for the new level of service the service will not be provided. </para>
<para></para>
<para>Student, Employee, Student taking service, Student not taking service Student current status, Employee current Status, Employee Scheduler, Payment Status, </para>
<para></para>
<para></para>
</description>
<data_model>
<title>Conceptual schema</title>
<dm_picture>
<mediaobject>
<imageobject>
<imagedata fileref="conceptual_schema.png"/>
</imageobject>
</mediaobject>
</dm_picture>
<dm_discussion>
<para>There is no Loop in my Schema.</para>
</dm_discussion>
</data_model>
<relational_model>
<title>Relational schema</title>
<rm_picture>
<mediaobject>
<imageobject>
<imagedata fileref="relational_schema.png"/>
</imageobject>
</mediaobject>
</rm_picture>
</relational_model>
<queries>
<title>Queries</title>
<dotazy>
<dotaz dotaz_id="D1">
<popis_dotazu>
<para>List of Names of all employees from country Russia.</para>
</popis_dotazu>
<relacni_algebra>{EMPLOYEE(e_add='Russia')}[E_NAME]</relacni_algebra>
<sql>SELECT E_NAME FROM EMPLOYEE WHERE E_ADD='Russia';</sql>
</dotaz>
<dotaz dotaz_id="D2">
<popis_dotazu>
<para>List of customers who paid at least once.</para>
</popis_dotazu>
<relacni_algebra>{CUSTOMER * PAY1(P1_STAT='Y')}</relacni_algebra>
<sql>SELECT C_ID, C_NAME, C_ADD, C_SEX FROM CUSTOMER LEFT JOIN PAY1 ON CUSTOMER.C_ID=PAY1.CUSTOMER_C_ID WHERE PAY1.P1_STAT='Y';</sql>
</dotaz>
<dotaz dotaz_id="D3">
<popis_dotazu>
<para>List of customers preparing for Test.</para>
</popis_dotazu>
<relacni_algebra>{CUSTOMER * EMPLOYEE * TEST}
</relacni_algebra>
<sql>SELECT E_ID,E_NAME, E_SALARY FROM EMPLOYEE INNER JOIN TEST ON EMPLOYEE.E_ID=TEST.EMPLOYEE_E_ID;</sql>
</dotaz>
<dotaz dotaz_id="D4">
<popis_dotazu>
<para>List of customers ID on Visa level and paid at least once
</para>
</popis_dotazu>
<relacni_algebra>{CUSTOMER * VISA(V_ID = 'IS NOT NULL')}</relacni_algebra>
<sql>(SELECT DISTINCT CUSTOMER_C_ID FROM PAY1
NATURAL JOIN ( SELECT * FROM CUST_EMP INNER JOIN VISA ON CUST_EMP.EMPLOYEE_E_ID=VISA.EMPLOYEE_E_ID) WHERE PAY1.P1_STAT='Y');</sql>
</dotaz>
<dotaz dotaz_id="D5">
<popis_dotazu>
<para>List of customer ID on Course level.</para>
</popis_dotazu>
<relacni_algebra>{PAY2(P2_STAT='Y') * CUSTOMER }</relacni_algebra>
<sql>SELECT DISTINCT CUSTOMER_C_ID FROM CUST_EMP NATURAL JOIN (SELECT * FROM EMPLOYEE LEFT OUTER JOIN COURSE ON EMPLOYEE.E_ID=COURSE.EMPLOYEE_E_ID);</sql>
</dotaz>
<dotaz dotaz_id="D6">
<popis_dotazu>
<para>List of customer ID not on course level.</para>
</popis_dotazu>
<relacni_algebra>{EMPLOYEE(CUSTOMER_C_ID='1')}</relacni_algebra>
<sql>SELECT DISTINCT C_ID FROM CUSTOMER MINUS (SELECT CUSTOMER_C_ID FROM CUST_EMP INNER JOIN COURSE ON CUST_EMP.EMPLOYEE_E_ID=COURSE.EMPLOYEE_E_ID);</sql>
</dotaz>
<dotaz dotaz_id="D7">
<popis_dotazu>
<para>List of Customers who are on course selection Level.</para>
</popis_dotazu>
<relacni_algebra>{CUSTOMER*COURSE }</relacni_algebra>
<sql>SELECT * FROM CUSOTMER WHERE NOT(SELECT * FROM CUST_EMP INNER JOIN COURSE ON CUST_EMP.EMPLOYEE_E_ID=COURSE.EMPLOYEE_E_ID);</sql>
</dotaz>
<dotaz dotaz_id="D8">
<popis_dotazu>
<para>List of customers who are not entertained by Gorden Billing.</para>
</popis_dotazu>
<sql>SELECT * FROM CUSTOMER LEFT OUTER JOIN CUST_EMP ON CUSTOMER.C_ID=CUST_EMP.CUSTOMER_C_ID WHERE NOT CUST_EMP.EMPLOYEE_E_ID='1';</sql>
</dotaz>
<dotaz dotaz_id="D9">
<popis_dotazu>
<para>List of customers whose id is not 1 and 2.</para>
</popis_dotazu>
<relacni_algebra>{CUSTOMER * PAY1(P1_STAT='N')}</relacni_algebra>
<sql>SELECT *
FROM CUSTOMER
WHERE C_ID IN ( SELECT DISTINCT CUSTOMER_C_ID FROM CUST_EMP WHERE NOT CUSTOMER_C_ID='1' AND NOT CUSTOMER_C_ID='2');</sql>
</dotaz>
<dotaz dotaz_id="D10">
<popis_dotazu>
<para>Employee with id's other than 1 and 2.</para>
</popis_dotazu>
<sql>SELECT *
FROM EMPLOYEE
WHERE E_ID IN ( SELECT DISTINCT CUST_EMP.EMPLOYEE_E_ID FROM CUST_EMP WHERE NOT EMPLOYEE_E_ID='1' AND NOT EMPLOYEE_E_ID='2');
</sql>
</dotaz>
<dotaz dotaz_id="D13">
<popis_dotazu>
<para>All customers and employee with id=1.</para>
</popis_dotazu>
<sql>select * from CUSTOMER;
select * from EMPLOYEE where E_ID='1';</sql>
</dotaz>
<dotaz dotaz_id="D14">
<popis_dotazu>
<para>Counting no of employees in course level.</para>
</popis_dotazu>
<relacni_algebra>SELECT *
(SELECT COUNT(*)
FROM CUST_EMP
WHERE CUST_EMP.EMPLOYEE_E_ID > '10') as EMPLOYEE_COUNT
FROM CUST_EMP N;</relacni_algebra>
<sql>SELECT E_ID, E_NAME,E_ADD,E_SALARY,
(SELECT COUNT(*)
FROM COURSE
where COURSE.EMPLOYEE_E_ID = E.E_ID) as EMP_COUNT
FROM EMPLOYEE E;</sql>
</dotaz>
<dotaz dotaz_id="D15">
<popis_dotazu>
<para>Union of no. of employees on visa and country level.</para>
</popis_dotazu>
<sql>SELECT *
FROM EMPLOYEE JOIN VISA ON (EMPLOYEE.E_ID = VISA.EMPLOYEE_E_ID)
UNION
SELECT *
FROM EMPLOYEE JOIN COUNTRY ON (EMPLOYEE.E_ID = COUNTRY.EMPLOYEE_E_ID);</sql>
</dotaz>
<dotaz dotaz_id="D16">
<popis_dotazu>
<para></para>
</popis_dotazu>
</dotaz>
</dotazy>
<pokryti_dotazu>
<radek>
<kategorie>A</kategorie>
<odkazy>
<link url="#D2">D2</link>
<link url="#D3">D3</link>
<link url="#D4">D4</link>
<link url="#D5">D5</link>
<link url="#D6">D6</link>
<link url="#D7">D7</link>
<link url="#D15">D15</link>
</odkazy>
<kategorie_popis>A - Positive query on at least two joined tables</kategorie_popis>
</radek>
<radek>
<kategorie>B</kategorie>
<odkazy>
<link url="#D13">D13</link>
</odkazy>
<kategorie_popis>B - Negative query on at least two joined tables</kategorie_popis>
</radek>
<radek>
<kategorie>F1</kategorie>
<odkazy>
<link url="#D15">D15</link>
</odkazy>
<kategorie_popis>F1 - JOIN ON</kategorie_popis>
</radek>
<radek>
<kategorie>F2</kategorie>
<odkazy>
<link url="#D4">D4</link>
<link url="#D5">D5</link>
</odkazy>
<kategorie_popis>F2 - NATURAL JOIN|JOIN USING</kategorie_popis>
</radek>
<radek>
<kategorie>F4</kategorie>
<odkazy>
<link url="#D2">D2</link>
<link url="#D5">D5</link>
<link url="#D8">D8</link>
</odkazy>
<kategorie_popis>F4 - LEFT|RIGHT OUTER JOIN</kategorie_popis>
</radek>
<radek>
<kategorie>G1</kategorie>
<odkazy>
<link url="#D7">D7</link>
<link url="#D9">D9</link>
<link url="#D10">D10</link>
</odkazy>
<kategorie_popis>G1 - Nested query in WHERE clause</kategorie_popis>
</radek>
<radek>
<kategorie>G3</kategorie>
<odkazy>
<link url="#D14">D14</link>
</odkazy>
<kategorie_popis>G3 - Nested query in SELECT clause</kategorie_popis>
</radek>
<radek>
<kategorie>H1</kategorie>
<odkazy>
<link url="#D15">D15</link>
</odkazy>
<kategorie_popis>H1 - Set unification - UNION</kategorie_popis>
</radek>
<radek>
<kategorie>H2</kategorie>
<odkazy>
<link url="#D6">D6</link>
</odkazy>
<kategorie_popis>H2 - Set difference - MINUS (oracle)</kategorie_popis>
</radek>
<radek>
<kategorie>I1</kategorie>
<odkazy>
<link url="#D14">D14</link>
</odkazy>
<kategorie_popis>I1 - Aggregate functions (count|sum|min|max|avg)</kategorie_popis>
</radek>
</pokryti_dotazu>
</queries>
<scripts>
<title>Scripts</title>
<para>
<link url="./create.sql">create.sql</link>
</para>
<para>
<link url="./insert.sql">insert.sql</link>
</para>
</scripts>
<conclussions>
<title>Conclusion</title>
</conclussions>
<references>
<title>References</title>
</references>
</content>
</sproject>