MySQL is a high-performance open-source Relational Database Management System (RDBMS) developed by Oracle. It stores data in structured tables linked by relational keys.
MySQL provides high availability, ACID transaction compliance, and rapid query execution. It is widely used by companies like Facebook, Uber, Netflix, and Airbnb.
-- Create a new database and set it as active
CREATE DATABASE IF NOT EXISTS dev_store;
USE dev_store;
-- Create users table
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(50) NOT NULL UNIQUE,
email VARCHAR(100) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Insert sample record
INSERT INTO users (username, email)
VALUES ('alex_developer', '[email protected]');
-- Query created records
SELECT id, username, email FROM users;
| id | username | |
|---|---|---|
| 1 | alex_developer | [email protected] |
CREATE DATABASE IF NOT EXISTS.VARCHAR for variable-length strings and explicit integer types to optimize memory allocation.What SQL command makes a newly created database the active context for subsequent queries?
Sign in to track your learning journey, earn industry-recognized certificates, and join our elite developer community.
Quick Access With