100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4,6 TrustPilot
logo-home
Examen

ICT3612 Assignment 3 2024 | Due 15 July 2024

Puntuación
-
Vendido
-
Páginas
11
Grado
A
Subido en
24-06-2024
Escrito en
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

Mostrar más Leer menos
Institución
Grado

Vista previa del contenido

, 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.

Libro relacionado

Escuela, estudio y materia

Institución
Grado

Información del documento

Subido en
24 de junio de 2024
Número de páginas
11
Escrito en
2023/2024
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

$3.05
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
Aimark94 University of South Africa (Unisa)
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
6685
Miembro desde
6 año
Número de seguidores
3168
Documentos
1502
Última venta
10 horas hace
Simple &amp; Affordable Study Materials

Study Packs &amp; Assignments

4.2

545 reseñas

5
290
4
132
3
75
2
16
1
32

Documentos populares

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes