Invitation to Authors

Interested in writing a book for us?


Please fill this form and get a chance to get published plus $200 bonus online coupon.


PayPal Logo
MySQL Interview Questions You\'ll Most Likely Be Asked
MySQL Interview Questions You'll Most Likely Be Asked

ISBN: 9781476069159

Price:   $19.95
Sale: $16.56

Quantity :        
Book Description:

MySQL Interview Questions You'll Most Likely Be Asked is a perfect companion to stand ahead above the rest in today’s competitive job market. Rather than going through comprehensive, textbook-sized reference guides, this book includes only the information required immediately for job search to build an IT career. This book puts the interviewee in the driver's seat and helps them steer their way to impress the interviewer.

 

 

Table of Contents
1. Introduction
2. Creating and Managing Databases, Tables and Indexes
3. Manipulating Data
4. Retrieving Data
5. Managing Transactions
6. Managing Accounts
7. Performance Optimization
8. Managing Backup, Recovery and Replication
9. HR Questions
10. INDEX
 
 

Includes:

 

a) 200 MySQL Interview Questions, Answers and Proven Strategies for getting hired as an IT professional

b) Dozens of examples to respond to interview questions

c) 51 HR Questions with Answers and Proven strategies to give specific, impressive, answers that help nail the interviews

d) 2 Aptitude Tests download available on www.vibrantpublishers.com

 

 

Sample from the book
(Below Questions and Answers are randomly taken from different pages of the book)
 

8: What does the following code achieve?

mysql>INSERT INTO user

->(host, user, password, Select_priv, Insert_priv, Update_priv)

->VALUES(‘localhost’, ‘student1’, PASSWORD(‘user001’), ‘Y’, ‘Y’, ‘Y’);

Answer:

It creates a user student1 with password user001 and this user has select privilege, insert privilege and update privilege.

 

9: What is the purpose of the ‘FLUSH PRIVILEGES’ command?

Answer:

The FLUSH PRIVILEGES command tells the server to reload the grant tables. This should be used right after creating a user, otherwise it won’t be possible to connect to MySQL using the new user account until the server is rebooted.

 

31: What do you understand by embedded SQL? How do you write an embedded statement?

Answer:

Embedded SQL is one of the most common methods used to access data in a database from within a programming language. It refers to the SQL statements that are embedded directly within the programming language to allow the language to access and modify data within a SQL database.

To embed a SQL statement into a C or C++ application, each statement should be preceded with the keywords EXEC SQL and ended with a semi-colon. For example, the following embedded SQL statement inserts data into table named Items:

EXEC SQL INSERT INTO Items

(ItemID, ItemName, CatID)

VALUES (023, ‘Television Set’, ‘501’);

 

32: What would be the code for creating a database named clients?

a) CREATE DATABASE clients;

b) CREATE clients;

c) CREATE DB clients;

d) USE clients;

Answer:

a. CREATE DATABASE clients;

 

49: Is it possible to add a column in an existing table? Which statement would do that?

Answer:

Yes. It is possible to add a column in an existing table. The ADD COLUMN option of the ALTER TABLE statement allows adding a new column to an existing table.

 

50: What are the minimal elements required for creating a table?

Answer:

The CREATE TABLE statement can be simple as well as quite complicated. However, the only required elements are the CREATE TABLE clause and at least one table element enclosed in parenthesis.

For example:

CREATE TABLE numlist

(

id int

)

 

51: Write the code for creating a table named Inventory with two columns ProductId (a SMALLINT) and Quantity (an INT).

Answer:

CREATE TABLE Inventory

(

ProductIdSMALLINT(4),

Quantity INT UNSIGNED

);

 

52: Which data type should you opt for storing a picture in the database?

Answer:

BLOB (Binary Large Object), MEDIUMBLOB or LONGBLOB types, depending upon the picture size.

 

53: Write the code for creating a table named ProductCatalog with columns - ProductId, ProductName, Price, Picture and Quantity. Assume suitable data types for the columns.

Answer:

CREATE TABLE ProductCatalog

(

ProductIdSMALLINT(4),

ProductNameVARCHAR(20),

Price DECIMAL(7,2),

Picture BLOB,

Quantity INT UNSIGNED

);

 

54: Rewrite the code for creating the table ProductCatalog in such a way that, ProductId is the primary key.

Answer:

CREATE TABLE ProductCatalog

(

ProductIdSMALLINT(4) NOT NULL PRIMARY KEY,

ProductNameVARCHAR(20),

Price DECIMAL(7,2),

Picture BLOB,

Quantity INT UNSIGNED

);

 

55: What is the difference between ENUM and SET data types?

Answer:

Both these data types allow specifying a list of values that can be used in a column configured with that type. However, when only one of the values defined for ENUM data types can be inserted in the column, the SET data type allows specifying multiple values from the list.

 

56: Write a code for creating a table named CarSale with the columns OrderID, Model, Price, Color and Accessories. Use ENUM data type for Color column and SET data type for the Accessories column. Assume suitable data types for the other columns.

Answer:

CREATE TABLE CarSale

(

OrderIdSMALLINT(4) UNSIGNED NOT NULL PRIMARY KEY,

ModelVARCHAR(20),

Price DECIMAL(7,2),

Color ENUM (‘red’, ‘white’, ‘black’, ‘grey’, ‘blue’),

Accessories SET(‘Floor Mat’, ‘Perfume’, ‘Seat Cover’, ‘Music System’)

);

 

57: What are the date/time data types available in MySQL?

Answer:

The date and time types for representing temporal values are DATE, TIME, DATETIME, TIMESTAMP, and YEAR.

 

58: Say True or False:

Any TIMESTAMP column in a table can be the one that is automatically initialized or updated to the current date and time.

Answer:

True.

 

59: Write a code to create a table t with a column named ts with TIMESTAMP data type. It should have default value as the current time stamp and should always be updated to the current time stamp.

Answer:

CREATE TABLE t (ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP

ON UPDATE CURRENT_TIMESTAMP);

 

60: Say True or False:

The YEAR type is a two-byte or four-byte type used for representing years.

Answer:

False. The YEAR type is a one-byte type used for representing years. It can be declared as YEAR(2) or YEAR(4) to specify a display width of

 

64: What is the purpose of the TEMPORARY clause in the DROP TABLE statement?

Answer:

The optional TEMPORARY clause in the DROP TABLE statement ensures that only a temporary table would be deleted, no permanent table would be deleted inadvertently.

 

65: State four important features of indexes.

Answer:

Four important features of indexes are:

a) An index is used to speed up searches.

b) It reduces the time to query

c) It provides an organized list of pointers to actual data.

d) It can be created separately.

 

98: Write a code for selecting name of all the authors from the table authors in the library database.

Answer:

SELECT name

FROM library.authors

 

Following questions will be based on two tables – books and authors. The structures of the tables are as follows:

 

authors(a_id, a_name, a_city, a_country)

books(b_id, b_title, a_id, p_id, price, publication_year)

 

99: Write a statement that returns details of the author ‘J K Rowling’.

Answer:

SELECT * FROM authors

WHERE a_name = ‘J K Rowling’;

 

188: How can you use the source command to reload your database?

Answer:

The source command can be used to restore a database by specifying the source command along with the path and filename of the backup file.

For example:

CREATE DATABASE library;

USE library;

SOURCE c:backuplibrary_backup.sql

 

Share

New Title Idea Submission

Got a fantastic New Title Idea but didn't find it in our catalogue?


Please fill this form and see your idea getting published. Also a chance to win $100 coupon.



Visitor Rating : 10/ 10 Based on 590 ratings.