Register|Login

Have a question? Click here to ask the community.

Quiz 4 – Inserting Data Into A Database

| In: MySQL Quizzes | 10,093 views

*You are currently not logged in and your quiz score will not be recorded. Please login or register if you would like to submit your quiz score.

Directions: Answer all questions. Any questions skipped will be scored as wrong answers. Good Luck! :)

1. The “mysql_error()” function returns the error description for a MYSQL operation?

True
False

2. The INSERT INTO statement is not used to add new records to a database table?

True
False

3. Assuming the table and fields below exists, what is wrong with the following mysql query example:

mysql_query(“INSERT INTO contacts (firstName, lastName, phoneNumber)
VALUES (‘Robert’, ‘Smith’)”);

There are more values than fields
There are more fields than values
Nothing, everything is fine

4. Assuming the table and fields below exists, what is wrong with the following mysql query example:

mysql_query(“INSERT INTO contacts (firstName, lastName, phoneNumber)
VALUES (‘Robert’, ‘Smith’, ‘123-983-2929’)”);

There are more values than fields
There are more fields than values
Nothing, everything is fine

5. Assuming the table and fields below exists, what is wrong with the following mysql query example:

mysql_query(“INSERT INTO contacts (firstName, lastName)
VALUES (‘Robert’, ‘Smith’, ‘123-983-2929’)”);

There are more values than fields
There are more fields than values
Nothing, everything is fine

Comment Form

You must be logged in to post a comment.

Users Online

Users Online: 4 Users

Most Users Ever Online: 91

Quiz Scores

Advertisments