Chris Lee
Quiz von , erstellt am more than 1 year ago

A general Quiz on some basic SQL knowledge, focusing on general SQL and some MySQL specific questions.

43
1
0
Chris Lee
Erstellt von Chris Lee vor fast 10 Jahre
Schließen

MySQL 101-01

Frage 1 von 15

1

Which of the following is a correctly written SQL Insert statement?

Wähle eine der folgenden:

  • INSERT table VALUES (value1, value2, value3);

  • INSERT INTO table VALUES (value1, value2, value3);

  • INSERT INTO database TABLE(table(schema));

  • INSERT TABLE INTO database table(schema);

Erklärung

Frage 2 von 15

1

When 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.

Wähle eins der folgenden:

  • WAHR
  • FALSCH

Erklärung

Frage 3 von 15

1

C.R.U.D is an acronym for the four basic operations of a database system. What are they?

Wähle eine der folgenden:

  • Create, Retrieve, Upgrade, Delete

  • Collate, Retrieve, Update, Delete

  • Create, Recall, Update, Delete

  • Create, Retrieve, Update, Delete

  • Create, Retrieve, Update, Destroy

Erklärung

Frage 4 von 15

1

In SQL terminology, what does DML stand for?

Wähle eine oder mehr der folgenden:

  • Data Modification Language

  • Data Manipulation Language

  • Digital Manipulation Language

  • Digital Modification Language

Erklärung

Frage 5 von 15

1

In SQL terminology, What does DDL Stand for?

Wähle eine oder mehr der folgenden:

  • Digital Definition Language

  • Data Detention Language

  • Digital Determination Language

  • Data Definition Language

Erklärung

Frage 6 von 15

1

SQL code that can be categorized as DML is used primarily for:

Wähle eine der folgenden:

  • Adding, querying, manipulating and deleting data from tables and data sets.

  • Defining tables, indexes, and data relationships.

  • Storing data in tables, indexes, and primary keys.

  • Inserting data relationships into indexes, tables, and primary keys.

Erklärung

Frage 7 von 15

1

SQL code that can be categorized as DDL is used primarily for:

Wähle eine der folgenden:

  • Inserting data relationships into indexes, tables, and primary keys.

  • Adding, querying, manipulating and deleting data from tables and data sets.

  • Defining tables, indexes, and data relationships.

  • Storing data in tables, indexes, and primary keys.

Erklärung

Frage 8 von 15

1

Which answer most completely and correctly describes what this SQL statement will do?

SELECT Name, LifeExpectancy AS 'Life Expectancy' FROM Country;

Wähle eine der folgenden:

  • Return all rows from the Name and LifeExpectancy columns in the country table.

  • Return 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'.

  • Return all rows from the Name and LifeExpectancy columns in the country table where the phrase 'Life Expectancy' is found in the name column.

  • This statement is incorrectly written. It will produce an error.

Erklärung

Frage 9 von 15

1

Which answer most completely and correctly describes what the following SQL statement will do?

SELECT "Hi, my name is Jimmy.";

Wähle eine der folgenden:

  • This statement is not valid, it will return an error.

  • This will return a single row with the value "Hi, my name is Jimmy.".

  • This will return a single row with the header <String> and the value "Hi, my name is Jimmy.".

  • This will return the value "Hi, my name is Jimmy." in a column with the header name "Hi, my name is Jimmy."

Erklärung

Frage 10 von 15

1

Which answer most completely and correctly describes what the following SQL statement will do?

SELECT FROM inventory WHERE item_desc like '%shoe%';

Wähle eine der folgenden:

  • This will return all rows from the customer table where the item_desc column contains the sub-string 'shoe'.

  • This statement is written incorrectly, it will return an error.

  • This will return all rows from the customer table where the item_desc column begins with the sub-string 'shoe'.

  • This will return all rows from the customer table where the item_desc column ends with the sub-string 'shoe'.

Erklärung

Frage 11 von 15

1

This 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.

Wähle eine der folgenden:

  • 1

  • 2

  • 3

  • 4

Erklärung

Frage 12 von 15

1

True 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;

Wähle eins der folgenden:

  • WAHR
  • FALSCH

Erklärung

Frage 13 von 15

1

In MySql, this create table statement is not valid. Why?

CREATE TABLE test (
a INTEGER AUTO_INCREMENT,
b TEXT DEFAULT 'nothing',
c TEXT NOT NULL
);

Wähle eine der folgenden:

  • The semicolon is unnecessary.

  • The AUTO_INCREMENT keyword is misused.

  • There is a comma missing after the last column declaration.

  • The DEFAULT keyword is misused.

Erklärung

Frage 14 von 15

1

In 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?

Wähle eine der folgenden:

  • CREATE TABLE simpleTest(
    id INTEGER AUTO_INCREMENT PRIMARY KEY,
    fName TEXT NOT NULL,
    lName TEXT NOT NULL
    );

  • CREATE TABLE simpleTest(
    id INTEGER AUTO_INCREMENT,
    fName TEXT NOT NULL,
    lName TEXT NOT NULL,
    PRIMARY KEY(id)
    );

  • Neither A nor B is correct.

  • Both A and B are correct.

Erklärung

Frage 15 von 15

1

The term "Query" is often used to refer to what kind of SQL statements?

Wähle eine der folgenden:

  • CREATE

  • SELECT

  • INSERT

  • ALTER

Erklärung