Random Testing Flashcards

1
Q

How many TRIGGERS are allowed in MySql table?

A

BEFORE INSERT AFTER INSERT BEFORE UPDATE AFTER UPDATE BEFORE DELETE and AFTER DELETE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does a TIMESTAMP do on UPDATE CURRENT_TIMESTAMP data type?

A

TIMESTAMP column is updated with Zero when the table is created. UPDATE CURRENT_TIMESTAMP modifier updates the timestamp field to the current time whenever there is a change in other fields of the table.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is InnoDB?

A

lnnoDB is a transaction safe storage engine developed by Innobase Oy which is a Oracle Corporation now.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are federated tables?

A

Federated tables which allow access to the tables located on other databases on other servers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the column comparisons operators?

A

The = , <>, <=, =, >,<>, <=>, AND, OR, or LIKE operators are used in column comparisons in SELECT statements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you control the max size of a HEAP table?

A

Maximum size of Heal table can be controlled by MySQL config variable called max_heap_table_size.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the difference between mysql_fetch_array and mysql_fetch_object?

A

Following are the differences between mysql_fetch_array and mysql_fetch_object: mysql_fetch_array() -Returns a result row as an associated array or a regular array from database. mysql_fetch_object – Returns a result row as object from database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are all the Common SQL Function?

A

CONCAT(A, B) – Concatenates two string values to create a single string output. Often used to combine two or more fields into one single field. FORMAT(X, D) – Formats the number X to D significant digits. CURRDATE(), CURRTIME() – Returns the current date or time. NOW() – Returns the current date and time as one value. MONTH(), DAY(), YEAR(), WEEK(), WEEKDAY() – Extracts the given data from a date value. HOUR(), MINUTE(), SECOND() – Extracts the given data from a time value. DATEDIFF(A, B) – Determines the difference between two dates and it is commonly used to calculate age SUBTIMES(A, B) – Determines the difference between two times. FROMDAYS(INT) – Converts an integer number of days into a date value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What storage engines are used in MySQL?

A

Storage engines are called table types and data is stored in files using various techniques. Technique involves: Storage mechanism Locking levels Indexing Capabilities and functions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is ISAM?

A

ISAM is abbreviated as Indexed Sequential Access Method.It was developed by IBM to store and retrieve data on secondary storage systems like tapes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the difference between BLOB AND TEXT?

A

The only difference between BLOB and TEXT types is that sorting and comparison is performed in case-sensitive for BLOB values and case-insensitive for TEXT values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How many columns can be used for creating Index?

A

Maximum of 16 indexed columns can be created for any standard table.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the different tables present in MySQL?

A

MyISAM Heap Merge INNO DB ISAM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the default port for MySQL Server?

A

The default port for MySQL Server is 3306. Another standard default is port 1433 in TCP/IP for SQL Server.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How to display top 50 rows?

A

SELECT * FROM LIMIT 0,50;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does myisamchk do?

A

It compresses the MyISAM tables, which reduces their disk or memory usage.

17
Q

What do you mean by % and _ in the LIKE statement?

A

% corresponds to 0 or more characters, _ is exactly one character in the LIKE statement.

18
Q

What is the difference between primary key and candidate key?

A

Every row of a table is identified uniquely by primary key. There is only one primary key for a table. Primary Key is also a candidate key. By common convention, candidate key can be designated as primary and which can be used for any foreign key references.

19
Q

What are the drivers in MySQL?

A

PHP Driver JDBC Driver ODBC Driver C WRAPPER PYTHON Driver PERL Driver RUBY Driver CAP11PHP Driver Ado.net5.mxj

20
Q

Can you tell what are the different set operations available in MySQL?

A

UNION – This operation returns all the distinct rows selected by a query

UNION ALL – This operation returns all the rows selected by a query and also includes all duplicate rows.

MINUS – This operation returns all the distinct rows selected by the first query but does not select the rows selected by the second query.

INTERSECT – This operation returns all the distinct rows selected by both queries.

21
Q

Can you tell the order of SQL SELECT statement?

A

The order of SQL SELECT statement is as follows:

SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY.

22
Q

Can you tell how can you display the Maximum salary in SQL?

A

To display the maximum salary in SQL, you can use the inbuilt function called MAX().

23
Q

Can you tell how many values can Set the function of MySQL to consider?

A

MySQL’s Set function can take a maximum of 64 values, but can also consider 0 values.

24
Q
A