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...
Write a PHP Program to display all the $_SERVER elements
Write a PHP Program to display all the $_SERVER elements
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...
1. Write a for loop that will display all of the multiples of 3, one per...
1. Write a for loop that will display all of the multiples of 3, one per line. The starting point is a variable called lower, and the ending point is an integer called upper, inclusive. The "lower" and "upper" variables have been properly declared and assigned values where the value of lower is less than or equal to the value of upper. Declare any other variables that are needed. 2. Write a "while" loop that does the same thing as...
Display the shortest words in a sentence in JAVA Write a method that displays all the...
Display the shortest words in a sentence in JAVA Write a method that displays all the shortest words in a given sentence. You are not allowed to use array In the main method, ask the user to enter a sentence and call the method above to display all the shortest words in a given sentence. You must design the algorithms for both the programmer-defined method and the main method.
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...
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:  ? μ...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT