![]() |
VOOZH | about |
XAMPP is a cross-platform web server used to develop and test programs on a local server. It is developed and managed by Apache Friends and is open-source. It has an Apache HTTP Server, MariaDB, and interpreter for 11 different programming languages like Perl and PHP. XAMPP Stands for cross-platform, Apache, MySQL, PHP, and Perl.
In this article, we are going to perform Database operations like Create, Insert, Update, Delete data from the database created in XAMPP localhost server. We are also going to create a table and then start performing database operations. Following are the list of database operations with their respective syntax:
It is used to display all the details from the table.
Syntax: SELECT * FROM 'table_name'
It is used to insert data into the table.
Syntax: INSERT INTO `table_name`(`col`, `col2`, `col3`,.. `coln`) VALUES ([value-1],[value-2], [value-3],....,[value-n)
It is used to change/update any data in the table.
Syntax: UPDATE `table_name` SET `col1`=[value-1], `col2`=[value-2], `col3`=[value-3], `coln`=[value-n] WHERE 1
It is used to delete data from a table.
Syntax: DELETE FROM table_name where col="value"
Follow the below steps to perform database operations on XAMPP:
1. Start XAMPP server
👁 Image2. Go to Browser and type "http://localhost/phpmyadmin" and Create a database with the name "Vignan" by selecting new
👁 Image3. After that, Create table Name "ITDept" and give the number of columns (I created 4 columns) and click on Go
👁 ImageGive column names as "Rollno"(Varchar), "Name"(Varchar), "Gender" (Char), "Address"(Varchar), and Save.
Note: Clicking the "Save" option is important, if not the table is not created.
👁 ImageThen we get the output as:
👁 ImageINSERT Operation:
By default, code is available like this:
INSERT INTO `itdept`(`Rollno`, `Name`, `Gender`, `Address`) VALUES ([value-1],[value-2],[value-3],[value-4])
INSERT INTO `itdept`(`Rollno`, `Name`, `Gender`, `Address`)
VALUES ("171FA07058","Sravan Kumar Gottumukkala", "m", "HYD" )👁 ImageOutput:
👁 ImageUPDATE Operation:
👁 ImageDefault code in the update is:
UPDATE `itdept` SET `Rollno`=[value-1], `Name`=[value-2], `Gender`=[value-3], `Address`=[value-4] WHERE 1
UPDATE `itdept` SET NAME="Sujitha" WHERE `Rollno`="171FA07078"
Output:
👁 ImageSELECT Operation:
The Select statement is used to display or query for data from the database. Follow the below steps to do so:
This will result in the following code generation:
SELECT * FROM `itdept`
Output:
👁 ImageFor Selecting particular data follow the below sample query:
Select Rollno, Name from itept👁 Image
DELETE Operation:
The generated code would look like below:
DELETE FROM itdept where Rollno="171FA07058"
Output:
👁 ImageOur Final data in Table is:
👁 Image