Quiz
MySQL 101-01
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (15)
1Which of the following is a correctly written SQL Insert statement?
- AINSERT table VALUES (value1, value2, value3);
- BINSERT INTO table VALUES (value1, value2, value3);
- CINSERT INTO database TABLE(table(schema));
- DINSERT TABLE INTO database table(schema);
2When writing DELETE statements, it is often a good idea to begin with a SELECT statement, to verify that your are targeting the correct data for deletion.
- ATrue
- BFalse
3C.R.U.D is an acronym for the four basic operations of a database system. What are they?
- ACreate, Retrieve, Upgrade, Delete
- BCollate, Retrieve, Update, Delete
- CCreate, Recall, Update, Delete
- DCreate, Retrieve, Update, Delete
- ECreate, Retrieve, Update, Destroy
4In SQL terminology, what does DML stand for?
- AData Modification Language
- BData Manipulation Language
- CDigital Manipulation Language
- DDigital Modification Language
5In SQL terminology, What does DDL Stand for?
- ADigital Definition Language
- BData Detention Language
- CDigital Determination Language
- DData Definition Language
6SQL code that can be categorized as DML is used primarily for:
- AAdding, querying, manipulating and deleting data from tables and data sets.
- BDefining tables, indexes, and data relationships.
- CStoring data in tables, indexes, and primary keys.
- DInserting data relationships into indexes, tables, and primary keys.
7SQL code that can be categorized as DDL is used primarily for:
- AInserting data relationships into indexes, tables, and primary keys.
- BAdding, querying, manipulating and deleting data from tables and data sets.
- CDefining tables, indexes, and data relationships.
- DStoring data in tables, indexes, and primary keys.
8Which answer most completely and correctly describes what this SQL statement will do?
SELECT Name, LifeExpectancy AS 'Life Expectancy' FROM Country;- AReturn all rows from the Name and LifeExpectancy columns in the country table.
- BReturn all rows from the Name and LifeExpectancy columns in the country table, renaming the column header displaying the LifeExpectancy column's results to 'Life Expectancy'.
- CReturn all rows from the Name and LifeExpectancy columns in the country table where the phrase 'Life Expectancy' is found in the name column.
- DThis statement is incorrectly written. It will produce an error.
9Which answer most completely and correctly describes what the following SQL statement will do?
SELECT "Hi, my name is Jimmy.";- AThis statement is not valid, it will return an error.
- BThis will return a single row with the value "Hi, my name is Jimmy.".
- CThis will return a single row with the header <String> and the value "Hi, my name is Jimmy.".
- DThis will return the value "Hi, my name is Jimmy." in a column with the header name "Hi, my name is Jimmy."
10Which answer most completely and correctly describes what the following SQL statement will do?
SELECT FROM inventory WHERE item_desc like '%shoe%';- AThis will return all rows from the customer table where the item_desc column contains the sub-string 'shoe'.
- BThis statement is written incorrectly, it will return an error.
- CThis will return all rows from the customer table where the item_desc column begins with the sub-string 'shoe'.
- DThis will return all rows from the customer table where the item_desc column ends with the sub-string 'shoe'.
11This SQL statement will return all rows from the 'Countries' table:
SELECT * FROM Countries;
Which of the following will return the number of rows in the Countries table?
1. SELECT * (COUNT) FROM Countries;
2. SELECT COUNT FROM Countries;
3. SELECT COUNT(*) FROM Countries;
4. All of the above.- A1
- B2
- C3
- D4
12True or False: Given a database with table named test that has columns named 'id' and 'value' This is a valid SQL statement:
SELECT * FROM test WHERE value = NULL;- ATrue
- BFalse
13In MySql, this create table statement is not valid. Why?
CREATE TABLE test (
a INTEGER AUTO_INCREMENT,
b TEXT DEFAULT 'nothing',
c TEXT NOT NULL
);- AThe semicolon is unnecessary.
- BThe AUTO_INCREMENT keyword is misused.
- CThere is a comma missing after the last column declaration.
- DThe DEFAULT keyword is misused.
14In MySQL, which of these statements will successfully create a table named simpleTest with an id field set as an auto-increment integer with a primary key constraint?
- ACREATE TABLE simpleTest(
id INTEGER AUTO_INCREMENT PRIMARY KEY,
fName TEXT NOT NULL,
lName TEXT NOT NULL
); - BCREATE TABLE simpleTest(
id INTEGER AUTO_INCREMENT,
fName TEXT NOT NULL,
lName TEXT NOT NULL,
PRIMARY KEY(id)
); - CNeither A nor B is correct.
- DBoth A and B are correct.
- ACREATE TABLE simpleTest(
15The term "Query" is often used to refer to what kind of SQL statements?
- ACREATE
- BSELECT
- CINSERT
- DALTER
Information
- Description
- A general Quiz on some basic SQL knowledge, focusing on general SQL and some MySQL specific questions.
- Author
- Chris Lee
- Language
- English
- Views
- 59
- Tags
- Rating
- No ratings yet Rate this quiz