SQL BASIC REVIEW Examples and Group Activity
CREATE -- Create a new database CREATE DATABASE DemoDB; -- Switch to the newly created database USE DemoDB; -- Create a new table named 'Employees' CREATE TABLE Employees ( EmployeeID INT PRIMARY KEY AUTO_INCREMENT, FirstName VARCHAR(50), LastName VARCHAR(50), Department VARCHAR(50), Salary DECIMAL(10, 2), HireDate DATE ); INSERT -- Insert data into the 'Employees' table INSERT INTO Employees (FirstName, LastName, Department, Salary, HireDate) VALUES ('John', 'Doe', 'Engineering', 75000, '2020-01-15'), ('Jane', 'Smith', 'Marketing', 65000, '2019-03-12'), ('Emily', 'Jones', 'Finance', 80000, '2021-06-24'), ('Michael', 'Brown', 'Engineering', 72000, '2018-11-30'); SELECT -- Select all data from the 'Employees' table SELECT * FROM Employees; -- Select specific columns from the 'Employees' table SELECT ...