wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

MIDTERM EXAM PROGRAMMING

Total questions: 63

Worksheet time: 32mins

Name
Class
Date
1.

Which of the following is not a component of CRUD?

a)

Create

b)

Read

c)

Update

d)

Drop

2.

Which of the following is used to delete data from a MySQL database?

a)

UPDATE

b)

DELETE

c)

INSERT INTO

d)

SELECT

3.

Which of the following is used to insert new data into a MySQL database?

a)


UPDATE

b)


DELETE

c)


INSERT INTO

d)


SELECT

4.

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

a)


SELECT

b)

INSERT

c)

UPDATE

d)

DELETE

5.

It is a collection of bytes in Database

a)


Field

b)

Bit

c)

Record

d)

File

6.

What is the total number of rows in MS Excel 2016 or 2019

a)


1,048,576

b)


16,384

c)

255

d)

31

7.

With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" is "Peter"?

a)

SELECT [all] FROM Persons WHERE FirstName LIKE 'Peter'

b)

SELECT * FROM Persons WHERE FirstName='Peter'

c)

SELECT [all] FROM Persons WHERE FirstName='Peter'

d)

SELECT * FROM Persons WHERE FirstName<>'Peter'

8.

With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" starts with an "a"?

a)


SELECT * FROM Persons WHERE FirstName='a'

b)


SELECT * FROM Persons WHERE FirstName LIKE 'a%'

c)

SELECT * FROM Persons WHERE FirstName='%a%'

d)

SELECT * FROM Persons WHERE FirstName LIKE '%a'

9.

Which SQL keyword is used to sort the result-set?

a)


ORDER

b)

SORT BY

c)

ORDER BY

d)

SORT

10.

With SQL, how can you return all the records from a table named "Persons" sorted descending by "FirstName"?

a)

SELECT * FROM Persons ORDER BY FirstName DESC

b)


SELECT * FROM Persons SORT BY 'FirstName' DESC

c)


SELECT * FROM Persons SORT 'FirstName' DESC

d)


SELECT * FROM Persons ORDER FirstName DESC

11.

With SQL, how can you insert "Olsen" as the "LastName" in the "Persons" table?


a)


INSERT INTO Persons (LastName) VALUES ('Olsen')

b)


INSERT ('Olsen') INTO Persons (LastName)

c)


INSERT INTO Persons ('Olsen') INTO LastName

12.

The NOT NULL constraint enforces a column to not accept NULL values.

a)

True

b)

False

13.

Which operator is used to search for a specified pattern in a column?

a)


FROM

b)

LIKE

c)

GET

14.

What does PHP stands for?

a)


PHP: Hypertext Preprocessor

b)


Private Home Page

c)


Personal Hypertext Processor

15.

Which among the following is the correct delimiters that surround PHP server scripts?

a)


<?php>...</?>

b)


<script>...</script>

c)


<?php...?>

d)

<&>...</&>

16.

How do you get information from a form that is submitted using the "get" method?

a)


Request.QueryString;

b)

$_GET[];

c)

Request.Form;

d)

$_POST[];

17.

When using the POST method, variables are displayed in the URL:

a)

True

b)

False

18.

How is PHP written into a webpage?

a)

Just like other html tags: <php> </php>

b)

Only in a separate file which is linked to the html page

c)

Using curled brackets {php} {/php}

d)

A PHP script starts with <?php and ends with ?>

19.

PHP is case sensitive in what way?

a)


It's never case sensitive, don't worry about it.

b)

Only when referring to variables

c)

When referring to classes, functions or variables

d)

All the time

20.

A relational database  ___________ is a data structure used to store and organize information.

a)


View

b)


Table

c)

Report

d)

Stored Procedure

21.

What is the maximum size of the VARCHAR Column type?

a)

255 char

b)

255 Byte

c)

512 Byte

d)

512 Byte

22.

MySQL is

a)


A Programming language

b)

A technique for writing reliable programs

c)

 A Relational Database Management System

d)

All of the above

23.

What SQL clause is used to restrict the rows returned by a query?

a)


AND

b)


WHERE

c)

LIKE

d)

FROM

24.

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')

25.

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;

26.

A collection of interrelated files is

a)


Database

b)

File

c)

Record

d)

Byte

27.

What does SQL stand for?

(a)  

28.

SQL is not case sensitive. SELECT is the same as select.

a)

True

b)

False

29.

Which SQL Select special character used to refer to all columns?

a)


*

b)

/

c)

**

d)

()

30.

With SQL, how do you select all the columns from a table named "Persons"?

a)


SELECT * FROM Persons

b)


SELECT Persons

c)

SELECT [all] FROM Persons

d)


SELECT *.Persons

31.

SQL can be used to:

a)


Create database structures only

b)


Query database data only.

c)


Modify database data only.

d)


All of the above can be done by SQL.

32.

Which clause is used to “Filters out unwanted data”?

a)


FROM

b)


SELECT

c)


ORDER BY

d)


WHERE

33.

Which is the default order of sort in ORDER BY clause?

a)


Ascending

b)


Descending

34.

Write a query to display first_name and last_name of all employees who have their first_name starting with 'A'.

a)


Select first_name from employess where first_name, last_name LIKE '%A';

b)

Select first_name from employess where first_name, last_name LIKE "'A'%";

c)


Select first_name, last_name from employess where first_name LIKE 'A%';

d)


Select first_name from employess where first_name, last_name LIKE '%A%';

35.

It is said that the web operates on a ______ model, where the client is the web browser and the server is the computer providing, or serving, the information.

a)

client-server

b)


peer-to-peer

c)


business

d)

website

36.

A ______ is special software that knows how to open and interpret web pages. Web browsers also know how to contact web servers to get information.

a)


web server

b)


webinar

c)


web browser

d)


static web

37.

To hold data, you use a variable, which keeps track of the data that you tell it to store for the lifetime of your program.

a)

True

b)

False

38.

A _______ is special software that knows how to respond to requests for web pages.

a)


web browser

b)


web server

c)


web client

d)


web database

39.

What represents a tuple in relational database?

a)

Table

b)

Row

c)

Column

d)

Object

40.

Which of the following clauses is used to display information that match a given pattern?

a)


LIKE

b)

WHERE

c)

ORDER BY

d)

IN

41.

What column names are displayed when this SQL command is executed? SHOW COLUMNS FROM tbl_name LIKE ‘%name’;

a)


suffixed with ‘name’

b)


prefixed with ‘name

c)

suffixed with ‘%name’

d)

prefixed with ‘%name’

42.

In the following SQL code, InnoDB is __________ CREATE TABLE student ( name CHAR(30), student_id INT, PRIMARY KEY(student_id)) ENGINE = InnoDB;

a)


database name

b)


table name

c)


reference engine

d)


storage engine

43.

Identify the table name in the following SQL statement. INSERT INTO student VALUES(‘Kyle’,’M’,NULL);

a)

student

b)

Values

c)

Kyle

d)

M

44.

What is 'xyz' in the following statement select abc from xyz

a)


row name

b)

column name

c)

table name

d)

database name

45.

Which clause is used to sort query elements?

a)

GROUP

b)

GROUP BY

c)

ORDER

d)

ORDER BY

46.

What does ‘abc’ & ‘xyz’ specify in the following SQL statement? CREATE TABLE abc (xyz);

a)


table name and column specs

b)


column specs and table name

c)


table name and number of columns

d)


table name and number of rows

47.

The command to remove rows from a table ‘CUSTOMER’ is:

a)


REMOVE FROM CUSTOMER

b)


DROP FROM CUSTOMER

c)

DELETE FROM CUSTOMER WHERE

d)


UPDATE FROM CUSTOMER …

48.

The command to eliminate a table from a database is

a)

REMOVE TABLE CUSTOMER;

b)


DROP TABLE CUSTOMER;

c)

DELETE TABLE CUSTOMER;

d)

UPDATE TABLE CUSTOMER;

49.

With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" starts with an "a"?

a)

SELECT * FROM Persons WHERE FirstName='a'

b)


SELECT * FROM Persons WHERE FirstName LIKE 'a%'

c)

SELECT * FROM Persons WHERE FirstName='%a%'

d)


SELECT * FROM Persons WHERE FirstName LIKE '%a'

50.

With SQL, how do you select all the records from a table named "Persons" where the "FirstName" is "Peter" and the "LastName" is "Jackson"?

a)


SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson'

b)


SELECT * FROM Persons WHERE FirstName<>'Peter' AND LastName<>'Jackson'

c)


SELECT FirstName='Peter', LastName='Jackson' FROM Persons

51.

With SQL, how do you select all the records from a table named "Persons" where the "LastName" is alphabetically between (and including) "Hansen" and "Pettersen"?

a)


SELECT * FROM Persons WHERE LastName BETWEEN 'Hansen' AND 'Pettersen'

b)


SELECT * FROM Persons WHERE LastName>'Hansen' AND LastName<'Pettersen'

c)

SELECT LastName>'Hansen' AND LastName<'Pettersen' FROM Persons

52.

With SQL, how can you return all the records from a table named "Persons" sorted descending by "FirstName"?

a)


SELECT * FROM Persons SORT 'FirstName' DESC

b)


SELECT * FROM Persons ORDER BY FirstName DESC

c)


SELECT * FROM Persons SORT BY 'FirstName' DESC

d)


SELECT * FROM Persons ORDER FirstName DESC

53.

With SQL, how can you insert a new record into the "Persons" table?

a)

INSERT ('Jimmy', 'Jackson') INTO Persons

b)


INSERT VALUES ('Jimmy', 'Jackson') INTO Persons

c)


INSERT INTO Persons VALUES ('Jimmy', 'Jackson')

54.

How can you change "Hansen" into "Nilsen" in the "LastName" column in the Persons table?

a)


MODIFY Persons SET LastName='Hansen' INTO LastName='Nilsen

b)


MODIFY Persons SET LastName='Nilsen' WHERE LastName='Hansen'

c)


UPDATE Persons SET LastName='Hansen' INTO LastName='Nilsen'

d)


UPDATE Persons SET LastName='Nilsen' WHERE LastName='Hansen'

55.

SELECT * FROM employee WHERE salary>10000 AND dept_id=101;

Which of the following fields are displayed as output?


a)


Salary, dept_id

b)


Employee

c)


Salary

d)


All the field of employee relation

56.

In the given query which of the keyword has to be inserted?

INSERT INTO employee _____ (1002,Joey,2000);

a)


Table

b)


Values

c)


Relation

d)


Field

57.

CREATE TABLE employee (id INTEGER,name VARCHAR(20),salary NOT NULL);

INSERT INTO employee VALUES (1005,Rach,0);

INSERT INTO employee VALUES (1007,Ross, );

INSERT INTO employee VALUES (1002,Joey,335);

Some of these insert statements will produce an error. Identify the statement.

a)


Insert into employee values (1005,Rach,0);

b)


Insert into employee values (1002,Joey,335);

c)

Insert into employee values (1007,Ross, );

d)


None of the mentioned

58.

With SQL, how do you select all the records from a table named “Persons” where the value of the column “FirstName” ends with an “a”?

a)

SELECT * FROM Persons WHERE FirstName=’a’

b)

SELECT * FROM Persons WHERE FirstName LIKE ‘a%’

c)


SELECT * FROM Persons WHERE FirstName LIKE ‘%a’

d)


SELECT * FROM Persons WHERE FirstName=’%a%’

59.

Which of the following is the correct order of keywords for SQL SELECT statements?

a)


SELECT, FROM, WHERE

b)


FROM, WHERE, SELECT

c)


WHERE, FROM,SELECT

d)


SELECT,WHERE,FROM

60.

Examples of DBMS software are:-

a)


MySQL

b)


ORACLE

c)


JAVA

d)


FOXPRO

61.

Which operator is used to select values within a range?

a)


RANGE

b)


WITHIN

c)


BETWEEN

62.

Which operator is used to search for a specified pattern in a column?

a)

FROM

b)

GET

c)

LIKE

63.

The OR operator displays a record if ANY conditions listed are true. The AND operator displays a record if ALL of the conditions listed are true

a)

TRUE

b)

FALSE