Mysql Setup
- What does comparing a known value with NULL result into?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
In MySQL, NULL is not comparable to other known values. It will result in a NULL when compared to any value. The following statement would result in four NULLs: ‘SELECT NULL = 0, NULL < 0, NULL <> 0, NULL > 0’.
- Which clause is used to sort query elements?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
An ‘ORDER BY’ clause specifies the sort order. The data is sorted in ascending order by default. To sort in descending order, the keyword DESC is appended to the ‘ORDER BY’ clause. ‘GROUP BY’ is used to group the query results according to a criteria.
- Which operator is used to perform integer divisions in MySQL?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
The operator ‘DIV’ is used to perform integer divisions in MySQL. ‘//’ is used in languages like Python to do the same. The operator ‘/’ performs floating point divisions and ‘\’ is facilitates escape sequences.
- The number of attributes in the following table is ______________.
CREATE TABLE Student(
name CHAR(30),
id INT(11)
);
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
The name of the table created is ’Student’. It has two attributes, namely, ’name’ and ’id’. The attributes are the columns in a table. name is of type string and id is of type integer.
- Which of the following options tells mysql to ask for entering the password?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
The command ‘mysql -p’ (alternative form: –password) prompts for the password. ‘-h’ (alternative form: –host) specifies the host where the MySQL server is running. ‘-u’ is for specifying the username.