Create DATABASE using XAMPP and the MariaDB shell
ฝัง
- เผยแพร่เมื่อ 15 พ.ย. 2024
- COMMANDS TO USE:
mysql -u root -p --port=3306
(connect MariaDb)
CREATE DATABASE your_database_name;
Example : CREATE DATABASE Country;
USE your_database_name;
Example: USE Country;
CREATE TABLE country (
country_id INT AUTO_INCREMENT PRIMARY KEY,
country_name VARCHAR(100) NOT NULL,
region_id INT NOT NULL
);
Example:
INSERT INTO country (country_name, region_id) VALUES
('Philippines', 1),
('Japan', 2),
('India', 3),
('USA', 4),
('Germany', 5),
('Brazil', 6),
('Australia', 7),
('Canada', 8),
('France', 9),
('South Korea', 10);
SELECT * FROM country;