-- Create a database called 'my_database'
CREATE DATABASE my_database;
-- Use the 'my_database' database
USE my_database;
-- Create a table called 'employees'
CREATE TABLE employees (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
department VARCHAR(255) NOT NULL
);
-- Insert some data into the 'employees' table
INSERT INTO employees (name, department)
VALUES
('John Doe', 'Accounting'),
('Jane Doe', 'HR'),
('Bob Smith', 'Engineering');
-- Query the 'employees' table to view the data
SELECT * FROM employees;
-- Create a database called 'my_database' CREATE DATABASE my_database;
-- Use the 'my_database' database USE my_database;
-- Create a table called 'employees' CREATE TABLE employees ( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255) NOT NULL, department VARCHAR(255) NOT NULL );
-- Insert some data into the 'employees' table INSERT INTO employees (name, department) VALUES ('John Doe', 'Accounting'), ('Jane Doe', 'HR'), ('Bob Smith', 'Engineering');
-- Query the 'employees' table to view the data SELECT * FROM employees;