Question

In: Computer Science

Write an XQUERY to display the information for all students who are not Malaysians or older...

Write an XQUERY to display the information for all students who are not Malaysians or older than 25

<root>
<students>
   <element>
       <ID>100345</ID>
       <Nationality>USA</Nationality>
       <Program>ICT</Program>
       <age>23</age>
       <name>John</name>
   </element>
   <element>
       <ID>100876</ID>
       <Nationality>MALAYSIA</Nationality>
       <Program>CS</Program>
       <age>28</age>
       <name>Awang</name>
   </element>
   <element>
       <ID>100257</ID>
       <Nationality>AUSTRALIA</Nationality>
       <age>25</age>
       <name>Alex</name>
   </element>
</students>
</root>

Solutions

Expert Solution

Hello ,Please find below answer. If you have ny queries you can tell me.

Answer : root/students/element[Nationality!='MALAYSIA' or age>25]

Output :

<?xml version="1.0" encoding="UTF-8"?>
<element>
       <ID>100345</ID>
       <Nationality>USA</Nationality>
       <Program>ICT</Program>
       <age>23</age>
       <name>John</name>
   </element>
<element>
       <ID>100876</ID>
       <Nationality>MALAYSIA</Nationality>
       <Program>CS</Program>
       <age>28</age>
       <name>Awang</name>
   </element>
<element>
       <ID>100257</ID>
       <Nationality>AUSTRALIA</Nationality>
       <age>25</age>
       <name>Alex</name>
   </element>

The above query will display all 3 student information because every student have either age > 25 or nationality is not malaysia.

Thank you.


Related Solutions

1. Write the statement that will display all of the information in the PetOwner table using...
1. Write the statement that will display all of the information in the PetOwner table using the asterisk (*) notation. 2. Write the statement that will display all of the information in the PetOwner table without using the asterisk (*) notation. 3. Write the statement that will display the first and last names of the owners in that order. 4. Write the statement to display the breed, type and DOB of all pets having a type of Cat. 5. Write...
It is known that 76.3% of all high school students age 16 or older in the...
It is known that 76.3% of all high school students age 16 or older in the United States have driven a car in the past month. Suppose you take a random sample of 82 high school students age 16 or older. What is the probability that less than 70% of the students in your sample have driven a car in the past month? a) 0.0901 b) 0.1075 c) 0.2776 d) this cannot be determined as the central limit theorem conditions...
Write a program that will read a line of text. Display all the letters that occure...
Write a program that will read a line of text. Display all the letters that occure in the text, one per line and in alphabetical order, along with the number of times each letter occurs in the text. Use an array of base type int of length 26, so that the element at index 0 contains the number of a’s, the element at index 1 contains the number of b’s, and so forth, Alloow both upperCase and lower Case. Define...
An article in the The Star Newspaper implies that more than half of all Malaysians would...
An article in the The Star Newspaper implies that more than half of all Malaysians would prefer to being given RM100 rather than a day off for work. This statement is based on a survey conducted by Malaysian Employee Incentives and Remunerations Research Consultant Agency, in which 1,040 of 2,000 respondents indicated that they would rather have the RM100. At 0.05 level of significance, is there evidence based on the survey data that more than half of all Malaysians would...
There are students, as well as faculty, who are active in campus politics. All who are...
There are students, as well as faculty, who are active in campus politics. All who are active in campus politics are encouraged to join the university governing board. If the statements above are true, which of the following must also be true? a. All who are encouraged to join the university governing board are active in campus politics. b. All who are encouraged to join the university governing board are faculty or students. c. Some who are encouraged to join...
Using python Write a program that displays all of states in the U.S. and display each...
Using python Write a program that displays all of states in the U.S. and display each state that begins with the letter A.
1. Write a bash command that will display the value of all environment variables defined in...
1. Write a bash command that will display the value of all environment variables defined in your shell process, sorted in alphabetical order, and numbered. Here is a sample of the type of output your command should produce: 1 } 2 ALSA_CONFIG_PATH=/etc/alsa-pulse.conf 3 AUDIODRIVER=pulseaudio 4 BASH_FUNC_mc%%=() { . /usr/share/mc/mc-wrapper.sh 5 COLORTERM=1 2. Write a bash command that will display the value (and only the value) of the JAVA_ROOT environment variable. Here is a sample of the type of output your...
10% of all college students volunteer their time. Is the percentage of college students who are...
10% of all college students volunteer their time. Is the percentage of college students who are volunteers smaller for students receiving financial aid? Of the 339 randomly selected students who receive financial aid, 17 of them volunteered their time. What can be concluded at the αα = 0.01 level of significance? For this study, we should use Select an answer t-test for a population mean z-test for a population proportion The null and alternative hypotheses would be:    H0:H0:  ? p...
17% of all college students volunteer their time. Is the percentage of college students who are...
17% of all college students volunteer their time. Is the percentage of college students who are volunteers smaller for students receiving financial aid? Of the 329 randomly selected students who receive financial aid, 39 of them volunteered their time. What can be concluded at the αα = 0.05 level of significance? For this study, we should use Select an answer z-test for a population proportion t-test for a population mean The null and alternative hypotheses would be:    H0:H0:  ? μ...
10% of all college students volunteer their time. Is the percentage of college students who are...
10% of all college students volunteer their time. Is the percentage of college students who are volunteers smaller for students receiving financial aid? Of the 322 randomly selected students who receive financial aid, 26 of them volunteered their time. What can be concluded at the αα = 0.05 level of significance? For this study, we should use Select an answer t-test for a population mean z-test for a population proportion The null and alternative hypotheses would be:    H0:H0:  ? μ...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT