CREATE DATABASE example_db;
USE example_db;
CREATE TABLE students (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(50) NOT NULL,
age INT,
gender ENUM('Male', 'Female', 'Other'),
class VARCHAR(20),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO students (name, age, gender, class) VALUES
('Alice', 20, 'Female', 'Class A'),
('Bob', 22, 'Male', 'Class B'),
('Charlie', 21, 'Other', 'Class A'),
('Diana', 19, 'Female', 'Class C');
SELECT * FROM students;
CREATE DATABASE example_db;
USE example_db;
CREATE TABLE students (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(50) NOT NULL,
age INT,
gender ENUM('Male', 'Female', 'Other'),
class VARCHAR(20),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO students (name, age, gender, class) VALUES
('Alice', 20, 'Female', 'Class A'),
('Bob', 22, 'Male', 'Class B'),
('Charlie', 21, 'Other', 'Class A'),
('Diana', 19, 'Female', 'Class C');
SELECT * FROM students;