InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
How to add users in MySQL? |
|
Answer» You can add a User by USING the CREATE command and SPECIFYING the necessary credentials. For EXAMPLE: CREATE USER ‘testuser’ IDENTIFIED BY ‘sample PASSWORD’;
|
|
| 2. |
What is BLOB in MySQL? |
|
Answer» BLOB is an acronym that stands for a BINARY large object. It is used to hold a VARIABLE amount of data.
A BLOB can hold a very large amount of data. For example - documents, IMAGES, and even videos. You could store your complete novel as a file in a BLOB if needed. |
|
| 3. |
What are the Temporal Data Types in MySQL? |
||||||||||||
Answer»
Example: To select the records with an Order Date of "2018-11-11" from a table: SELECT * FROM Orders WHERE OrderDate='2018-11-11' |
|||||||||||||
| 4. |
What are the String Data Types in MySQL? |
||||||||||||||||||||||||||||||||
Answer»
|
|||||||||||||||||||||||||||||||||
| 5. |
What are the Numeric Data Types in MySQL? |
||||||||||||||||||||
|
Answer» MySQL has numeric data TYPES for integer, fixed-point, floating-point, and BIT values, as shown in the table below. Numeric types can be signed or UNSIGNED, except BIT. A special ATTRIBUTE enables the automatic generation of sequential integer or floating-point COLUMN values, which is useful for applications that require a series of unique identification numbers.
|
|||||||||||||||||||||
| 6. |
How do you view a database in MySQL? |
|
Answer» One can view all the databases on the MYSQL server HOST USING the following command: mysql> SHOW DATABASES; |
|
| 7. |
How to Delete Data From a MySQL Table? |
|
Answer» In MYSQL, the DELETE STATEMENT is USED to delete RECORDS from a table: DELETE FROM table_nameWHERE column_name = value_name |
|
| 8. |
How to create an Index in MySQL? |
|
Answer» In MYSQL, there are different index types, such as a regular INDEX, a PRIMARY KEY, or a FULLTEXT index. You can achieve fast searches with the help of an index. Indexes speed up performance by either ordering the data on disk so it's quicker to FIND your RESULT or, telling the SQL engine where to go to find your data. Example: Adding indexes to the history table: ALTER TABLE history ADD INDEX(author(10));ALTER TABLE history ADD INDEX(title(10));ALTER TABLE history ADD INDEX(category(5));ALTER TABLE history ADD INDEX(YEAR);DESCRIBE history; |
|
| 9. |
How do you remove a column from a database? |
|
Answer» You can remove a COLUMN by USING the DROP keyword: ALTER TABLE classics DROP PAGES; |
|
| 10. |
How do you Insert Data Into MySQL? |
|
Answer» The INSERT INTO STATEMENT is used to add new records to a MySQL table: INSERT INTO table_name (column1, column2, COLUMN3,...)VALUES (value1, value2, value3,...)If we want to add values for all the columns of the table, we do not NEED to SPECIFY the column names in the SQL query. However, the order of the values should be in the same order as the columns in the table. The INSERT INTO syntax WOULD be as follows: INSERT INTO table_nameVALUES (value1, value2, value3, ...); |
|
| 11. |
How do you create a table using MySQL? |
|
Answer» Use the following to create a table using MySQL: CREATE TABLE HISTORY (AUTHOR VARCHAR(128),title VARCHAR(128),type VARCHAR(16),year CHAR(4)) ENGINE InnoDB; |
|
| 12. |
How do you create a database in MySQL? |
|
Answer» USE the FOLLOWING command to create a new database CALLED ‘BOOKS’: CREATE DATABASE books; |
|
| 13. |
What are some of the common MySQL commands? |
||||||||||||||||||||||||||||||||||||||||||||
Answer»
|
|||||||||||||||||||||||||||||||||||||||||||||
| 14. |
What are MySQL Database Queries? |
|
Answer» A query is a SPECIFIC request or a QUESTION. One can query a DATABASE for specific INFORMATION and have a RECORD returned. |
|
| 15. |
How can you interact with MySQL? |
| Answer» | |
| 16. |
What does a MySQL database contain? |
|
Answer» A MySQL database contains one or more tables, each of which contains RECORDS or rows. Within these rows are VARIOUS COLUMNS or FIELDS that contain the DATA itself. |
|
| 17. |
What does SQL in MySQL stand for? |
|
Answer» The SQL in MySQL stands for STRUCTURED Query Language. This language is ALSO used in other databases such as Oracle and Microsoft SQL Server. One can use COMMANDS such as the following to send requests from a database: SELECT title FROM publications WHERE author = ' J. K. ROWLING’; Note that SQL is not case sensitive. However, it is a good practice to write the SQL keywords in CAPS and other names and variables in a small case. |
|
| 18. |
What do you mean by ‘databases’? |
|
Answer» A database is a structured COLLECTION of data stored in a COMPUTER system and ORGANIZED in a WAY to be quickly searched. With databases, information can be rapidly RETRIEVED. |
|
| 19. |
What are some of the advantages of using MySQL? |
Answer»
|
|
| 20. |
What is MySQL? |
|
Answer» MySQL is a database MANAGEMENT system for web SERVERS. It can GROW with the website as it is highly scalable. Most of the WEBSITES TODAY are powered by MySQL. |
|