Font size
WorksheetsMIDTERM EXAM PROGRAMMING
Total questions: 63
Worksheet time: 32mins
Which of the following is not a component of CRUD?
Create
Read
Update
Drop
Which of the following is used to delete data from a MySQL database?
UPDATE
DELETE
INSERT INTO
SELECT
Which of the following is used to insert new data into a MySQL database?
UPDATE
DELETE
INSERT INTO
SELECT
Which SQL statement is used to extract data from a database?
SELECT
INSERT
UPDATE
DELETE
It is a collection of bytes in Database
Field
Bit
Record
File
What is the total number of rows in MS Excel 2016 or 2019
1,048,576
16,384
255
31
With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" is "Peter"?
SELECT [all] FROM Persons WHERE FirstName LIKE 'Peter'
SELECT * FROM Persons WHERE FirstName='Peter'
SELECT [all] FROM Persons WHERE FirstName='Peter'
SELECT * FROM Persons WHERE FirstName<>'Peter'
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"?
SELECT * FROM Persons WHERE FirstName='a'
SELECT * FROM Persons WHERE FirstName LIKE 'a%'
SELECT * FROM Persons WHERE FirstName='%a%'
SELECT * FROM Persons WHERE FirstName LIKE '%a'
Which SQL keyword is used to sort the result-set?
ORDER
SORT BY
ORDER BY
SORT
With SQL, how can you return all the records from a table named "Persons" sorted descending by "FirstName"?
SELECT * FROM Persons ORDER BY FirstName DESC
SELECT * FROM Persons SORT BY 'FirstName' DESC
SELECT * FROM Persons SORT 'FirstName' DESC
SELECT * FROM Persons ORDER FirstName DESC
With SQL, how can you insert "Olsen" as the "LastName" in the "Persons" table?
INSERT INTO Persons (LastName) VALUES ('Olsen')
INSERT ('Olsen') INTO Persons (LastName)
INSERT INTO Persons ('Olsen') INTO LastName
The NOT NULL constraint enforces a column to not accept NULL values.
True
False
Which operator is used to search for a specified pattern in a column?
FROM
LIKE
GET
What does PHP stands for?
PHP: Hypertext Preprocessor
Private Home Page
Personal Hypertext Processor
Which among the following is the correct delimiters that surround PHP server scripts?
<?php>...</?>
<script>...</script>
<?php...?>
<&>...</&>
How do you get information from a form that is submitted using the "get" method?
Request.QueryString;
$_GET[];
Request.Form;
$_POST[];
When using the POST method, variables are displayed in the URL:
True
False
How is PHP written into a webpage?
Just like other html tags: <php> </php>
Only in a separate file which is linked to the html page
Using curled brackets {php} {/php}
A PHP script starts with <?php and ends with ?>
PHP is case sensitive in what way?
It's never case sensitive, don't worry about it.
Only when referring to variables
When referring to classes, functions or variables
All the time
A relational database ___________ is a data structure used to store and organize information.
View
Table
Report
Stored Procedure
What is the maximum size of the VARCHAR Column type?
255 char
255 Byte
512 Byte
512 Byte
MySQL is
A Programming language
A technique for writing reliable programs
A Relational Database Management System
All of the above
What SQL clause is used to restrict the rows returned by a query?
AND
WHERE
LIKE
FROM
Which will input data into a table?
INSERT INTO table(name, height, weight) VALUES('strand', '6ft 2in', '165')
INPUT INTO table(name, height, weight) VALUES('strand', '6ft 2in', '165')
INSERT INTO table CATEGORIES(name, height, weight) VALUES('strand', '6ft 2in', '165')
INSERT INTO table CATEGORIES(name, height, weight) ('strand', '6ft 2in', '165')
If I want to show all data in a MySQL table, I would use
SHOW * FROM table;
SELECT * FROM table;
SHOW * IN table;
SELECT * IN table;
A collection of interrelated files is
Database
File
Record
Byte
What does SQL stand for?
(a)
SQL is not case sensitive. SELECT is the same as select.
True
False
Which SQL Select special character used to refer to all columns?
*
/
**
()
With SQL, how do you select all the columns from a table named "Persons"?
SELECT * FROM Persons
SELECT Persons
SELECT [all] FROM Persons
SELECT *.Persons
SQL can be used to:
Create database structures only
Query database data only.
Modify database data only.
All of the above can be done by SQL.
Which clause is used to “Filters out unwanted data”?
FROM
SELECT
ORDER BY
WHERE
Which is the default order of sort in ORDER BY clause?
Ascending
Descending
Write a query to display first_name and last_name of all employees who have their first_name starting with 'A'.
Select first_name from employess where first_name, last_name LIKE '%A';
Select first_name from employess where first_name, last_name LIKE "'A'%";
Select first_name, last_name from employess where first_name LIKE 'A%';
Select first_name from employess where first_name, last_name LIKE '%A%';
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.
client-server
peer-to-peer
business
website
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.
web server
webinar
web browser
static web
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.
True
False
A _______ is special software that knows how to respond to requests for web pages.
web browser
web server
web client
web database
What represents a tuple in relational database?
Table
Row
Column
Object
Which of the following clauses is used to display information that match a given pattern?
LIKE
WHERE
ORDER BY
IN
What column names are displayed when this SQL command is executed? SHOW COLUMNS FROM tbl_name LIKE ‘%name’;
suffixed with ‘name’
prefixed with ‘name
suffixed with ‘%name’
prefixed with ‘%name’
In the following SQL code, InnoDB is __________ CREATE TABLE student ( name CHAR(30), student_id INT, PRIMARY KEY(student_id)) ENGINE = InnoDB;
database name
table name
reference engine
storage engine
Identify the table name in the following SQL statement. INSERT INTO student VALUES(‘Kyle’,’M’,NULL);
student
Values
Kyle
M
What is 'xyz' in the following statement select abc from xyz
row name
column name
table name
database name
Which clause is used to sort query elements?
GROUP
GROUP BY
ORDER
ORDER BY
What does ‘abc’ & ‘xyz’ specify in the following SQL statement? CREATE TABLE abc (xyz);
table name and column specs
column specs and table name
table name and number of columns
table name and number of rows
The command to remove rows from a table ‘CUSTOMER’ is:
REMOVE FROM CUSTOMER
DROP FROM CUSTOMER
DELETE FROM CUSTOMER WHERE
UPDATE FROM CUSTOMER …
The command to eliminate a table from a database is
REMOVE TABLE CUSTOMER;
DROP TABLE CUSTOMER;
DELETE TABLE CUSTOMER;
UPDATE TABLE CUSTOMER;
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"?
SELECT * FROM Persons WHERE FirstName='a'
SELECT * FROM Persons WHERE FirstName LIKE 'a%'
SELECT * FROM Persons WHERE FirstName='%a%'
SELECT * FROM Persons WHERE FirstName LIKE '%a'
With SQL, how do you select all the records from a table named "Persons" where the "FirstName" is "Peter" and the "LastName" is "Jackson"?
SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson'
SELECT * FROM Persons WHERE FirstName<>'Peter' AND LastName<>'Jackson'
SELECT FirstName='Peter', LastName='Jackson' FROM Persons
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"?
SELECT * FROM Persons WHERE LastName BETWEEN 'Hansen' AND 'Pettersen'
SELECT * FROM Persons WHERE LastName>'Hansen' AND LastName<'Pettersen'
SELECT LastName>'Hansen' AND LastName<'Pettersen' FROM Persons
With SQL, how can you return all the records from a table named "Persons" sorted descending by "FirstName"?
SELECT * FROM Persons SORT 'FirstName' DESC
SELECT * FROM Persons ORDER BY FirstName DESC
SELECT * FROM Persons SORT BY 'FirstName' DESC
SELECT * FROM Persons ORDER FirstName DESC
With SQL, how can you insert a new record into the "Persons" table?
INSERT ('Jimmy', 'Jackson') INTO Persons
INSERT VALUES ('Jimmy', 'Jackson') INTO Persons
INSERT INTO Persons VALUES ('Jimmy', 'Jackson')
How can you change "Hansen" into "Nilsen" in the "LastName" column in the Persons table?
MODIFY Persons SET LastName='Hansen' INTO LastName='Nilsen
MODIFY Persons SET LastName='Nilsen' WHERE LastName='Hansen'
UPDATE Persons SET LastName='Hansen' INTO LastName='Nilsen'
UPDATE Persons SET LastName='Nilsen' WHERE LastName='Hansen'
SELECT * FROM employee WHERE salary>10000 AND dept_id=101;
Which of the following fields are displayed as output?
Salary, dept_id
Employee
Salary
All the field of employee relation
In the given query which of the keyword has to be inserted?
INSERT INTO employee _____ (1002,Joey,2000);
Table
Values
Relation
Field
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.
Insert into employee values (1005,Rach,0);
Insert into employee values (1002,Joey,335);
Insert into employee values (1007,Ross, );
None of the mentioned
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”?
SELECT * FROM Persons WHERE FirstName=’a’
SELECT * FROM Persons WHERE FirstName LIKE ‘a%’
SELECT * FROM Persons WHERE FirstName LIKE ‘%a’
SELECT * FROM Persons WHERE FirstName=’%a%’
Which of the following is the correct order of keywords for SQL SELECT statements?
SELECT, FROM, WHERE
FROM, WHERE, SELECT
WHERE, FROM,SELECT
SELECT,WHERE,FROM
Examples of DBMS software are:-
MySQL
ORACLE
JAVA
FOXPRO
Which operator is used to select values within a range?
RANGE
WITHIN
BETWEEN
Which operator is used to search for a specified pattern in a column?
FROM
GET
LIKE
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
TRUE
FALSE
