Showing posts with label MySQL. Show all posts
Showing posts with label MySQL. Show all posts

Tuesday, September 4, 2012

Mysql Interview Questions and Answers

1. Explain the difference MyISAM Static  and MyISAM Dynamic.
Ans- in MyISAM static all the fields have fixed width. The Dynamic MyISAM would include fields such as TEXT, BLOB, etc. to accommodate the data types with various lengths. MyISAM Static would be easier to restore in case of corruption, since even though you might lose some data, you know exactly where to look for the beginning of the next record.

2. What does myisamchk do?
It compressed the MyISAM tables , which reduces their disk usage.
3. Explain advantages of  InnoDB over  MyISAM?
Row level  locking, transactions, foreign key constraints and crash recovery.

4. Explain advantages of  MyISAM  over   InnoDB?
Much more conservative approach to disk space management each MyISAM table is stored in  a separate file, which could be compressed then with myisamchk if needed. With InnoDB the tables are stored in tablespace, and much further optimization is possible. All data except for TEXT and BLOB can occupy 8,000 bytes at most. No full text indexing is available for InnoDB.TRhe COUNT(*)s execute slower than in MyISAM due to tablespace complexity.

5. What are HEAP tables in MySQL?
HEAP tables are in memory. They are usually used for high-speed temporary storage. No TEXT or BLOB fields are allowed within HEAP tables. You can only use the comparison operators = and <=>. HEAP tables do not support AUTO_INCREAMENT. Indexes must be NOT NULL.

6. How do you control the max size of a HEAP table?
MySQL config variable max_heap_table_size

7. What are CSV tables?
Those are the special tables, data for which is saves into comm.-separate values file. They cannot be indexed.


Mysql Interview questions



1.  How do you start and stop Mysql on Windows?
    Ans- Net start Mysql, net stop Mysql
2.   How do you start Mysql on Linux?
Ans- /etc/init.d/mysql start
3.  Explain the difference between mysql and mysqli interfaces in PHP?
Ans- Mysqli is the object oriented version of mysql library functions.
4.  What’s the default port MySql Server?
Ans- 3306
5.   What does tee command do in Mysql?
Ans- tee followed by a filename turns on MySQL logging to a specified file. It can be stopped by command note.
6.   Can you save your connection settings to a conf file?
Ans- Yes, and name it~/.my.conf. You might want to change the permissions on the file to 600, so that it’s not readable by others.
7.  How do you change a password for an existing user via mysqladmin?
Ans- mysqladmin
-u root –p password “newpassword”
8. Use mysqldump to create a copy of the database?
     Ans- mysqldump –h mysqlhost –u

9.   Have you ever used Mysql Administrator and Mysql Query Brower? Describe the tasks you accomplished with these tools.

10. What are some good ideas regarding user security in MySQL?
Ans- There is no user without a password. There is no user without a user name. There is no user whose Host column contains % .


Sunday, February 12, 2012

MYSQL MCQ For Exam

Chapter- 15

1.    Which of the following function provides a convenient means for moving an uploaded file from file’the temporary directory to a final location?
A.    Move_uploaded_files()
B.    Move_files();
C.    Move_file_Uploaded();
Ans: A

2.    How to get the file size, in bytes of the file uploaded from the client Machine?
A.    $_Files[‘userfile’]_size Variable
B.    $_Files[‘userfile’][‘size’] variable
C.    $_Files[‘size’][‘tempname’]
D.    All of them
Ans: B
3.    _________________ supperglobal stores a variety of information pertinent to file uploaded to the server via a PHP Script.
A.    $_File_uploaded
B.    B. $_Files
C.    $_Files_Array()
Ans: B
4.    Which of the following function determine whether a file specified by the input parameters filename is uploaded using the post method?
A.    Uploaded_file()
B.    File_uploaded()
C.    Is_uploaded_file()
D.    None of them
Ans: C
5.    Which of the following directive determines the maximum size in megabytes of an uploaded file?
A.    Uploaded_file()
B.    File_uploaded()
C.    Max_Size()
D.    Upload_max_size()
Ans: D

 
Chapter-16

1.    ____________________ allows to use domain names in place of the corresponding IP Address?
A.    FTP
B.    DNA
C.    DNS
D.    DNN
Ans: C
2.    How to check the domain name exists or not?
A.    Use checkDomain()
B.    Use chechkdnsrr()
C.    Use DNS_Checking()
Ans: B

3.    Which of the following function returns an array consisting of various DNS resource records pertinent to a specific domain?
A.    Dns_record()
B.    Dns_get_record();
C.    Domain_get_record()
ANs: B
4.    Which of the following function returns the port number of a  specific service?
A.    Dns_record()
B.    Get_port_number();
C.    Getserverbyname()
Ans:  C
5.    Which of the following are not a mail function in PHP?
A.    Mail_send_to
B.    Mail()
C.    Send()
D.    Sendmail()
Ans: A,C,D
6.    To send a mail, Which of the following statement should be used?
A.    Send_mail("test@example.com", "This is a subject", "This is the mail body")
B.    mail("test@example.com", "This is a subject", "This is the mail body")
C.    mailto:("test@example.com", "This is a subject", "This is the mail body")
ans: B

Chapter- 18
1.    A session is started simply by calling session_start() like this: session_start();
A.    True  B. False
Ans: A

2.    Erase the session variables from memory, and even completely wipe the session from storage done through the
A.    session_unset() 
B.     session_destroy()
C.     Session_none()
D.    Session_fresh
Ans: A, B
3.    Which function completely removing the session from the storage mechanism?
A.    session_unset() 
B.     session_destroy()
C.     Session_none()
D.    Session_fresh
Ans: B
4.    Which function completely removing the session from the memory?
A.    session_unset() 
B.     session_destroy()
C.     Session_none()
D.    Session_fresh
Ans: A
5.    Which function offers a particularly convenient method for manually encoding
all session variables into a single string?
A.    session_unset() 
B.     session_destroy()
C.     session_encoding()
D.    session_encode
Ans: D

6.    Encoded session data can be decoded. Which function offers a particularly convenient method for manually decode all session variables?
A.    session_unset() 
B.    session_destroy()
C.     session_decoding()
D.    session_decode()
Ans: D
Chapter-20
1.    The _____________plays an enormously important role in the implementation of Web Services?
A.    SOAP protocol
B.    FTP Protocol
C.    HTTP Protocol
D.    XML Protocol
Ans: A

2.    Which of the following statement is true about Web Services?
A.    Web Service is a network service to support interoperable machine-to-machine interaction over a network
B.    Web Service is a mailing systems to send a mail  over a network
C.    Web Service is a software system designed to support interoperable machine-to-machine interaction over a network
Ans: C

3.    RSS offers a formalized means for encapsulating a Web site’s content within an XML-based structure, known as a feed
A.    True  B. False
Ans: A

4.    XML document is stored in a variable, which function  use to read it into the object?
A.    simplexml_load_string()
B.    simplexml_load()
C.    xml_load_string()
D.    load_string()
Ans: A

5.    How to retrieve the XML Attributes?
A.    Use attributes() method
B.    Use element() Method
C.    Use root() Method
Ans: A

6.    FTP  is a lightweight protocol intended for exchanging structured information in  decentralized, distributed environment
A.    True B. False     Ans: B


Chapter – 21
1.    Which function offers a great tool for viewing a summary of PHP’s configuration on a given server?
A.    The phpinfo()
B.    The info()
C.    The ApachiInfo()
Ans: A
2.    __________can be defined as the translation of data into a format that is intended to be unread able by anyone except the intended party.
A.    Encryption
B.    Decryption
Ans: A

3.    Which algorithm can also be used as a password verification system?
A.    Encryption
B.    MD5
C.    MHash
Ans: B
4.    Which data encryption package providing support for two-way encryption?
A.    MD5
B.    MHash
C.    Mcrypt
D.    Dcript
Ans: C

5.    The ______________function encrypts data, returning the encrypted result?
A.    mcrypt_encrypt()
B.    encrypt()
C.    mcrypt()
Ans: A


Chapter-25

1.    Mysql is a Relational Database
A.    True  B. False                   Ans: A
2.    Which of the following are MySql Features?
A.    Replication
B.    Query Caching
C.    Storage
D.    Security
Ans: A,B,D
3.    What are the MySql License Options?
A.    MySql Open Source License
B.    MySql Personal Edition License
C.    Commercial License
D.    Enterprise Edition License
Ans: A,C
4.    Which of the following are MySql 5.0 Features?
A.    Complete Foreign key Support
B.    Stored Procedure Support
C.    Integrated Report support
D.    Batch Query Support
Ans: A, B
5.    What are the storage engine of MySql?
A.    HDD
B.    InnoDB
C.    MyISM
D.    Backup
Ans: B,C
Chapter 25 & 26
1.    How to set the administrator password?
A.    SET ADMINISTRATOR FOR root@localhost=PASSWORD('secret');
B.    SET ROOT PASSWORD  FOR root@localhost=PASSWORD('secret');
C.    SET PASSWORD FOR root@localhost=PASSWORD('secret');
D.    SET PASSWORD FOR Admininstrator@localhost=PASSWORD('secret');
Ans: C
2.    Which of the following are true about MySqL Client?
A.    capable of managing almost every conceivable aspect of a MySQL server, including creating, modifying, and deleting tables and databases
B.    Capable of Database backup, Restore etc.
C.    Viewing Configuration Variables and System Status
Ans: A
3.    Which command use to view all the tables?
A.    View Tables
B.    Show Tables
C.    Display Tables
Ans: B
4.    To view a list of all existing databases
A.    View Databases
B.    Show Databases
C.    Display Databases
Ans: B
5.    How to view the structure of one of those tables?
A.    Structure Student
B.    Display student
C.    Describe student
D.    View Student
Ans: C