Skip to content
This repository has been archived by the owner on Jul 3, 2022. It is now read-only.

Commit

Permalink
updated formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
lcabraja committed Mar 23, 2022
1 parent aee2ecb commit ce06db4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions exercise-03/task-01/query.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
## Task 01

1. All people
```
```xquery
/imenik/osoba
```

2. All people named Ana
```
```xquery
/imenik/osoba[ime="Ana"]
```

3. All people whos postcode is '10000' in alphabetical order
```
```xquery
for $item in /imenik/osoba
where $item/adresa/postanskiBroj=10000
order by $item/ime
return $item/ime
```

4. All data represented as an HTML list
```
```xquery
<ul>
{
for $item in /imenik/osoba
Expand All @@ -29,28 +29,28 @@ return <li>{$item}</li>
```

5. All names and surnames without an 'oib' attribute
```
```xquery
for $item in /imenik/osoba
where empty($item/@oib)
return ($item/ime, $item/prezime)
```

6. All names and surnames whose 'oib' attribute is not 11 characters long
```
```xquery
for $item in /imenik/osoba
where string-length($item/@oib)!=11
return ($item/ime, $item/prezime)
```

7. All phone numbers that aren't marked as 'Privatni'
```
```xquery
for $item in /imenik/osoba
where $item/kategorija != "Privatni"
return $item/telefon
```

8. All email addresses of those whose surnames end in 'ić'
```
```xquery
for $item in /imenik/osoba
where ends-with($item/prezime, "ić")
return $item/email
Expand Down
8 changes: 4 additions & 4 deletions exercise-03/task-02/query.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
1. Name and surname where 'oib' starts with '0'
```
```xquery
for $item in /imenik/osoba
where starts-with($item/@oib, "0")
return ($item/ime,$item/prezime)
```

2. Street and place where post number is greater than 30
```
```xquery
for $item in /imenik/osoba
where $item/adresa/postanskiBroj>30
return ($item/adresa/ulica,$item/adresa/mjesto)
```

3. Email where surname starts with 'R'
```
```xquery
for $item in /imenik/osoba
where starts-with($item/prezime, "R")
return $item/email
```


4. Surname where place is 'Zagreb'
```
```xquery
for $item in /imenik/osoba
where $item/adresa/mjesto="Zagreb"
return $item/prezime
Expand Down

0 comments on commit ce06db4

Please sign in to comment.