A1186950856 23641 31 2019 3 SQL Queries
A1186950856 23641 31 2019 3 SQL Queries
A1186950856 23641 31 2019 3 SQL Queries
DDL-COMMANDS
CREATE
• SQL CREATE TABLE statement is used to create
table in a database.
• If you want to create a table, you should name the
table and define its column and each column's data
type.
• Let's see the simple syntax to create the table.
• create table table-name ( column-name1
datatype1, column-name2 datatype2, column-
name3 datatype3, column-name4 datatype4 );
• create table Student(id number(10), name
varchar(20), age number(4));
• You can verify it, if you have created the table
successfully by looking at the message displayed by
the SQL Server, else you can use DESC command as
follows:
• SQL> DESC STUDENTS;
• Create a table Employee having attributes as
id,name,department,age.
• SQL> CREATE TABLE STUDENTS ( ID number (10)
NOT NULL, NAME VARCHAR (20) NOT NULL, AGE
number(10) NOT NULL, ADDRESS CHAR (25) );
• It will get that no null value is taken;
•
Inserting Data into Table