In: Computer Science
What is SELECT?
What is UPDATE?
What is DELETE?
What is FROM?
What is WHERE?
What is CREATE TABLE?
What is INSERT INTO?
What is VALUES?
What is first Normal form
Consider below table Customers:
1.Select :
if you want to retrieve all CustomerName info Customers table ,select statement is used
SQL:
select CustomerName from Customers ;
2.Update:
update statement is used to change the existing record in a table
If you want to update CustomerID whose customer name is Alfredsfutterkiste
UPDATE Customers set CustomerID =7 where CustomerName='Alfredsfutterkiste'
3.Delete:
Delete statement is used to delete already existing record or row from a table
If you want delete whose customer id is 2,you have to execute below command
DELETE FROM Customers where CustomerID=2
4.FROM:
FROM is used for selection of tables:
Eg:
DELETE FROM Customers
5.Where :
Where is used to invoke condition on your selection :
Eg:
DELETE FROM Customers where CustomerID=2
6.CREATE TABLE:
CREATE TABLE creates table.
Eg:If you want to create a new table PERSON having ID,FirstName,LastNam as columns,use below statement
CREATE TABLE Person(
ID int, /*integer*/
FirstName varchar(255),/*string*/
LastName varchar(255)/*string */
);
7.INSERT INTO:
InsertInto used to insert new record in a existing table
If you want Insert into new with below values ,write the below statement:
INSERT INTO Customers values(5,'Arun','120 Hanover Sq.','London')
8)Values:
values indicates the sequence of columns data need to be inserted
same as Eg:7in Insert
9)First Normal Form:
Ist normal form is property states that no duplicate record is present in
a table.
You can see the above table ,there is no duplicate record .So the Customers table in
FirstNormalForm