> # ABOUT MYSQL > [name=Trijeta Ghosh] > [time=Fri, Mar 17, 2023 8:41 PM] > > [color=#0ba36e] ###### MYSQL website link-[https://www.mysql.com/] > [](https://) > ![mysql](https://i.imgur.com/CKmuYZD.png) --- * ### **INTRODUCTION** MySQL is a **relational database management system(RDBMS).** #### MySQL is ***developed by Oracle that is based on structured query language (SQL),*** Swedish company ***MySQL AB*** first released MySQL in 1995. MySQL is capable of handling a wide range of data types, including text, numbers, and binary data,like overall data base *(A database is a structured collection of data)* It allows users to organize and manage large amounts of data. It is widely used in web applications and software development as a backend database system.Also it supports advanced features such as transactions, indexing, and replication, which make it a reliable and scalable choice for data storage and management. --- * ### **HOW TO START MYSQL** > ### Installing and Starting MySQL > Basically MYSQL is the most popular open source database. 1. Go to the official MySQL website: https://dev.mysql.com/downloads/ 1. Select your operating system from the drop-down menu under "MySQL Community Downloads". 1. Click on the "Download" button next to the MySQL version you want to install. 1. Once the download is complete, open the installer. 1. Follow the installation wizard, which will guide you through the installation process. 1. During the installation process, you will be prompted to create a password for the "root" user. This is the superuser account for MySQL, so make sure to choose a strong password and keep it safe. 1. Once the installation is complete,your MySQL server is up and running, you can connect to it as the superuser root with the mysql client. > ### **IN LINUX** enter the following command at the command line terminal $> mysql -u root -p > ### **IN WINDOW** enter the following command at the command line terminal > [ Start, All Programs, MySQL, MySQL 5.7 Command Line Client (or MySQL 8.0 Command Line Client, respectively).or open a command prompt, go to the bin folder under the base directory of your MySQL installation] ```\ C:\> mysql -u root -p ``` after then ask the password give the previous same password and enter then start.But for installations using the MySQL Yum repository, MySQL SUSE repository, or RPM packages directly downloaded from Oracle, the generated root password is in the error log. View it with, for example, the following command: ``` $> sudo grep 'temporary password' /var/log/mysqld.log ``` for close the terminal, the following command: ```\ mysql> QUIT ``` --- * ### **OPERATION OF MYSQL** In MTSQL there are some basic operation, to showing the database,following the statement below: ##### Use a showing database statement: ```\ mysql> SHOW DATABASES; ``` #### use to create new database: following the statement bellow: ```\ mysql> CREATE DATABASE employee; ``` #### create a table inside database: In MYSQL we can create a table by USE statement (USE employee)as the default database for subsequent statements. ```\ mysql> USE person ``` To create table ,following statement bellow: ```\ CREATE TABLE employee( emp_id varchar(10) PRIMARY KEY, # make the employee id in the primary key and varchar is use to measure variable- length character data type emp_name varchar(20) NOT NULL, # name using to measure variable- length character data type which is not null. emp_address varchar(20) NOT NULL, # address using to measure variable- length character data type which is not null. emp_phno int(10) NOT NULL, # add phone num which is integers and not null emp_salary int (20) NOT NULL, # add salary whivh is integers and not null. ); ``` Check if the table has been created with a SHOW TABLES,following statement below: ```\ mysql> SHOW TABLES; +------------------+ | Tables_in_person | +------------------+ | employee | +------------------+ 1 row in set (0.00 sec) ``` Shows information on all columns of a table by using DESCRIBE,following statement below: ```\ mysql> DESCRIBE employee; +-------+------------------+------+-----+---------+---------------------+ | Field | Type | Null | Key | Default | Extra | +-------+------------------+------+-----+---------+---------------------+ |emp_id | varchar(10) | NO | PRI | NULL | auto_increment | |emp_name | varchar(20) | NO | | NULL | | |emp_address | varchar(20) | NO | | NULL | | |emp_phno | int(10) | NO | | NULL | | |emp_salary | int(20) | NO | | NULL | | +-------+------------------+------+-----+---------+---------------------+ 5 rows in set (0.00 sec) ``` #### Adding data or value inside table: following the statement below: ```\ INSERT INTO employee VALUES('ID01','RINA ROY','HOOGHLY',8609191***,50000), ('ID02','RAMESH DAS','KOLKATA',8558603***,60000), ('ID03','MIR DEY','HOWRAH',9700567***,40000); ``` After then to retrieving records from a table,using SELECT statement with "*" for all, following statement below: ```\ mysql> SELECT * FROM employee; ``` ```\ +--------+------------+-------------+--------------+------------+ | emp_id | emp_name | emp_address | emp_phno | emp_salary | +--------+------------+-------------+--------------+------------+ | ID01 | RINA ROY | HOOGHLY |8609191*** | 50000 | | ID02 | RAMESH DAS | KOLKATA |8558603*** | 60000 | | ID03 | MIR DEY | HOWRAH |9700567*** | 40000 | +--------+------------+-------------+--------------+------------+ 3 rows in set (0.00 sec) ``` To select a particular row and col then using WHERE statement,following statement below: ```\ mysql> SELECT name FROM employee WHERE emp_id = 'ID03'; ``` ```\ +--------+ | emp_id | +--------+ | ID03 | +--------+ ``` #### Add table : For adding table use ALTER TABLE...ADD statement, following statement below: ```\ mysql> ALTER TABLE cats ADD age int(3) ; ``` #### Deleting data from table: Use DELETE statement to delete the data and using WHERE statement to delete a particular data. following statement below ```\ mysql> DELETE FROM employee WHERE emp_name='MIR DEY'; ``` #### To delete table : To delete all table using DROP TABLE table_name; following statement below: ```\ mysql> DROP TABLE employee; ``` --- * ### IMPORTANCE OF MYSQL > MySQL is a popular open-source relational database management system that provides an efficient and reliable way to store, organize, and manage data. Here are some reasons why we need MySQL: 1. **Data Management**: MySQL allows businesses and organizations to manage their data efficiently. It provides a fast, reliable, and scalable way to store data that can be easily accessed, manipulated, and retrieved. 2. **Security**: MySQL provides a range of security features to protect data from unauthorized access, such as encryption, user authentication, and access control. 3. **Compatibility**: MySQL is compatible with a wide range of platforms, programming languages, and frameworks, which makes it easy to integrate with other technologies. 4. **Web Applications**: MySQL is widely used in web applications. It is an ideal choice for storing data that is used by web applications, such as user profiles, product catalogues, and customer orders. --- ###### **MY SQL USE IN PYTHON:** MySQL is a widely used open-source relational database management system that provides an efficient and reliable way to store, organize, and manage data. Python, on the other hand, is a popular programming language that provides a wide range of data manipulation and analysis libraries. > #### Using MySQL with Python provides several benefits, including: 1. *Scalability: MySQL is known for its scalability, and when used with Python, it can handle large amounts of data and transactions efficiently.* 1. *Easy to use: MySQL Connector/Python provides a simple and efficient way to connect to MySQL servers and execute SQL queries from Python* 2. *Simplified data manipulation: Python provides a wide range of data manipulation libraries, such as Pandas, Numpy, and Matplotlib, that can be used to process and analyze data stored in MySQL databases.* MYSQL USE IN PYTHON EXAMPLE: ![](https://i.imgur.com/8OoV2qQ.png) ![](https://i.imgur.com/r5Ud22t.png) ![](https://i.imgur.com/ZSx4HuK.png) --- * ### APPLICATION AND FUTURE SCOPE OF MYSQL: #### Application: **Web Applications**: *MySQL is widely used in developing web applications due to its ease of use, scalability, and reliability. It is used to store and manage data for various web applications, such as online shopping websites, social networking sites, and content management systems.* **Cloud-based Applications:** *MySQL is used in cloud-based applications, such as Software as a Service (SaaS), Platform as a Service (PaaS), and Infrastructure as a Service (IaaS), due to its scalability and ease of use. It provides an efficient way to store and manage data in the cloud, making it easier for developers to build cloud-based applications.* **Embedded Systems:** *MySQL can be used in embedded systems, such as mobile devices and smart TVs, to store and manage data. It provides a small and efficient database engine that can be embedded in these devices, making it easier to manage data locally* #### Future Scope: **Big Data Management:** *With the increase in the amount of data generated by businesses and individuals, there is a growing need for efficient and scalable database management systems. MySQL is well-positioned to handle big data management due to its scalability, reliability, and ease of use.* **Internet of Things (IoT):** *As the number of connected devices continues to grow, there is a need for database management systems that can handle data from various sources. MySQL is well-suited for IoT applications due to its ability to handle large volumes of data and its scalability.* **Machine Learning and Artificial Intelligence:** *MySQL can be used in machine learning and artificial intelligence applications to store and manage data. Its scalability and ease of use make it an ideal database management system for these applications.* --- ### **CONCLUSION** MySQL is a popular and widely used open-source relational database management system that provides an efficient and reliable way to store, organize, and manage data. It is used in a variety of applications, including web applications, data warehousing, embedded systems, and cloud-based applications. With its scalability, reliability, and ease of use, MySQL is well-positioned to handle big data management, IoT, cloud computing, and machine learning and artificial intelligence applications. Overall, MySQL is an essential tool for businesses and developers to store and manage data efficiently and effectively. THANK YOU.