Chapter 7: MySQL

Rebecca Walton
Quiz by Rebecca Walton, updated more than 1 year ago
Rebecca Walton
Created by Rebecca Walton about 1 year ago
20
0

Description

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

Resource summary

Question 1

Question
In MySQL, data in a database are often stored in one or more tables.
Answer
  • true
  • false

Question 2

Question
In MySQL, what is a table column called?
Answer
  • a record
  • an object
  • a field
  • a relation

Question 3

Question
Which of the following statements is correct?
Answer
  • 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

Question 4

Question
MySQL is a database
Answer
  • true
  • false

Question 5

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

Question 6

Question
In MySQL, which of the following statement is used to create a database?
Answer
  • CREATE DATABASE schoolDB
  • CREATE DATABASE
  • CREATE schoolDB
  • DATABASE schoolDB

Question 7

Question
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?
Answer
  • mysqli_query($conn, $query);
  • mysqli_query($query, $conn);
  • mysqli_execute_query($conn, $query);
  • mysqli_execute_query($query, $conn);

Question 8

Question
In MySQL, before executing an SQL CREATE TABLE statement, what must be done?
Answer
  • 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

Question 9

Question
What is the primary key of the a table?
Answer
  • 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

Question 10

Question
In MySQL, before you can execute any SQL statement, you must ____________ to the database.
Answer
  • connect
  • find a table
  • use primary key of a table
  • know how many tables are related

Question 11

Question
In SQL, what does the following statement do? INSERT INTO abc (field1Name, field2Name) VALUES (field1Value, field2Value)
Answer
  • 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

Question 12

Question
In SQL, what does the following statement do? SELECT * FROM student;
Answer
  • 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

Question 13

Question
In SQL, what does the following statement do? UPDATE student SET studentGpa = 4.0 WHERE studentId = 4;
Answer
  • 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

Question 14

Question
In SQL, what does the following statement do? DELETE FROM student;
Answer
  • 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

Question 15

Question
In MySQL, after all the SQL statements are executed, you must ______ to the database.
Answer
  • thank
  • close the connection
  • save the data
  • exit

Question 16

Question
In PHP, why should you use mysqli_real_escape_string () function?
Answer
  • 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

Question 17

Question
In MySQL, if you add AUTO_INCREMENT attribute to a field of a table, ________________
Answer
  • 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

Question 18

Question
Which of the following is NOT a data type in MySQL?
Answer
  • BOOLEAN
  • DECIMAL
  • VARCHAR
  • DATE

Question 19

Question
What is special about the following URL? Contentupdate.php?id=2
Answer
  • 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
Show full summary Hide full summary

Similar

Computing Hardware - CPU and Memory
ollietablet123
SFDC App Builder 2
Parker Webb-Mitchell
Intake7 BIM L1
Stanley Chia
Data Types
Jacob Sedore
CCNA Answers – CCNA Exam
Abdul Demir
Software Processes
Nurul Aiman Abdu
Design Patterns
Erica Solum
Abstraction
Shannon Anderson-Rush
Spyware
Sam2
Database Replication
Michael Mahfouz
Data Analytics
anelvr