ICT3612
Assignment 3 2024
- DUE 15 July 2024
QUESTIONS WITH DETAILED ANSWERS
,ICT3612 Assignment 3 2024 - DUE 15 July 2024
Question 1 (2 marks)
Which of the following is an aggregate expression that will find the oldest date in the
invoiceDate column?
1. MIN(invoiceDate)
2. MAX(invoiceDate)
3. HIGH(invoiceDate)
4. LOW(invoiceDate)
2. MAX(invoiceDate)
This aggregate function retrieves the maximum (oldest) date from the invoiceDate column.
Question 2 (2 marks)
Which of the following LIMIT clauses will return a maximum of five rows starting with the
eleventh row in the result set? Downloaded by Corona Virus () lOMoARcPSD| 15
ICT3612/102/0/2024
1. LIMIT 10, <= 5
2. LIMIT 11, <= 5
3. LIMIT 10, 5
4. LIMIT 11, 5
The correct answer for Question 2 is:
4. LIMIT 11, 5
This LIMIT clause will start at the eleventh row and return a maximum of five rows from that point
onward in the result set.
Question 3 (2 marks)
When coded in a WHERE clause, which search condition will return invoices when
paymentDate isn’t null and invoiceTotal is greater than or equal to 500?
1. paymentDate IS NULL AND invoiceTotal > 500
2. paymentDate IS NOT NULL OR invoiceTotal >= 500
3. NOT (paymentDate IS NULL AND invoiceTotal <= 500)
4. paymentDate IS NOT NULL AND invoiceTotal >= 500
, The correct answer for Question 3, which will return invoices when paymentDate isn’t null and
invoiceTotal is greater than or equal to 500, is:
4. paymentDate IS NOT NULL AND invoiceTotal >= 500
This condition ensures that both paymentDate is not null (indicating payment has been made) and
invoiceTotal is $500 or more.
Question 4 (1 mark)
Which of the following is not a comparison operator in a SQL statement?
1. <>
2. !=
3. =
4. >
The correct answer for Question 4 is:
2. !=
In SQL, the "!=" operator is not a standard comparison operator. Instead, "<>", "=", and ">" are valid
comparison operators commonly used in SQL statements.
Question 5 (1 mark)
If introduced as follows, the subquery can return which of the values listed below? FROM
(subquery)
1. a single value
2. a column of one or more rows
3. a table
4. a subquery can’t be introduced in this way
The correct answer for Question 5 is:
3. a table
When introduced as FROM (subquery), the subquery can act as a derived table or subquery
expression, which essentially behaves like a temporary table within the query context. It can return
multiple rows and columns, effectively acting as a table for the outer query to work with.
Question 6 (2 marks)
Which one of the following is incorrect about PDO?
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller mulah11. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $3.70. You're not tied to anything after your purchase.