Technology Guruu

  • Home
  • Site Info
    • About Us
    • Disclaimer
    • Privacy Polacy
  • Home
  • Digital Marketing
    • SEO
    • SMM
    • SEM
  • Quotes
  • Technical
  • Java
  • .Net
    • C#.Net
    • ASP.Net
  • Keychains

Monday, 4 April 2016

DDL Commands in SQL-sql query tool

 Akansha     12:00:00     TechnicalQuestions     No comments   

SQL  DDL Commands

SQL is a Structured Query Language it is the Back End language we have the Front End languages are Java,C#.net,vb.Net,PHP etc and backend languages are MySQL,SQL Server,Oracle etc.All frontend languages are used for writing programming in frontend and backend are used for storing the data in database.In the below you are seen DDL Commands in SQL this Commands are very powerful and useful to all and this are basic steps to learn SQL.
sqlcommands
SQL Commands

Data Definition Language:  

These commands are used to create database or database objects like tables,views,triggers,stored procedures,etc.
In DDL we have 4 types of commands they are
1. Alter
2.Create
3.Drop
4.Truncate


*******Alter Command*******

1.Alter

* These commands are used to modify the structure of database or database object.
* By using alter command we can add a new column for the existing table.
* We can remove a column from the table.We can change the datatype of the column.

Syntax:- alter table tablename

Q)Write a query to add a new column for existing table?

Syn:-  alter table tablename add columnname datatype

Ex:- alter table emp add salary money

Q)Write a query to remove salary column from existing table?

Syn:-  alter table tablename drop column  columnname

Ex:-   alter table emp drop column salary

*******Drop Command*******

2.Drop

It is used to drop the database or database objects like tables.
Syntax for to drop a database

Syn:drop database databasename

Ex:-  drop database employee

Syntax for drop a table

Syn:   drop table tablename

Ex:-   drop table emp
*******Create Command*******

3.Create

By using this command we can create tables or databases. 
Syntax for create table

Syn:  create table tablename

Ex:- create table emp
Syntax for create database

Syn:   create database Databasename

Ex:-  create database employee 


*******Truncate Command*******

4.Truncate

Truncate will delete the table data but not the table structure.
Syntax for truncate the table

 Syn: truncate table tablename

Ex:- truncate table emp

 Q)What is the difference between drop and truncate?

Truncate will delete the table data but not the table structure.
Drop will delete the table data along with table structure.
We can insert the record in the table even though we can truncate the table.
We can not insert the record in the table once the table is Droped.

In this article you can find the detail description about DDL commands that commands will help you to prepare for the interviews.These topic is very important and easy topic and it is the most frequently asking topic in interview purpose.

Share With Your Friends in Social Media (Facebook, Twitter, Google Plus Etc...) if You Like Our Content And Feel Free To Comment.
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Popular Posts

  • Missing My Friend Quotes : Friendship Day Quotes 2017
    Friends today my article about missing friends and moments with them. Here you are seen the best friendship quotes and some  feelings when...
  • Love Failure Quotes and Sad valentines day Quotes
    We Love Someone is a easy process sometime takes long time to love someone love others within short period but anyway always love dependin...
  • Brief description about Delegates
    Introduction about delegates and why delegates are came the main purpose of delegates how to useful and what are the advantages and disadv...
  • Na Tanu Samjhawan Ki Song lyrics
    Na Tanu Samjhawan Ki Song Lyrics With English Translation Movie : Humpty Sharma ki Dulhaniya Song : Samjhawan Song Singer : Arijit ...
  • Detail Introduction about C#.Net
    Brief Introduction about C#.Net  Introduction C#.Net is the one of the Programming Language the .Net Framework also contains ano...
  • Wonderful sayings about Life.
    I Believe Follow  Things(Life Quotes) I Believe I believe: ********** Believe in Life ********** That we don't have to chan...
  • Brief Description about Multicast Delegate
    Multicast delegate is an extension of normal delegate. It helps you to point more than one method at a single moment of time. Multicast ...
  • Brief description about properties
    Properties in C#.Net Properties Property is a member of a class which we will use to assign the value to a variable as well as whi...
  • Top 10 valentine's day Quotes and Greetings wishes
    All Lovers have Anxiety in Valentines day because it is a festival to all lovers in these they enjoy a lot and celebrate the Valentine...
  • Valentines day poems and wishes or Quotes
    A friendship that like love is warm; A love like friendship, steady.we are having the most difference between love and Friendship you mus...

Categories

  • Entertainment (67)
  • TechnicalQuestions (58)
  • Quotes (11)
  • C#.Net (8)
  • Java (8)
  • ValentinesDay (4)
  • SEO (3)
  • Home
  • About Us
  • Disclaimer
  • Privacy Policy
  • Sitemap

Copyright © 2015-2017 Good Friends 5.All Rights Reserved• And Our Sitemap • All Logos and Trademark Belongs To Their Respective Owners•