You are on page 1of 8

Experiment 1.

1
Student Name: ANIKET KUMAR Branch: BE-CSE
UID: 21BCS10117 Section/Group: 21BCS-906(B)
Date of performance: Subject name: Data Structures

AIM:
To perform SQL commands

REQUIREMENT:
ORACLE DBMS SOFTWARE

DDL (DATA DEFINATION LANGUAGE)


Create Command
Use CREATE statement to create a table

create table table_name (field_name datatype); (syntax)


Describe Command
Desc table name;(syntax)
SQL DESC Statement (Describe Table) SQL DESC statement use for describe
the list of column definitions for specified table. You can use either DESC or
DESCRIBE statement. both are return same result.
Alter Command (ADD)
alter table table_name add (field name datatype); (syntax)
The ALTER command in SQL is used to make changes to a table, view, or the
entire database. We can add, modify, and drop constraints, columns, and indexes

Alter Command (MODIFY)


alter table table_name modify(field_name datatype)
RENAME COMMAND
Alter table student rename column old_field to new_field

Drop Command
drop table table_name;(syntax)
The drop command in SQL is used to remove the whole table including data
present inside it, indexes, triggers, constraints, and permission specifications for
that particular table
Truncate Command
truncate table table_name;
this statement delete all rows from a table without deleting the structure of Table
DML (DATA MANIPULATION
LANGUAGE)

INSERT Command
INSERT INTO table1 (column1, column2) SELECT column1, column2 FROM
table2 WHERE condition1;);(syntax)
You can use the INSERT statement to query data from one or more tables and
insert it into another table

Select Command(*)
Select * from table_name; (syntax)
. The SELECT Statement in SQL is used to retrieve or fetch data from a database.
We can fetch either the entire table or according to some specified rules
SELECT COMMAND (FIELD_Name)
Select field1_name,field3_name from table_name;
Update Command
update table_name set field_name=value where field_name_2=value;
The UPDATE command for SQL is used to modify the existing data in a SQL
table.

Delete Command
delete from table_name where field_name=value;

You might also like