wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CS 316 - Web Systems and Technologies 2( Midterm Exam)

Total questions: 21

Worksheet time: 30mins

Name
Class
Date
1.

When a client requests a web page, what software is used as a tool?

a)

Web Browser

b)

Web Server

c)

Website

d)

Web Content

2.

What is a scripting language designed specifically for use on the web. It has features to aid you in programming the tasks needed to develop dynamic web applications?

a)

Javascript

b)

PHP

c)

HTML

d)

CSS

3.

Which of the these statements is not true?

a)

The web server continues in HTML mode until it encounters a PHP opening tag (<?php).

b)

The web server starts scanning the file in HTML mode. It assumes the statements are HTML and sends them to the browser without any processing.

c)

The web server continues in PHP mode until it encounters a PHP closing tag (?>).

d)

None of the above.

4.

(a)   are containers used to hold information.

5.

Which of these statements were the rule of declaring variable in PHP?

a)

All variable names have a dollar sign ($) in front of them. This tells PHP that it is a variable name.

b)

Variable names must begin with a letter or an underscore. They cannot begin with a number.

c)

Variable names can be any length.

d)

Variable names can include letters, numbers, and underscores only.

e)

All of the above

6.

(a)   are a series of instructions in a file named with an extension that tells the web server

7.

What are expressions that PHP tests or evaluates to see whether they are true or false. Conditions are used in complex statements to determine whether a block of simple statements should be execute ?

a)

Loopings

b)

Conditions

c)

Arithmetic

d)

Functions

8.

What statement tests conditions, executing a block of statements when a condition is true?

(a)  

9.

What statement are used frequently in scripts to set up a block of statements that repeat?

a)

Conditional

b)

Function

c)

Loop

d)

Arithmetic

10.

Which of the following is not a loop statement?

a)

for loop

b)

while loop

c)

do..while loop

d)

beef loop

11.

How many records are in this database?

a)

8

b)

5

c)

9

d)

12

12.

What is the primary key in this database?

a)

Emp_Id

b)

Last Name

c)

Gender

d)

Title

13.

Which SQL statement is used to extract data from a database?

a)

OPEN

b)

GET

c)

EXTRACT

d)

SELECT

14.

Which SQL statement is used to delete data from a database?

a)

COLLAPSE

b)

DELETE

c)

REMOVE

d)

DROP

15.

Which SQL statement is used to update data in a database?

a)

SAVE

b)

SAVE AS

c)

UPDATE

d)

MODIFY

16.

Which of the following scripts will run successfully?

a)

SELECT customer name FROM customers;

b)

SELECT FROM `customers` 'customer name';

c)

SELECT `customer name` FROM customers ORDER BY zone WHERE cat_id = 12;

d)

SELECT `customer name` FROM customers WHERE cat_id = 12 ORDER BY cat_id;

17.

SELECT * FROM sales WHERE amount > 200.

a)

the query will display all the sales records with amounts starting from 200 and above

b)

the query will display all the sales records with amounts less than 200

c)

the query will display all the sales records with amounts greater than 200

d)

the query will output sales records with the amount equal to 200.

18.

Which will input data into a table?

a)

INSERT INTO table(name, height, weight) VALUES('strand', '6ft 2in', '165')

b)

INPUT INTO table(name, height, weight) VALUES('strand', '6ft 2in', '165')

c)

INSERT INTO table CATEGORIES(name, height, weight) VALUES('strand', '6ft 2in', '165')

d)

INSERT INTO table CATEGORIES(name, height, weight) ('strand', '6ft 2in', '165')

19.

If I want to show all data in a MySQL table, I would use

a)

SHOW * FROM table;

b)

SELECT * FROM table;

c)

SHOW * IN table;

d)

SELECT * IN table;

20.

Write the command to connect MYSQL database to PHP.

4 lines
21.

write down the php code to Reverse a given integer number

Given:

54869

Expected output:

96845

4 lines