Questão 1
Questão
In MySQL, data in a database are often stored in one or more tables.
Questão 2
Questão
In MySQL, what is a table column called?
Responda
-
a record
-
an object
-
a field
-
a relation
Questão 3
Questão
Which of the following statements is correct?
Responda
-
A database is used to create a DBMS
-
A DBMS is used to create a database
-
A DBMS is the same as a database
-
A DBMS and a database are not related
Questão 4
Questão
MySQL is a database
Questão 5
Questão
If the following connection is used in your PHP statement, what is the password for the account?
$conn = mysqli_connect('a', 'b', 'c');
Questão 6
Questão
In MySQL, which of the following statement is used to create a database?
Responda
-
CREATE DATABASE schoolDB
-
CREATE DATABASE
-
CREATE schoolDB
-
DATABASE schoolDB
Questão 7
Questão
In MySQL, suppose an SQL statement is stored in a variable called $query and the connection is stored in $conn, how do you execute the statement?
Responda
-
mysqli_query($conn, $query);
-
mysqli_query($query, $conn);
-
mysqli_execute_query($conn, $query);
-
mysqli_execute_query($query, $conn);
Questão 8
Questão
In MySQL, before executing an SQL CREATE TABLE statement, what must be done?
Responda
-
You must know how many records are in the table
-
You must know the data for the table
-
You must select a foreign key
-
You must select a database to add the table
Questão 9
Questão
What is the primary key of the a table?
Responda
-
One or more fields that contain familiar values
-
One or more fields that can uniquely identify each record
-
One or more fields that have meanings to the end users
-
One or more fields that are key to the success of the table
Questão 10
Questão
In MySQL, before you can execute any SQL statement, you must ____________ to the database.
Questão 11
Questão
In SQL, what does the following statement do?
INSERT INTO abc (field1Name, field2Name) VALUES (field1Value, field2Value)
Responda
-
Insert two rows into a database called abc
-
Insert two rows into a table called abc
-
Insert one row into a database called abc
-
Insert one row into a table called abc
Questão 12
Questão
In SQL, what does the following statement do?
SELECT * FROM student;
Responda
-
Select asterisk from a table called student
-
Select asterisk from a database called student
-
Select all rows and columns from a table called student
-
Select all rows and columns from a database called student
Questão 13
Questão
In SQL, what does the following statement do?
UPDATE student SET studentGpa = 4.0 WHERE studentId = 4;
Responda
-
Set all students' GPA to 4.0
-
Set the student's GPA to 4.0 whose student ID is 4 in the student table
-
Set all student's GPA to 4.0 where possible
-
Set the student's GPA to 4.0 whose student ID is 4 in the student database
Questão 14
Questão
In SQL, what does the following statement do?
DELETE FROM student;
Responda
-
Delete one row in a database called abc
-
Delete one row in a table called abc
-
Delete all rows in a database called abc
-
Delete all rows in a table called abc
Questão 15
Questão
In MySQL, after all the SQL statements are executed, you must ______ to the database.
Responda
-
thank
-
close the connection
-
save the data
-
exit
Questão 16
Questão
In PHP, why should you use mysqli_real_escape_string () function?
Responda
-
You will get the real string from the HTML form
-
The codes will run faster
-
The codes will be more secure
-
none of the above
Questão 17
Questão
In MySQL, if you add AUTO_INCREMENT attribute to a field of a table, ________________
Responda
-
the table will automatically increase in size
-
the field will automatically increase in size
-
MySQL will automatically add a unique integer to the field when a new record is inserted
-
MySQL will automatically add a new record to the table
Questão 18
Questão
Which of the following is NOT a data type in MySQL?
Responda
-
BOOLEAN
-
DECIMAL
-
VARCHAR
-
DATE
Questão 19
Questão
What is special about the following URL?
Contentupdate.php?id=2
Responda
-
The browser requests a page called contentupdate.php which is second page
-
The browser requests a page called contentupdate.php and the page id is 2
-
The browser requests a page with the password of 2
-
The browser requests a page called contentupdate.php and passes an id value of 2 that the contentupdate.php page usually needs