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

SQL Intro & DDL

The document provides an overview of Database Management Systems (DBMS) and Relational Database Management Systems (RDBMS), including software examples like MySQL and Oracle. It explains SQL commands and data types, detailing operations for querying, modifying, and managing database structures. Additionally, it outlines SQL statement types such as DDL, DML, DCL, and TCL, along with specific commands for creating and altering database objects.

Uploaded by

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

SQL Intro & DDL

The document provides an overview of Database Management Systems (DBMS) and Relational Database Management Systems (RDBMS), including software examples like MySQL and Oracle. It explains SQL commands and data types, detailing operations for querying, modifying, and managing database structures. Additionally, it outlines SQL statement types such as DDL, DML, DCL, and TCL, along with specific commands for creating and altering database objects.

Uploaded by

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

DBMS-Database Management System

RDBMS-Relational Database Management System

RDBMS Software
MySQL,SQL,OracleMangoDB,DB2

SQL-Structured Query Language


it performs various operations such as Querying Data,Modifying Data,Create
database objects and Managing database Structures.

General Commands of SQL:


Show Databases -Display the databases present in our System.
use Databasename -Specify which database we work
show tables -Display the tables present in the current database
desc(Discription) tablename -Overview table Structure.

Frequently used data types:

Number format :
int(Integer) - Non decimal Numbers.
Float - Decimal Numbers. it supports 6 to 7 decimal digits.
double - Decimal Numbers. it supports upto 14 to 15 decimal digits.

String datatypes:
Char(Character) - Fixed Length
Varchar - Variable length.

Date and Time:


Date - We can store Dates. format: yyyy-mm-dd
datetime -format: yyyy-mm-dd hh-mi-se
year - format yyyy or yy

SQL consists of several types of Statements:


1)DDL - Data Definition Language -It deals only Structures,Not Data.
2)DML - Data Manipulation Language -It Deals About Information Stored in tables.
3)DCL - Data Control Language -Grant and Revoke
4)TCL - Transaction Control Language -Rollback,commit,savepoint.

DDL Commands :
-create
-alter
-rename
-drop
-truncate

Create Command:
database:
create database databasename;
table:
create table tablename(column1 datatype,column2 datatype,.........);
example:
create table student(student_id int,student_name
varachar(20),student_percentage float);

Alter Command:
1.Adding Column in Existing table.
alter table tablename add column columnname datatype;
Ex:alter table student add column student_age int;
2.drop column.
alter table tablename drop column columnname;
Ex:alter table student drop student_percentage;
3.Modify Column Datatype.
alter table tablename modify column columnname datatype;
Ex:alter table student modify column student_id varchar(20);
4.rename column.
alter table tablename rename column oldcolumnname to newcolumnname;
Ex: alter table student rename column student_name to stu_name;

Rename Command:
rename table oldtablename to newtablename;
Ex: rename table student to student_details;

You might also like