If you are planning to Import data to a MySQL Database, the first thing which need to check is the whether your data is in the right format. MySQL is best compatible with files in the CSV format. So, in case you have an Excel file you could save that file as a CSV File and you don’t need a special software to do that. All you would have to do is click on File from the Menu and select Save As and make sure the Format Type is CSV.
Now once you have that checked off your list the next and final step is Importing this data to the MySQL Database. If you google this you would get many different explanations and ways which would make you confused. It might ask you to write SQL Queries which you totally don’t have to. If you are using PhpMyAdmin, the easiest and fastest way to do it is to use the Import Function in the menu. Saves you time creating a table and columns corresponding to the data.
Make sure you select the database, then click on the Import button, choose the file and format and Import!
This is an important concept one must know when dealing with databases. This is something which is quite often asked in Interviews.
Database Normalization is a technique of decomposing data in a table. The main Intention to perform Normalization is to remove Data Redundancy and to ensure that there is uniqueness and consistency across the table.
By performing Normalization we resolve Issues of Insertion, Updation and Deletion. In case we have a table which is not Normalized, then there is a possibility that we might have two rows which are similar. And if we want to delete a particular row, Instead of performing one delete operation, we have to do it twice. This decreases the efficiency and multiplies the overhead cost. Since we are literally doubling the operations we perform.
In Order to overcome this, there are Normalization Rules available. And in case a table follows these rules, then the database can be called Normalized.
There are 4 major Normalization Rules-
- First Normal Form (1NF)
- Second Normal Form (2NF)
- Third Normal Form (3NF)
- Boyce and Codd Normal Form (BCNF)
These rules will be explained later!