HOW TO CODE IN MYSQL |BASICS | XAMPP

  1. Open XAMPP application

2. Start Apache and MySQL Service. Then click Admin for MySQL.

3. Your Browser should pop-up and MyPHPAdmin main page should be loaded at your your browser.

4. Click SQL to open SQL editor.

5. Here we gonna edit some code to make a new database, table and insert value inside the table.

For the first example let’s take a look at an image with the example of a table that needed to be created using SQL code

  1. We need to create a Database and we are gonna name it as Exercise 1. Type this code in SQL editor and press Go.

CREATE DATABASE EXERCISE1

2. Create a table by declaring your variable and its type. Here an example of the code

CREATE TABLE STUDENT
(
NAME VARCHAR(25),
IC_NO VARCHAR(12),
STUDENTID INT(9),
GROUP_NO VARCHAR(2),
DATE_ VARCHAR(12)
);

Here the NAME, IC_NO, GROUP_NO and DATE_ are declared as VARCHAR and set limit for number of characters that it will consists. While the STUDENTID is declared as Integer and set limit for number of characters that it will consists. After inserting this code, click go.

3. Now all we have to do is Inserting value into the table that we just created. Insert the code as following.

INSERT INTO STUDENT
(
NAME, IC_NO, STUDENTID, GROUP_NO, DATE_
)

VALUES
(
‘JAY’, ‘43243232432242’, 192020087, 3, ‘07.07.2001’
)

Here we are telling the compiler that we are gonna insert the value into the variables. Then we are telling the compiler that we are inserting value into the table. After done that now click go.

4. At the side bar expand the database and click at our EXERSICE1 Table. There you will find the table that we just have created with values in.

This guide is sponsored by @ JAY TECH STUDIO

DM us to get all software that fits your need for the most affordable price and PC/Laptop repair. We also offer all types of game that you need. For list of software that we have click the image above. If you have any question or need a software that is not in your list do message us in Whatsapp at the link below.

https://wa.link/fylia3

Leave a comment

Knowledge is Power

Design a site like this with WordPress.com
Get started