how to create database and table in mysql

how to create database and table in mysql

MakeEverything5 | Hello everyone okay this time we will learn how to create a database and table in MySQL Let's just open the XAMPP application, we start MySQL because this is also okay we go straight to CMD directly to the MySQL directory okay before that let's see the list of databases with the show databases command semicolon we enter now this is a list of databases that we have created Let's just create a database I give an example here I created a database with the name sales_databases yes how to click database followed by the database name sales_database to replace the space semicolon enter we see the database yes now this is the database that we just created go straight to the next point we immediately create a table for example I will create a product_table so the way I use Notepad just so it's easy Later if for example there is an error you can copy paste yes how to click table database name followed by the names of the columns for example here there is product_id the data type is integer not zero primary then followed by the next column separated by a comma yes directly for example product name now this should not use spaces also product ID I use underscore product name also _ fajar for example 25 yes price yes the price is integer then there is product category for example my girlfriend gave me 15 only then there is stock like that okay for example I make 5 columns yes we close it first already semicolon After that we copy this directly in PS to here Right click copy Right Click here we press enter if database selection Oh that means in the database that we just created is selected first yes that means again here later okay and we see the results yes boss well this is the table that we just created to see the table structure we type desc product_table

Tutorial video for how to create database and table in mysql



Conclusion

Create database by type :



create database sales_database;

Create table by type :

create table product_table(
product_id int not null primary key,
product_name varchar(25),
price int,
product_category varchar(15),
stock int);

See you next time :)

0 Response to "how to create database and table in mysql"

Posting Komentar