DataBase Operations through XAMPP Console
In this article, we are going to perform database operations in My SQL Xampp Server using Xampp tool. We will perform the following operation as follows.
- Creating database
- Create a table in database
- Insert data into it
- View data.
Requirements –Xampp server
Database is a collection of related operation. MySQL is a one of the query language for managing the databases. MySQL is a database system used on the web which runs on a server. It is mainly used for large applications.
It has an Apache HTTP Server, MariaDB, and interpreter for 11 different programming languages like Perl and PHP.
X - Cross-platform A - Apache M - MySQL P - PHP P - Perl
To start your XAMPP server, you can follow the given below steps as follows.
- Start xampp server.
- Type “localhost/phpmyadmin” in your browser. You can see the following screenshots as follows.
Steps to implement database operations :
- Create a database named mydata.
- Create a table named student with 4 columns (student_id,name,gender,marks).
- Open console tab and start typing commands.
To execute a command press ctrl+Enter Button.
Database Operations :
Insert command is used to insert data into the table.
insert into table_name values(value1,value2,value3,.....,valuen);
INSERT INTO student VALUES(1,'sravan kumar','m',95)
Insert multiple records at a time :
INSERT INTO student VALUES(2,'bobby','m',85),(3,'ojaswi','f',95)
SELECT command is used to display data in the table.
SELECT * FROM student
Display name and marks :
SELECT name,marks FROM student
It is used to update / change value based on the given condition.
update table_name set column_name="value" where clause..
UPDATE student SET name="rohith" WHERE marks=95