Rebecca Walton
Quiz von , erstellt am 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
Erstellt von Rebecca Walton vor mehr als 4 Jahre
Schließen

Chapter 7: MySQL

Frage 1 von 19

1

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

Wähle eine der folgenden:

  • true

  • false

Erklärung

Frage 2 von 19

1

In MySQL, what is a table column called?

Wähle eine der folgenden:

  • a record

  • an object

  • a field

  • a relation

Erklärung

Frage 3 von 19

1

Which of the following statements is correct?

Wähle eine der folgenden:

  • 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

Erklärung

Frage 4 von 19

1

MySQL is a database

Wähle eine der folgenden:

  • true

  • false

Erklärung

Frage 5 von 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');

Wähle eine der folgenden:

  • a

  • b

  • c

  • no password

Erklärung

Frage 6 von 19

1

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

Wähle eine der folgenden:

  • CREATE DATABASE schoolDB

  • CREATE DATABASE

  • CREATE schoolDB

  • DATABASE schoolDB

Erklärung

Frage 7 von 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?

Wähle eine der folgenden:

  • mysqli_query($conn, $query);

  • mysqli_query($query, $conn);

  • mysqli_execute_query($conn, $query);

  • mysqli_execute_query($query, $conn);

Erklärung

Frage 8 von 19

1

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

Wähle eine der folgenden:

  • 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

Erklärung

Frage 9 von 19

1

What is the primary key of the a table?

Wähle eine der folgenden:

  • 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

Erklärung

Frage 10 von 19

1

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

Wähle eine der folgenden:

  • connect

  • find a table

  • use primary key of a table

  • know how many tables are related

Erklärung

Frage 11 von 19

1

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

Wähle eine der folgenden:

  • 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

Erklärung

Frage 12 von 19

1

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

Wähle eine der folgenden:

  • 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

Erklärung

Frage 13 von 19

1

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

Wähle eine der folgenden:

  • 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

Erklärung

Frage 14 von 19

1

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

Wähle eine der folgenden:

  • 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

Erklärung

Frage 15 von 19

1

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

Wähle eine der folgenden:

  • thank

  • close the connection

  • save the data

  • exit

Erklärung

Frage 16 von 19

1

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

Wähle eine der folgenden:

  • 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

Erklärung

Frage 17 von 19

1

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

Wähle eine der folgenden:

  • 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

Erklärung

Frage 18 von 19

1

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

Wähle eine der folgenden:

  • BOOLEAN

  • DECIMAL

  • VARCHAR

  • DATE

Erklärung

Frage 19 von 19

1

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

Wähle eine der folgenden:

  • 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

Erklärung