0% found this document useful (0 votes)
12 views

Create Database 2. SP - Helpdb 3. SP - Renamedb, 4. Use

This document provides an overview of SQL basics including creating and managing databases, data definition language (DDL) commands like CREATE, ALTER, TRUNCATE, and DROP for defining and modifying database structures. It also covers data manipulation language (DML) commands like INSERT, DELETE, and UPDATE for managing the data. Finally, it mentions data retrieval language (DRL) commands like SELECT for querying and retrieving data from databases.

Uploaded by

Asif Talumari
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Create Database 2. SP - Helpdb 3. SP - Renamedb, 4. Use

This document provides an overview of SQL basics including creating and managing databases, data definition language (DDL) commands like CREATE, ALTER, TRUNCATE, and DROP for defining and modifying database structures. It also covers data manipulation language (DML) commands like INSERT, DELETE, and UPDATE for managing the data. Finally, it mentions data retrieval language (DRL) commands like SELECT for querying and retrieving data from databases.

Uploaded by

Asif Talumari
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

SQL BASICS

ABOUT DATA BASE.


1. create database <databasename>
2. sp_helpdb <databasename>
3. sp_renamedb <'olddbname'>, <'newdbname’>
4. USE <DATABASENAME>

DATA DEFINITION LANGUAGE COMMANDS (DDL)

 Create: create command is used to create database, stored procedures, functions, views, triggers.
Example: create table tablename(columnname datatype)
 Alter: Alter is used to modify the data in the table such as… Add data, Delete data, Rename data and
modifying datatype
Example: alter table <tablename> add <columname datatype>.
alter table drop column <columnname>
alter table <tablename> alter column <columnname datatype>
 Truncate: Trunacte is used to remove data but it will not remove the structure of the table.
Example: truncate table <tablename>
 Drop: by using this we can delete both data and structure of the data.
Example: drop table <tablename>
DATA MANIPULATION LANGUAGE COMMAND (DML)

 INSERT: Insert is used to insert the data in to the table.


Example: insert into <tablename> (columns)values(dhjzd),(adhkah)
 Delete: we can delete particular column.
Example: delete <tablename> where <eno=101>
 Update: Update is used to update the value in any part of the table.
Example: update <tablename> set <columname>=<'newvalue'> where <eno=101>
DATA RETRIVAL LANGUAGE COMMANDS (DRL)

 Select: select is used to retrieve the data.


 Example: select * from <tablename>

You might also like