carmelo-cyber / Carmelo_GitHub

All code for any situation
0 stars 0 forks source link

SQL 1 #3

Open carmelo-cyber opened 1 year ago

carmelo-cyber commented 1 year ago

-- 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;