Rebecca Walton
Quiz by , created more than 1 year ago

Sanchez, L. (2017). Web Programming with HTML, CSS, Bootstrap, JavaScript, JQuery, PHP, and MySQL . CreateSpace Independent Publishing Platform.

79
0
0
Rebecca Walton
Created by Rebecca Walton over 4 years ago
Close

Chapter 7: MySQL

Question 1 of 19

1

In MySQL, data in a database are often stored in one or more tables.

Select one of the following:

  • true

  • false

Explanation

Question 2 of 19

1

In MySQL, what is a table column called?

Select one of the following:

  • a record

  • an object

  • a field

  • a relation

Explanation

Question 3 of 19

1

Which of the following statements is correct?

Select one of the following:

  • 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

Explanation

Question 4 of 19

1

MySQL is a database

Select one of the following:

  • true

  • false

Explanation

Question 5 of 19

1

If the following connection is used in your PHP statement, what is the password for the account?
$conn = mysqli_connect('a', 'b', 'c');

Select one of the following:

  • a

  • b

  • c

  • no password

Explanation

Question 6 of 19

1

In MySQL, which of the following statement is used to create a database?

Select one of the following:

  • CREATE DATABASE schoolDB

  • CREATE DATABASE

  • CREATE schoolDB

  • DATABASE schoolDB

Explanation

Question 7 of 19

1

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?

Select one of the following:

  • mysqli_query($conn, $query);

  • mysqli_query($query, $conn);

  • mysqli_execute_query($conn, $query);

  • mysqli_execute_query($query, $conn);

Explanation

Question 8 of 19

1

In MySQL, before executing an SQL CREATE TABLE statement, what must be done?

Select one of the following:

  • 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

Explanation

Question 9 of 19

1

What is the primary key of the a table?

Select one of the following:

  • 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

Explanation

Question 10 of 19

1

In MySQL, before you can execute any SQL statement, you must ____________ to the database.

Select one of the following:

  • connect

  • find a table

  • use primary key of a table

  • know how many tables are related

Explanation

Question 11 of 19

1

In SQL, what does the following statement do?
INSERT INTO abc (field1Name, field2Name) VALUES (field1Value, field2Value)

Select one of the following:

  • 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

Explanation

Question 12 of 19

1

In SQL, what does the following statement do?
SELECT * FROM student;

Select one of the following:

  • 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

Explanation

Question 13 of 19

1

In SQL, what does the following statement do?
UPDATE student SET studentGpa = 4.0 WHERE studentId = 4;

Select one of the following:

  • 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

Explanation

Question 14 of 19

1

In SQL, what does the following statement do?
DELETE FROM student;

Select one of the following:

  • 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

Explanation

Question 15 of 19

1

In MySQL, after all the SQL statements are executed, you must ______ to the database.

Select one of the following:

  • thank

  • close the connection

  • save the data

  • exit

Explanation

Question 16 of 19

1

In PHP, why should you use mysqli_real_escape_string () function?

Select one of the following:

  • 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

Explanation

Question 17 of 19

1

In MySQL, if you add AUTO_INCREMENT attribute to a field of a table, ________________

Select one of the following:

  • 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

Explanation

Question 18 of 19

1

Which of the following is NOT a data type in MySQL?

Select one of the following:

  • BOOLEAN

  • DECIMAL

  • VARCHAR

  • DATE

Explanation

Question 19 of 19

1

What is special about the following URL?
Contentupdate.php?id=2

Select one of the following:

  • 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

Explanation