SQL Server Data definition language interview questions
SQL Server Data definition language - Nov 18, 2008 at 15:30
pm by Rajmeet Ghai
Define Data definition language.
Answer
A Data Definition language is a computer language. It defines how can
data be stored efficiently. All the commands used to create, delete databases
like CREATE or DELETE are a part of data definition language.
Explain the command Create Table, Alter Table and Drop Table with syntax.
Answer
Create table: Used to create a table in sql. Tables store the
data. Each row in a table has a unique identifier called as a primary key.
Syntax:
CREATE TABLE table_name (
Column_name1 data_type,
Column_name2 data_type,
PRIMARY KEY (Column_name1));
Example:
CREATE TABLE customer (
Id Integer(10)
First_name Varchar(200)
Last name varchar(200)
PRIMARY KEY(id));
<<Previous
Next>>
|