- Home
- SQL Home
- Statements
Statements
- CREATE DATABASE databasename;
- DROP DATABASE databasename;
- create table persons (id int, LastName varchar(25), FirstName varchar(50), address varchar(255), city varchar(50));
- DROP TABLE Shippers;
(drops the existing table "Shippers")
- TRUNCATE TABLE table_name;
(The TRUNCATE TABLE statement is used to delete the data inside a table, but not the table itself.)
- alter table persons add dateOfBirth date;
- ALTER TABLE `persons` CHANGE `dateOfBirth` `dateOfBirth` YEAR NULL DEFAULT NULL;
- insert into persons (LastName, FirstName, address, city, dateOfBirth) values ("Singh", "Satbir", "habibpura", "Amritsar", 2010);
- SELECT * FROM persons LIMIT 3;
- SELECT * FROM persons WHERE dateOfBirth <= 2005;
- SELECT MAX(Price) AS LargestPrice FROM Products;