logo
  • Home
  • Test & Rank
  • About
  • Training
  • Programming
  • CS
  • IT
  • IS
  • ECE
  • EEE
  • EE
  • Civil
  • Mechanical
  • Chemical
  • Metallurgy
  • Instrumentation
  • Aeronautical
  • Aerospace
  • Biotechnology
  • Mining
  • Marine
  • Agriculture
  • MCA
  • BCA
  • Internship
  • Jobs
  • Contact

MySQL Database Multiple Choice Questions | MCQs | Quiz

MySQL Database Interview Questions and Answers
Practice MySQL Database questions and answers for interviews, campus placements, online tests, aptitude tests, quizzes and competitive exams.

Get Started

•   Database Terminology
•   MySQL Setup - 1
•   MySQL Setup - 2
•   MySQL Interaction
•   Server SQL Mode
•   MySQL Identifier Syntax
•   Case Sensitivity
•   Character Set Support
•   Dropping Databases
•   Indexing & Altering Tables
•   Database Metadata
•   Table Retrievals - Joins
•   Table Retrievals-Subqueries
•   Table Retrievals - Union
•   Using Views
•   Table Deletes & Updates
•   Performing Transactions
•   Foreign Keys
•   Full Text Searches
•   MySQL Command Line Tool
•   Table Creation
•   Modifying Tables - 1
•   Modifying Tables - 2
•   Modifying Tables - 3
•   Data Value Categories - 1
•   Data Value Categories - 2
•   MySQL Datatypes - 1
•   MySQL Datatypes - 2
•   MySQL Datatypes - 3
•   MySQL Datatypes - 4
•   MySQL Datatypes - 5
•   Handling Invalid Data Values
•   Sequences Working
•   Expression Evaluation
•   Choosing Data Types
•   Statement Delimiters
•   Stored Functions
•   Triggers
•   Events
•   Views Security
•   Using Indexing
•   MySQL Query Optimizer
•   Efficient Queries
•   Loading Data Efficiently
•   Scheduling & Locking Issue
•   Administrative Optimization
•   If Good Statements Go Bad
•   Query Mechanics
•   Query Clauses
•   MySQL Programs
•   MySQL APIs
•   API Choosing
•   Compiling Client Programs
•   Server Connections
•   Handling Errors
•   Processing SQL Statement
•   Writing Clients-SSL Support
•   Embedded Server Library
•   Statements Execution
•   Server Side Statements
•   Perl Script Characteristics
•   Perl DBI Overview - 1
•   Perl DBI Overview - 2
•   Perl DBI - Work
•   Perl DBI-Web Applications
•   PHP Overview
•   PHP - Work
•   MySQL Components
•   MySQL Administration
•   Access Control & Security
•   Backups & Replication
•   Data Directory Location
•   Data Directory Structure
•   Relocating Data Directory
•   New MySQL Installation
•   MySQL Server Startup
•   Server Connections
•   MySQL User Accounts
•   Maintaining Logs
•   Server Tuning
•   Storage Configuration
•   Load Data Local Capability
•   Internationalization Issues
•   Running Multiple Servers
•   Updating MySQL
•   Internal Security-Filesystem
•   External Security - Network
•   Secure Connection Settings
•   Maintenance Principles
•   Database Maintenance
•   Preventative Maintenance
•   Making Database Backups
•   Copying Databases
•   Repairing Database Tables
•   Data Recovery Backups
•   Replication Servers Settings
•   Numeric Data Types
•   String Data Types
•   Date & Time Data Types
•   Spatial Data Types
•   Operators
•   Functions
•   System Variables
•   Session System Variables
•   Status Variables
•   User Defined Variables
•   SQL Statement Syntax
•   Compound Statement
•   Comment Syntax
•   Select Clauses - 1
•   Select Clauses - 2
•   From Clauses - 1
•   From Clauses - 2
•   Where Clauses
•   Group by & Having Clause
•   Order by Clauses - 1
•   Order by Clauses - 2
•   Conditional Evaluation
•   Condition Types - 1
•   Condition Types - 2
•   Condition Types - 3
•   Condition Types - 4
•   Null: The Four Letter Word
•   Database Copies
•   Secure Connections

Best Reference Books

MySQL Database Books

MySQL Tests

Certification Test
Internship Test
Job Test
All Tests
Top Rankers
Practice Test 1
Practice Test 2
Practice Test 3
Practice Test 4
Practice Test 5
Practice Test 6
Practice Test 7
Practice Test 8
Practice Test 9
Practice Test 10
Mock Test 1
Mock Test 2
Mock Test 3
Mock Test 4
Mock Test 5
Mock Test 6
Mock Test 7
Mock Test 8
Mock Test 9
Mock Test 10
« Prev Page
Next Page »

MySQL Questions and Answers – Handling Errors and Processing Command Options

Posted on December 25, 2017 by bookgal

This set of Advanced MySQL Questions and Answers focuses on “Handling Errors and Processing Command Options”.

1. How many of the following use NULL to indicate failure?

advertisement
mysql_init(), mysql_real_connect()

a) 0
b) 1
c) 2
d) 3
View Answer

Answer: c
Explanation: Both of the client library routines named ‘mysql_init()’ and ‘mysql_real_connect()’ return a pointer to the connection handler in order to indicate success and NULL to indicate failure.

2. How many of the following does not return a value?

	mysql_close(), mysql_init, mysql_real_connect

a) 0
b) 1
c) 2
d) 3
View Answer

Answer: b
Explanation: It is not necessary that every Application Programming Interface call would return a value. For example, the client routine named ‘mysql_close()’ returns void, that is, it does not return a value.
advertisement

3. Which of these returns a string containing an error message?
a) mysql_error()
b) mysql_errno()
c) mysql_sqlstate()
d) mysql_close()
View Answer

Answer: a
Explanation: The API call named ‘mysql_error()’ returns a string containing an error message. ‘mysql_close()’ does not return any value at all. ‘mysql_errno()’ returns a MySQL-specific numeric code.

4. Which of the following returns a MySQL-specific numeric code?
a) mysql_error()
b) mysql_errno()
c) mysql_sqlstate()
d) mysql_close()
View Answer

Answer: b
Explanation: The API call named ‘mysql_errorno()’ returns a MySQL-specific numeric error code. ‘mysql_error()’ returns a string containing an error message. ‘mysql_close()’ does not return any value at all.

5. Which of the following returns an SQLSTATE code?
a) mysql_error()
b) mysql_errno()
c) mysql_sqlstate()
d) mysql_close()
View Answer

Answer: c
Explanation: The MySQL API call named ‘mysql_sqlstate()’ returns an SQLSTATE code. This SQLSTATE value is more ‘vendor neutral’ because it is based on the ‘ANSI SQL’ and ‘ODBC’ standards.

6. The argument to the function mysql_error() is _______________
a) integer
b) float
c) structure
d) pointer
View Answer

Answer: d
Explanation: The argument to the API functions ‘mysql_error()’, ‘mysql_errno()’ and ‘mysql_sqlstate()’ is a pointer to the connection handler. These should be called after an error occurs.

7. What does mysql_real_connect() return if it fails?
a) integer
b) float
c) structure
d) NULL
View Answer

Answer: d
Explanation: The function ‘mysql_real_connect()’ must complete successfully before any other API functions that require a valid MYSQL connection handler structure can be executed. It return NULL on failure.

8. The function load_defaults() reads the option files.
a) True
b) False
View Answer

Answer: a
Explanation: The function named ‘load_defaults()’ reads the option files. It takes four arguments. It does not pick up values from the environment settings. All connection paremeters can be brought to argument vector.
advertisement

9. The –protocol value ‘TCP’ runs on which operating systems?
a) unix only
b) windows only
c) all
d) none
View Answer

Answer: c
Explanation: The connection protocol used by the option ‘–protocol = TCP’ indicates TCP/IP connection to the local or the remote server. Each –protocol value has the set of permissible OS.

10. All API calls return a value.
a) True
b) False
View Answer

Answer: b
Explanation: In MySQL, not all the API calls return a value. The client routine named ‘mysql_close()’ is one that does not. The API calls that return a value are ‘mysql_sqlstate()’, ‘mysql_error()’ etc.

Sanfoundry Global Education & Learning Series – MySQL Database.

To practice advanced questions and answers on all areas of MySQL, here is complete set of 1000+ Multiple Choice Questions and Answers.

« Prev Page - MySQL Questions and Answers – Connecting to the Server
» Next Page - MySQL Questions and Answers – Processing SQL Statements

« MySQL Questions and Answers – Connecting to the Server
MySQL Questions and Answers – Processing SQL Statements »
advertisement

Deep Dive @ Sanfoundry:

  1. C Programming Examples on Bitwise Operations
  2. Digital Signal Processing Questions and Answers
  3. Digital Image Processing Questions and Answers
  4. Linux Command Tutorials with Examples and Explanations
  5. Java Programming Examples on Event Handling
  6. Java Programming Examples on File Handling
  7. C Programming Examples on File Handling
  8. Java Programming Examples on String Handling
  9. Java Programming Examples on Exception Handling
  10. MySQL Database Questions and Answers
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer and SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage & Cluster Administration, Advanced C Programming, SAN Storage Technologies, SCSI Internals and Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him below:
LinkedIn | Facebook | Twitter | Google+

Best Careers

Developer Tracks
SAN Developer
Linux Kernel Developer
Linux Driver Developer
Linux Network Developer

Live Training Photos
Mentoring
Software Productivity
GDB Assignment
Sanfoundry is No. 1 choice for Deep Hands-ON Trainings in SAN, Linux & C, Kernel Programming. Our Founder has trained employees of almost all Top Companies in India such as VMware, Citrix, Oracle, Motorola, Ericsson, Aricent, HP, Intuit, Microsoft, Cisco, SAP Labs, Siemens, Symantec, Redhat, Chelsio, Cavium, ST-Micro, Samsung, LG-Soft, Wipro, TCS, HCL, IBM, Accenture, HSBC, Mphasis, Tata-Elxsi, Tata VSNL, Mindtree, Cognizant and Startups.

Best Trainings

SAN I - Technology
SAN II - Admin
Linux Fundamentals
Advanced C Training
Linux-C Debugging
System Programming
Network Programming
Linux Threads
Kernel Programming
Kernel Debugging
Linux Device Drivers

Best Reference Books

Computer Science Books
Algorithm & Programming Books
Electronics Engineering Books
Electrical Engineering Books
Chemical Engineering Books
Civil Engineering Books
Mechanical Engineering Books
Industrial Engineering Books
Instrumentation Engg Books
Metallurgical Engineering Books
All Stream Best Books

Questions and Answers

1000 C Questions & Answers
1000 C++ Questions & Answers
1000 C# Questions & Answers
1000 Java Questions & Answers
1000 Linux Questions & Answers
1000 Python Questions
1000 PHP Questions & Answers
1000 Hadoop Questions
Cloud Computing Questions
Computer Science Questions
All Stream Questions & Answers

India Internships

Computer Science Internships
Instrumentation Internships
Electronics Internships
Electrical Internships
Mechanical Internships
Industrial Internships
Systems Internships
Chemical Internships
Civil Internships
IT Internships
All Stream Internships

About Sanfoundry

About Us
Copyright
Terms
Privacy Policy
Jobs
Bangalore Training
Online Training
Developers Track
Mentoring Sessions
Contact Us
Sitemap
© 2011 Sanfoundry. All Rights Reserved.