100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

ICT3612 Assignment 3 2024 | Due 15 July 2024

Rating
-
Sold
-
Pages
11
Grade
A
Uploaded on
24-06-2024
Written in
2023/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) 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? 15 ICT3612/102/0/2024 1. LIMIT 10, <= 5 2. LIMIT 11, <= 5 3. LIMIT 10, 5 4. LIMIT 11, 5 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 Question 4 (1 mark) Which of the following is not a comparison operator in a SQL statement? 1. <> 2. != 3. = 4. > 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 Question 6 (2 marks) Which one of the following is incorrect about PDO? 1. PDO facilitates database access in PHP 2. Creation of PDO object can result in errors that can be handled using try catch statement 3. One can specify the name of the database table when creating a PDO object 4. A PDO object can be created using three arguments Question 7 (2 mark) Study the database table named weather given below, where record_number is the primary key: 16 What is the result of the following code? $query = 'INSERT INTO weather (record_number, place, date, rainfall) VALUES (:rec_no, :place, :date, :rainfall)'; $rec_no = 5; $place = 'Roodepoort'; $date = ''; $rainfall = 25; $statement = $db->prepare($query); $statement ->bindValue(':rec_no', $rec_no); $statement ->bindValue(':place', $place); $statement ->bindValue(':date', $date); $statement ->bindValue(':rainfall', $rainfall); $statement->execute(); $statement->closeCursor(); Assume that a PDO object named $db is correctly connected to the relevant database. 1. record_number place date rainfall 1 Gordons Bay 12 2 Johannesburg 25 3 Hammanskral 7 4 Mamelodi 1 5 Roodepoort 25 2. record_number place date rainfall 1 Gordons Bay 12 2 Johannesburg 25 3 Hammanskral 7 4 Mamelodi 1 5 Port Elizabeth 3 5 Roodepoort 25 3. record_number place date rainfall 1 Gordons Bay 12 2 Johannesburg 25 3 Hammanskral 7 4 Mamelodi 1 5 Port Elizabeth 3 17 ICT3612/102/0/2024 4. record_number place date rainfall 1 Gordons Bay 12 2 Johannesburg 25 3 Hammanskral 7 4 Mamelodi 1 5 Port Elizabeth 3 6 Roodepoort 25 Question 8 (2 marks) Study the database table named weather given below, where record_number is the primary key: Refer to the code below: $rf = 10; $query = "UPDATE weather SET rainfall = ? WHERE record_number = 4"; $statement = $db->prepare($query); $statement ->bindValue(1, $rf); $rowCount = $statement->execute(); $statement->closeCursor(); Assume that a PDO object named $db is correctly connected to the relevant database. Which of the following options is correct about the code given below? 1. rainfall in the first row (record_number: 1) is updated to 10 2. $rowCount stores 2 after execution 3. rainfall in the fourth row (record_number: 4) is updated to 10 4. The SQL statement is incorrect Question 9 (2 marks) The prepare() method of a PDO object ____________. 1. must be run before values are assigned to the parameters in a prepared statement 2. assigns the values to the parameters in a prepared statement 3. retrieves the rows of a prepared statement 4. must be run after values are assigned to the parameters in a prepared statement Question 10 (2 marks) Which of the following is the correct way to code a PHP statement that gets the first row that’s 18 stored in a PDOStatement object named $products and puts it in an array named $product? 1. $product = $db->query($products); 2. $product = $db->fetch($products); 3. $product = $products->query(); 4. $product = $products->fetch(); Question 11 (1 mark) When you develop a content management system, you can use PHP’s ____________ functions to parse the user entries so they can be formatted for display in the browser. 1. array handling 2. string handling 3. formatting 4. number handling Question 12 (1 mark) The include ________________ for a PHP application tells PHP where to look for the files specified by the include(), include_once(), require(), and require_once() functions. 1. file 2. view 3. path 4. root Question 13 (1 mark) To set the include path for a website, you can use the __________. 1. include_path() function 2. include_path() method 3. set_include_path() function 4. set_include_path() method Question 14 (1 mark) For a website that implements the MVC pattern, there is usually one controller file for each _________________. 1. application 2. model 3. view 4. user Question 15 (1 mark) General-purpose files are often called ________________ files because they can be used by many applications. 1. convenience 19 ICT3612/102/0/2024 2. service 3. resource 4. utility Question 16 (1 mark) Secure Sockets Layer (SSL) is a/an ________________ that’s used by the Internet that lets clients and servers communicate over a secure connection. 1. hash 2. cipher 3. protocol 4. algorithm Question 17 (1 mark) Which of the following is a URL that connects to over a secure connection? 1. 2. 3. 4. Question 18 (1 mark) When you use form-based authentication ________. 1. the username and password are automatically encrypted and decrypted 2. the programmer writes the code for the authentication process 3. the browser automatically displays a dialog box for the username and password 4. the username and password must be sent for every protected page Question 19 (1 mark) Before a server uses SSL to transmit data to a client, it ____________. 1. provides a digital secure certificate to the client 2. decrypts all data 3. confirms the identity of the client 4. authorizes the client Question 20 (1 mark) To perform a redirect, you can begin by using the ________________ array to check if the current request is using a secure connection. 1. $_POST 2. $_GET 3. $_SERVER 4. $_SECURE 20 Question 21 (2 marks) Which of the following displays the content of the file ('')? 1. $file = fopen('', 'rb'); fgets($file); 2. $modules = readfile(''); 3. $modules = file_get_contents(''); 4. $modules = file(''); Question 22 (1 mark) What is correct about the statement $modules = file(''); given the contents of '' as below? 1. $modules contain true or false to indicate whether the file exists 2. $modules contains a string with three module codes in CSV format 3. size of $modules is three 4. $modules contain a string with the value ICT1511 Question 23 (2 marks) Which of the following is incorrect when working with files in PHP? 1. To delete a file, you use the function delete() 2. $_FILES array can be used to access details of uploaded files 3. fputcsv() can be used to generate a file with data in CSV format 4. If a script has to write to a file, one can open the file in wb mode Question 24 (1 mark) Which one of the these is a PHP function that returns an array containing a list of files and directories in a specified directory? 1. listdir() 2. scandir() 3. getcwd() 4. is_dir() Question 25 (1 mark) Which PHP super global variable can be used to get information about each uploaded file? 1. $_FILES 2. $_UPLOAD 3. $_ATTRIBUTES 4. $_INFO 21 ICT3612/102/0/2024 Question 26 (1 mark) A ________________ is a working model of a website that lets the intended users review and evaluate it. 1. plan 2. schematic 3. prototype 4. rendering Question 27 (1 mark) The controller file for each application of a website is commonly named _________. 1. 2. 3. 4. Question 28 (1 mark) ________________ refinement refers to the process of making step-by-step improvements to the working model for a website with review and evaluation after each step. 1. intermittent 2. gradual 3. continual 4. stepwise Question 29 (1 mark) The view directory for a website is normally used to store the view files that are used by more than one ________________. 1. controller file 2. model file 3. prototype 4. application Question 30 (1 mark) The controller and view files for each application of a website should be stored in _____. 1. the root directory 2. a separate directory 3. the current working directory 4 a utility directory

Show more Read less









Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
June 24, 2024
Number of pages
11
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers

Content preview

, PLEASE USE THIS DOCUMENT AS A GUIDE TO ANSWER YOUR ASSIGNMENT


Please note that the author of this document will not responsibility for any plagiarizing you
commit.

1. Which of the following is an aggregate expression that will find the oldest date in the
invoiceDate column?
A) MIN(invoiceDate)
B) MAX(invoiceDate)
C) HIGH(invoiceDate)
D) LOW(invoiceDate)

To find the oldest date in the invoiceDate column, you would use the MIN(invoiceDate) aggregate
function. This function returns the smallest value in a column, which for date columns would be the
earliest date.

2. Which of the following LIMIT clauses will return a maximum of five rows starting with the
eleventh row in the result set?
A) LIMIT 10, <= 5
B) LIMIT 11, <= 5
C) LIMIT 10, 5
D) LIMIT 11, 5

This clause tells SQL to skip the first 10 rows and then return up to 5 rows starting from the 11th row.

3. 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?
A) paymentDate IS NULL AND invoiceTotal > 500
B) paymentDate IS NOT NULL OR invoiceTotal >= 500
C) NOT (paymentDate IS NULL AND invoiceTotal <= 500)
D) paymentDate IS NOT NULL AND invoiceTotal >= 500

This condition ensures that both criteria are met: paymentDate must not be null and invoiceTotal must
be at least 500.

4. Which of the following is not a comparison operator in a SQL statement?
A) < >
B) !=
C) =
D) >

“=” is an assignment operator used to assign a value to a variable, rather than comparing values.

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Aimark94 University of South Africa (Unisa)
View profile
Follow You need to be logged in order to follow users or courses
Sold
6575
Member since
6 year
Number of followers
3168
Documents
1326
Last sold
3 weeks ago
Simple &amp; Affordable Study Materials

Study Packs &amp; Assignments

4,2

520 reviews

5
277
4
124
3
74
2
14
1
31

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions