Introduction of SQL
- SQL is Structured Query Language invented in 1986.
- SQL lets you access and manipulate databases.
What Can SQL do?
- SQL can execute queries against a database.
- SQL can retrieve data from a database.
- SQL can insert,update,delete records in a database.
- SQL can create new databases.
- SQL can create new tables in a database.
- SQL can create stored procedures in a database.
- SQL can create views in a database.
- SQL can set permissions on tables, procedures, and views.
Brief about DML and DDL
DML : It stands for data manipulation Language. It deal with Data only. Examples of DML commands:
- Insert is used to insert one or more rows in a table or view.
- Update is used to change existing data in a table or view.
- Delete is used to remove one or more rows from a table.
DDL : It stands for data definition Language. It deals with Structures of tables.
Example of DDL commands:
- Create is used to define new objects.
- Alter is used to modify the definition of existing object.
- Drop is used to remove existing entity.
- Truncate is used remove all rows from a table.
Brief about DCL and TCL
DCL includes commands such as GRANT and REVOKE which mainly deals with the rights, permissions and other controls of the database system.
Example of DCL Commands:
- GRANT-Gives user’s access privileges to database.
- REVOKE-Withdraw user’s access privileges given by using the GRANT command.
TCL(Transaction Control Language) : TCL commands deals with the transactions of database.
Example of TCL Commands:
- COMMIT– commits a Transaction.
- Rollback– rollbacks a transaction in case of any error occurs.
- SAVEPOINT–sets a save point within a transaction.
- SET TRANSACTION–specify characteristics for the transaction.
–Create a table
create table Student(Name varchar(20),ID int,Dept varchar(50),address varchar(50))
–Insert values
Insert into Student values(‘Tom’,101,’CS’,’ABC’)
Insert into Student values(‘Kerry’,102,’IT’,’ADC’)
Insert into Student values(‘Sam’,103,’EC’,’ADF’)
Insert into Student values(‘Sohit’,104,’EN’,’ADH’)
Insert into Student values(‘Naman’,105,’ME’,’AWR’)
Insert into Student values(‘Will’,106,’CE’,’DWS’)
–select a table
select * from Student
–Update a existing records
Update Student set Name=’Rohan’
where id =104
select * from Student
–Delete a row
delete from Student where id =106
select * from Student
–Modify data
Alter table Student add Subject varchar(50)
select * from Student
–Truncate table
Truncate table Student
select* from Student
— Drop table
Drop table Student
For More Info Watch Video
I was extremely pleased to discover this site. I wanted to thank you for your time just for this wonderful read!! I definitely enjoyed every bit of it and i also have you saved as a favorite to look at new stuff on your blog.
Consider me thoroughly enlightened! You’ve deepened my understanding immensely.
Here is my blog post … online loans no credit check instant approval canada
Thanks on your marvelous posting! I seriously enjoyed reading it,
you could be a great author.I will always bookmark your blog and definitely will come
back later on. I want to encourage you continue your great
posts, have a nice weekend!
Superb post! This was very informative.
Here is my webpage … online loans no credit check instant approval canada 24 7
Nice post. I was checking continuously this blog and I’m inspired!
Very useful info specifically the final part 🙂 I care for
such info a lot. I was looking for this certain information for a long time.
Thank you and best of luck.
At once is the convenience life to involved in put in. There won’t be another opinion like this
The goals of therapy are to reduce morbidity, to shorten the clinical course of the disease, to prevent complications, and to prevent recurrences cialis tablets for sale
Thank you very much for sharing, I learned a lot from your article. Very cool. Thanks. nimabi
Hey very nice blog!
Look into my website – https://herdouksaders32.com
Thank you very much for sharing, I learned a lot from your article. Very cool. Thanks. nimabi