Blog

6/recent/ticker-posts

MySQL Questions and Answers




General MySQL Quiz


Q 1 - To remove duplicate rows from the result set of a SELECT use the following keyword:

A ) NO DUPLICATE

B ) UNIQUE

C ) DISTINCT

D ) None of the above

Answer : C

Explanation

The SQL DISTINCT keyword is used after the SELECT statement and is used to eliminate all the duplicate records and fetch the unique records.

Answer : A

Explanation

‘AS’ clause is used in SQL for rename operation. (e.g., SELECT ENO AS EMPLOYEE_NO FROM EMP)

Q 3 - A supplier ships certain parts, which type of relationship is demostrated here?

A ) ONE-TO-ONE

B ) ONE-TO-MANY

C ) MANY-TO-MANY

D ) MANY-TO-ONE

Answer : B

Explanation

the relationship between the supplier and the parts is a one-to-many relationship, as a single supplier can supply many parts. In database terms, this would mean that the "supplier" table would have a primary key (such as "supplier_id"), and the "parts" table would have a foreign key (such as "supplier_id") that links to the primary key in the "supplier" table. This would allow for easy retrieval of all the parts supplied by a particular supplier.

Q 4 - Internally information is held in tables. which of these is not a valid format:

A ) Hash

B ) Isam99

C ) MyIsam

D ) BDB

E ) InnoDb

Answer : A

Explanation

BDB (BerkeleyDB), Isam99, MyIsam, and InnoDb are all valid storage engines for MySQL, while Hash is not. Hash is not a storage engine for MySQL, but rather a data structure used for indexing and searching data.

Q 5 - The method in which records are physically stored in a specified order according to a key field in each record is

A ) sequential

B ) direct

C ) all of the above.

D ) hash.

Answer : D

Explanation

A method in which records are physically stored in a specified order according to a key field in each record is hash. (In hash method, a hash function is performed on the key value to determine the unique physical address of the record to store or retrieve)

Q 6 - A one-to-many relationship can only contain multiple entries of both primary and foreign keys.

A ) True

B ) False

Answer : B

Explanation

In a one-to-many relationship, there can be multiple entries of the foreign key in the table that represents the "many" side of the relationship, but there should be only one entry of the primary key in the table that represents the "one" side of the relationship.

Q 7 - The process of intentionally introducing redundant data in a table in order to improve performance is called?

A ) NORMAL FORM.

B ) NORMALIZATION.

C ) SPECIALIZATION.

D ) DENORMALIZATION.

Answer : D

Explanation

No explanation for this question because the question is self-explanatory

Q 8 - which sql keyword is used to retrieve a maximum value.

A ) MOST

B ) MAX

C ) TOP

D ) UPPER

Answer : B

Explanation

The SQL MAX() function is used to find the largest value of a certain column or an expression in a table.

Q 10 - The count function in SQL returns the number of?

A ) Distinct Values

B ) Group

C ) Values

D ) Columns

Answer : C

Explanation

The COUNT function in SQL returns the number of values that match a certain condition or criteria. It is used to count the number of rows in a table or the number of times a specific value appears in a column. So, it returns the count of all the values that meet the specified condition.

mysql_questions_answers.html

Advertisements

Post a Comment

0 Comments

Ad Code

Responsive Advertisement

Hot Post