尊敬的 微信汇率:1円 ≈ 0.046166 元 支付宝汇率:1円 ≈ 0.046257元 [退出登录]
SlideShare a Scribd company logo
ACROPOLIS INSTITUTE OF TECHNOLOGY &
RESEARCH
Basic Command of DBMS
Ayushi Goyal
COMMANDS
 Create command : This command is used to
create table in database. Created table is also
called Base Table. This table has independent
existence. It is a physical part of data base.
When we create a table then first we determine
the name of table and after that we define its
fields. In field definition we also determine the
data type and its size.
Syntax : Create table <table-name> (column-
name datatype(size),……….);
Ex : create table employee (id number(8,0),
name varchar2(50), dept char(15), salary
 Alter command : This command is used to
modify the structure of table. It can add new field
in a table and it can also modify the field of table.
Syntax : Alter table <table-name> add/modify
(column-name datatype);
Ex: 1.Alter table emp add (address
varchar2(50));
2. Alter table emp modify (name varchar2(25));
 Following task cannot be performed by this
command
1. Change the name of table.
2. Change the name of column.
3. Drop a column.
 Deleting a column from a table : We can also
delete the column of any table. To delete the
column we merge alter and drop command in
a single statement.
Syntax : Alter table <table-name> drop
column <column-name>;
Ex: Alter table emp Drop column address;
 Renaming tables : In Oracle we can change
the name of table object. But it is not possible
by alter command. To change the name of
table we use rename command.
Syntax : Rename <old-table> to <new-table>;
Ex: Rename employee to emp;
 Destroying tables : we can delete the table of
database permanently. For delete the table we use
Drop command .
Syntax : Drop table <table-name>;
Ex. : Drop table employee;
 Truncating tables : In database we can empty any
table completely. To delete all records of table
permanently we can use truncate command.
Syntax : Truncate table <table-name>;
Ex. : Truncate table employee;
 There are some difference between delete and
truncate command.
1. This command drop the table and recreate the table
2. Truncate operations are not transaction safe. An error
occur if an active transaction or table lock exist
3. The no. of deleted rows are not returned.
 Displaying structure of table : To display the
structure of any table, we use describe or desc
command.
Syntax : describe or desc <table-name>;
Ex : desc employee;
 Inserting data into tables : In oracle after create a
table we can insert new data or record in a table.
To enter the data in a table we use insert
command. By this command we can
1. Creates a new row in the database table.
2. Loads the values passed into the columns
specified.
Syntax :insert into <table-name> (column-
name1, column-
name2)values(<expression1>,expression2>);
Ex. : Insert into employee (id,name,dept,salary)
values (1001,’Amit’,’Computer’,23456.35);
Ex:Insert into employee values(&id, &name,
&salary);
 Delete data from table: In oracle we can delete
data from table by using delete command. By
this command we can delete some records of
table and we can also delete all records from
table.
Syntax : 1. delete from <table-name>;
This command will delete all records from table.
Syntax : 2. delete from <table-name> where
<conditions>;
Ex : delete from employee where name=‘amit’;
This command will delete set of records from
table or it can also delete single from a table.
 Updating the contents of table : In oracle we
can update or modify the table by using
update command. This command can update
all rows of table or in can also update some
special records of table.
Syntax : Update <table-name> set <column-
name> = <expression>;
Ex : Update emp set salary = salary +2000;
Syntax : Update <table-name> set <column-
name> = <expression> where <conditions>;
This command will update table conditionally.
Ex : Update emp set salary = salary +2000
where id =1002;
 Display records of table : In any table we can
store records and we can also display these
records in different-2 format. To display or select
records from table we use Select command. We
can display these records by so many types.
1. Display all records of table with all columns.
Syntax : select * from <table-name>;
Ex : select * from employee;
2. Display set of records. (all column & all
records.)
Syntax : select * from employee where
<condition>;
Ex : select * from employee where salary
3. Display some columns and all records
syntax : Select column1, column2, column3
from <table-name>;
Ex : select id, name, dept from employee;
4. Display some columns and some records.
syntax : Select column1, column2, column3
from <table-name> where <conditions>;
Ex : select id, name, dept from employee where
dept=‘computer’;
5. Eliminating duplicate rows when using a select
statement. (distinct)
syntax : Select distinct <column-name> from
<table-name> ;
Ex : select distinct name from employee;
we can also use conditions with this statement.
6. Sorting data in a table (order by).
Syntax : select * from <table-name> order by
<column-name>;
Ex: select * from employee order by salary;
(It will display records in ascending order.)
Ex: select * from employee order by name
desc;
(It will display records in descending order.)
7. Logical operator (and, or, not)
Syntax : select * from <table-name> where
<condition1> an <condition2>;
Ex : select * from employee where
name=‘ankit’ and salary>20000;
Ex : select * from employee where id=1004 or
salary=20000;
8. Between operator
Syntax : select * from <table-name> where
between <expression1> and
<expression2>;
Ex : select * from employee where salary
between 20000 and 40000;
9. Pattern matching (%, _) : These characters
are used to match the character. Here %
represents the all characters. For ex. A%
will represent those strings which will start
from “A”.
Similarly (_) represents a single character.
For ex. Ami_ will represent those strings
whose length will be 4 and after “Ami” there
Ex : Select * from employee where name like
‘S%’ Now this statement will display those
records In which name will start from “S”.
Ex : Select * from employee where name like
‘Ra ----’;
Now this statement will display those records
In which the length of name will be 6 and first
character will be “Ra”.
10. IN : it is used to select the list of values.
Syntax : select * from <table-name>
where<cond.>;
Ex: select * from emp where salary in
(12000,20000);
Ex. : select * from emp1 where name in
(‘amit’,’anil’);
we can also use not keyword with in
operator.
11. Null value : In any column of table we can
check the null value. We can check it with
string or numeric value.
Syntax : select * from <table-name>
where <column-name> is Null;
Ex : select * from emp where name is
Null;
1. Creating a table from another table : In
oracle we can create new table from another
table. This means we can copy the data of
an existing table in a new table. Or we can
say that we can select some data of any
table and it can paste in new table.
Syntax: create table <table> (column-name1,
column-name2,….) as select column-name1,
column-name2,…. From <table>;
Ex.: 1. create table emp1 (reg_no, name) as
select id, name from employee;
2. create table emp1 as select * from
employee where salary>20000;
2. Inserting data into a table from another table
:
Normally by insert command we can store
only 1 record at a time. Buy now we can
select so many record from any table and
then we can insert these records in existing
table.
Syntax : Insert into <table-name> select
column-name1,column-name2,…. From
<table> where <conditions>;
Ex : 1. insert into employee select * from
emp1 where age >21;
 Create table
Employee(id(6), name(15), dept(10),
address(50), salary(10))
Student(roll(5), name(15), dob, total(4),
percentage(5))
1. Add new field “age” in employee table and
“address” in student table.
2. Modify the field size of name from 15 to 20
in both table.
3. Drop dob column from student table.
4. Rename student to stud.
5. Display the structure of both table.
6. Insert 7 records in both table.
7. Enter percentage value through update
command.
8. 10% Increment in salary of all employee .
9. Increment 3000 in salary of those employee
whose department is “computer”
10. display all records of employee and student.
11. display all records of student whose
percentage is greater then 67.
12. Display all records of employee whose salary
is greater then 20000.
13. Display id, name, address and salary of all
employee.
14. display roll, name , address and total of those
students whose percentage between 55 to 75.
15. Display records of those employee whose
name starts from “d” or salary >15000.
16. Display records of those student whose the
length of name is 7.
17. Display records of student in ascending order
according to “percentage”.
18. Display records of employee in descending
order according to salary.
19. Delete records of those students whose
percentage is less then 40.
20. Delete records of those employee whose age
is less then 18.

More Related Content

What's hot

Chapter9 more on database and sql
Chapter9 more on database and sqlChapter9 more on database and sql
Chapter9 more on database and sql
KV(AFS) Utarlai, Barmer (Rajasthan)
 
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasad
paddu123
 
Les10 Creating And Managing Tables
Les10 Creating And Managing TablesLes10 Creating And Managing Tables
Data Definition Language (DDL)
Data Definition Language (DDL) Data Definition Language (DDL)
Data Definition Language (DDL)
Mohd Tousif
 
Database Systems - SQL - DDL Statements (Chapter 3/2)
Database Systems - SQL - DDL Statements (Chapter 3/2)Database Systems - SQL - DDL Statements (Chapter 3/2)
Database Systems - SQL - DDL Statements (Chapter 3/2)
Vidyasagar Mundroy
 
WEB TECHNOLOGIES Unit 2
WEB TECHNOLOGIES Unit 2WEB TECHNOLOGIES Unit 2
WEB TECHNOLOGIES Unit 2
madhusrinivasan9
 
Database object, sub query, Join Commands & Lab Assignment
Database object, sub query, Join Commands & Lab AssignmentDatabase object, sub query, Join Commands & Lab Assignment
Database object, sub query, Join Commands & Lab Assignment
Arun Sial
 
Oracle: DDL
Oracle: DDLOracle: DDL
Oracle: DDL
DataminingTools Inc
 
ORACLE NOTES
ORACLE NOTESORACLE NOTES
ORACLE NOTES
Sachin Shukla
 
SQL Tutorial for Beginners
SQL Tutorial for BeginnersSQL Tutorial for Beginners
SQL Tutorial for Beginners
Abdelhay Shafi
 
MySQL partitions tutorial
MySQL partitions tutorialMySQL partitions tutorial
MySQL partitions tutorial
Giuseppe Maxia
 
SQL Functions and Operators
SQL Functions and OperatorsSQL Functions and Operators
SQL Functions and Operators
Mohan Kumar.R
 
Oracle: DML
Oracle: DMLOracle: DML
Oracle: DML
DataminingTools Inc
 
Structured query language constraints
Structured query language constraintsStructured query language constraints
Structured query language constraints
Vineeta Garg
 
Database Oracle Basic
Database Oracle BasicDatabase Oracle Basic
Database Oracle Basic
Kamlesh Singh
 
Sql
SqlSql
Sql
ftz 420
 
Oracle Sql & PLSQL Complete guide
Oracle Sql & PLSQL Complete guideOracle Sql & PLSQL Complete guide
Oracle Sql & PLSQL Complete guide
Raviteja Chowdary Adusumalli
 

What's hot (17)

Chapter9 more on database and sql
Chapter9 more on database and sqlChapter9 more on database and sql
Chapter9 more on database and sql
 
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasad
 
Les10 Creating And Managing Tables
Les10 Creating And Managing TablesLes10 Creating And Managing Tables
Les10 Creating And Managing Tables
 
Data Definition Language (DDL)
Data Definition Language (DDL) Data Definition Language (DDL)
Data Definition Language (DDL)
 
Database Systems - SQL - DDL Statements (Chapter 3/2)
Database Systems - SQL - DDL Statements (Chapter 3/2)Database Systems - SQL - DDL Statements (Chapter 3/2)
Database Systems - SQL - DDL Statements (Chapter 3/2)
 
WEB TECHNOLOGIES Unit 2
WEB TECHNOLOGIES Unit 2WEB TECHNOLOGIES Unit 2
WEB TECHNOLOGIES Unit 2
 
Database object, sub query, Join Commands & Lab Assignment
Database object, sub query, Join Commands & Lab AssignmentDatabase object, sub query, Join Commands & Lab Assignment
Database object, sub query, Join Commands & Lab Assignment
 
Oracle: DDL
Oracle: DDLOracle: DDL
Oracle: DDL
 
ORACLE NOTES
ORACLE NOTESORACLE NOTES
ORACLE NOTES
 
SQL Tutorial for Beginners
SQL Tutorial for BeginnersSQL Tutorial for Beginners
SQL Tutorial for Beginners
 
MySQL partitions tutorial
MySQL partitions tutorialMySQL partitions tutorial
MySQL partitions tutorial
 
SQL Functions and Operators
SQL Functions and OperatorsSQL Functions and Operators
SQL Functions and Operators
 
Oracle: DML
Oracle: DMLOracle: DML
Oracle: DML
 
Structured query language constraints
Structured query language constraintsStructured query language constraints
Structured query language constraints
 
Database Oracle Basic
Database Oracle BasicDatabase Oracle Basic
Database Oracle Basic
 
Sql
SqlSql
Sql
 
Oracle Sql & PLSQL Complete guide
Oracle Sql & PLSQL Complete guideOracle Sql & PLSQL Complete guide
Oracle Sql & PLSQL Complete guide
 

Viewers also liked

Sql Authorization
Sql AuthorizationSql Authorization
Sql Authorization
Fhuy
 
MYSQL Aggregate Functions
MYSQL Aggregate FunctionsMYSQL Aggregate Functions
MYSQL Aggregate Functions
Leroy Blair
 
DBMS : Relational Algebra
DBMS : Relational Algebra DBMS : Relational Algebra
DBMS : Relational Algebra
Sridhar Baithi
 
From crash to testcase
From crash to testcaseFrom crash to testcase
From crash to testcase
Roel Van de Paar
 
Data integrity Dbms presentation 12 cs 18
Data integrity Dbms presentation 12 cs 18Data integrity Dbms presentation 12 cs 18
Data integrity Dbms presentation 12 cs 18
Engr Imran Ashraf
 
Nested Queries Lecture
Nested Queries LectureNested Queries Lecture
Nested Queries Lecture
Felipe Costa
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
Vraj Patel
 
3 data modeling using the entity-relationship (er) model
3 data modeling using the entity-relationship (er) model3 data modeling using the entity-relationship (er) model
3 data modeling using the entity-relationship (er) model
Kumar
 
Data model and entity relationship
Data model and entity relationshipData model and entity relationship
Data model and entity relationship
Knowledge Center Computer
 
Dbms ii mca-ch5-ch6-relational algebra-2013
Dbms ii mca-ch5-ch6-relational algebra-2013Dbms ii mca-ch5-ch6-relational algebra-2013
Dbms ii mca-ch5-ch6-relational algebra-2013
Prosanta Ghosh
 
SQL Data Manipulation
SQL Data ManipulationSQL Data Manipulation
SQL Data Manipulation
khalid alkhafagi
 
Enhanced Entity-Relationship (EER) Modeling
Enhanced Entity-Relationship (EER) ModelingEnhanced Entity-Relationship (EER) Modeling
Enhanced Entity-Relationship (EER) Modeling
sontumax
 
T-SQL Overview
T-SQL OverviewT-SQL Overview
T-SQL Overview
Ahmed Elbaz
 
trigger dbms
trigger dbmstrigger dbms
trigger dbms
kuldeep100
 
SQL Views
SQL ViewsSQL Views
SQL Views
Aaron Buma
 
Er & eer to relational mapping
Er & eer to relational mappingEr & eer to relational mapping
Er & eer to relational mapping
saurabhshertukde
 
ER Model in DBMS
ER Model in DBMSER Model in DBMS
ER Model in DBMS
Kabindra Koirala
 
Advanced DBMS presentation
Advanced DBMS presentationAdvanced DBMS presentation
Advanced DBMS presentation
Hindustan Petroleum
 
Acid properties
Acid propertiesAcid properties
Acid properties
Abhilasha Lahigude
 
Overview of security in DBMS
Overview of security in DBMSOverview of security in DBMS
Overview of security in DBMS
Vatroslav Mileusnić
 

Viewers also liked (20)

Sql Authorization
Sql AuthorizationSql Authorization
Sql Authorization
 
MYSQL Aggregate Functions
MYSQL Aggregate FunctionsMYSQL Aggregate Functions
MYSQL Aggregate Functions
 
DBMS : Relational Algebra
DBMS : Relational Algebra DBMS : Relational Algebra
DBMS : Relational Algebra
 
From crash to testcase
From crash to testcaseFrom crash to testcase
From crash to testcase
 
Data integrity Dbms presentation 12 cs 18
Data integrity Dbms presentation 12 cs 18Data integrity Dbms presentation 12 cs 18
Data integrity Dbms presentation 12 cs 18
 
Nested Queries Lecture
Nested Queries LectureNested Queries Lecture
Nested Queries Lecture
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
 
3 data modeling using the entity-relationship (er) model
3 data modeling using the entity-relationship (er) model3 data modeling using the entity-relationship (er) model
3 data modeling using the entity-relationship (er) model
 
Data model and entity relationship
Data model and entity relationshipData model and entity relationship
Data model and entity relationship
 
Dbms ii mca-ch5-ch6-relational algebra-2013
Dbms ii mca-ch5-ch6-relational algebra-2013Dbms ii mca-ch5-ch6-relational algebra-2013
Dbms ii mca-ch5-ch6-relational algebra-2013
 
SQL Data Manipulation
SQL Data ManipulationSQL Data Manipulation
SQL Data Manipulation
 
Enhanced Entity-Relationship (EER) Modeling
Enhanced Entity-Relationship (EER) ModelingEnhanced Entity-Relationship (EER) Modeling
Enhanced Entity-Relationship (EER) Modeling
 
T-SQL Overview
T-SQL OverviewT-SQL Overview
T-SQL Overview
 
trigger dbms
trigger dbmstrigger dbms
trigger dbms
 
SQL Views
SQL ViewsSQL Views
SQL Views
 
Er & eer to relational mapping
Er & eer to relational mappingEr & eer to relational mapping
Er & eer to relational mapping
 
ER Model in DBMS
ER Model in DBMSER Model in DBMS
ER Model in DBMS
 
Advanced DBMS presentation
Advanced DBMS presentationAdvanced DBMS presentation
Advanced DBMS presentation
 
Acid properties
Acid propertiesAcid properties
Acid properties
 
Overview of security in DBMS
Overview of security in DBMSOverview of security in DBMS
Overview of security in DBMS
 

Similar to Commands

SQL
SQLSQL
unit-5 sql notes.docx
unit-5 sql notes.docxunit-5 sql notes.docx
unit-5 sql notes.docx
RaviRajput416403
 
My SQL.pptx
My SQL.pptxMy SQL.pptx
My SQL.pptx
KieveBarreto1
 
dbms lab manual
dbms lab manualdbms lab manual
dbms lab manual
stalinjothi
 
Oracle : DML
Oracle : DMLOracle : DML
Oracle : DML
oracle content
 
Sql dml & tcl 2
Sql   dml & tcl 2Sql   dml & tcl 2
Sql dml & tcl 2
Dr. C.V. Suresh Babu
 
Its about a sql topic for basic structured query language
Its about a sql topic for basic structured query languageIts about a sql topic for basic structured query language
Its about a sql topic for basic structured query language
IMsKanchanaI
 
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasad
paddu123
 
Oracle naveen Sql
Oracle naveen   SqlOracle naveen   Sql
Oracle naveen Sql
naveen
 
Oracle naveen Sql
Oracle naveen   SqlOracle naveen   Sql
Oracle naveen Sql
naveen
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functions
farwa waqar
 
Oraclesql
OraclesqlOraclesql
Oraclesql
Priya Goyal
 
Oracle SQL AND PL/SQL
Oracle SQL AND PL/SQLOracle SQL AND PL/SQL
Oracle SQL AND PL/SQL
suriyae1
 
ADBMS unit 1.pdfsdgdsgdsgdsgdsgdsgdsgdsg
ADBMS unit 1.pdfsdgdsgdsgdsgdsgdsgdsgdsgADBMS unit 1.pdfsdgdsgdsgdsgdsgdsgdsgdsg
ADBMS unit 1.pdfsdgdsgdsgdsgdsgdsgdsgdsg
zmulani8
 
Class XII-UNIT III - SQL and MySQL Notes_0.pdf
Class XII-UNIT III - SQL and MySQL Notes_0.pdfClass XII-UNIT III - SQL and MySQL Notes_0.pdf
Class XII-UNIT III - SQL and MySQL Notes_0.pdf
rohithlingineni1
 
Intro to tsql unit 9
Intro to tsql   unit 9Intro to tsql   unit 9
Intro to tsql unit 9
Syed Asrarali
 
ADVANCE ITT BY PRASAD
ADVANCE ITT BY PRASADADVANCE ITT BY PRASAD
ADVANCE ITT BY PRASAD
PADYALAMAITHILINATHA
 
Mysql
MysqlMysql
Mysql
MysqlMysql
Mysql
MysqlMysql

Similar to Commands (20)

SQL
SQLSQL
SQL
 
unit-5 sql notes.docx
unit-5 sql notes.docxunit-5 sql notes.docx
unit-5 sql notes.docx
 
My SQL.pptx
My SQL.pptxMy SQL.pptx
My SQL.pptx
 
dbms lab manual
dbms lab manualdbms lab manual
dbms lab manual
 
Oracle : DML
Oracle : DMLOracle : DML
Oracle : DML
 
Sql dml & tcl 2
Sql   dml & tcl 2Sql   dml & tcl 2
Sql dml & tcl 2
 
Its about a sql topic for basic structured query language
Its about a sql topic for basic structured query languageIts about a sql topic for basic structured query language
Its about a sql topic for basic structured query language
 
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasad
 
Oracle naveen Sql
Oracle naveen   SqlOracle naveen   Sql
Oracle naveen Sql
 
Oracle naveen Sql
Oracle naveen   SqlOracle naveen   Sql
Oracle naveen Sql
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functions
 
Oraclesql
OraclesqlOraclesql
Oraclesql
 
Oracle SQL AND PL/SQL
Oracle SQL AND PL/SQLOracle SQL AND PL/SQL
Oracle SQL AND PL/SQL
 
ADBMS unit 1.pdfsdgdsgdsgdsgdsgdsgdsgdsg
ADBMS unit 1.pdfsdgdsgdsgdsgdsgdsgdsgdsgADBMS unit 1.pdfsdgdsgdsgdsgdsgdsgdsgdsg
ADBMS unit 1.pdfsdgdsgdsgdsgdsgdsgdsgdsg
 
Class XII-UNIT III - SQL and MySQL Notes_0.pdf
Class XII-UNIT III - SQL and MySQL Notes_0.pdfClass XII-UNIT III - SQL and MySQL Notes_0.pdf
Class XII-UNIT III - SQL and MySQL Notes_0.pdf
 
Intro to tsql unit 9
Intro to tsql   unit 9Intro to tsql   unit 9
Intro to tsql unit 9
 
ADVANCE ITT BY PRASAD
ADVANCE ITT BY PRASADADVANCE ITT BY PRASAD
ADVANCE ITT BY PRASAD
 
Mysql
MysqlMysql
Mysql
 
Mysql
MysqlMysql
Mysql
 
Mysql
MysqlMysql
Mysql
 

Recently uploaded

Creating Images and Videos through AI.pptx
Creating Images and Videos through AI.pptxCreating Images and Videos through AI.pptx
Creating Images and Videos through AI.pptx
Forum of Blended Learning
 
Accounting for Restricted Grants When and How To Record Properly
Accounting for Restricted Grants  When and How To Record ProperlyAccounting for Restricted Grants  When and How To Record Properly
Accounting for Restricted Grants When and How To Record Properly
TechSoup
 
managing Behaviour in early childhood education.pptx
managing Behaviour in early childhood education.pptxmanaging Behaviour in early childhood education.pptx
managing Behaviour in early childhood education.pptx
nabaegha
 
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
Kalna College
 
Opportunity scholarships and the schools that receive them
Opportunity scholarships and the schools that receive themOpportunity scholarships and the schools that receive them
Opportunity scholarships and the schools that receive them
EducationNC
 
Decolonizing Universal Design for Learning
Decolonizing Universal Design for LearningDecolonizing Universal Design for Learning
Decolonizing Universal Design for Learning
Frederic Fovet
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
Celine George
 
220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology
Kalna College
 
220711130100 udita Chakraborty Aims and objectives of national policy on inf...
220711130100 udita Chakraborty  Aims and objectives of national policy on inf...220711130100 udita Chakraborty  Aims and objectives of national policy on inf...
220711130100 udita Chakraborty Aims and objectives of national policy on inf...
Kalna College
 
Observational Learning
Observational Learning Observational Learning
Observational Learning
sanamushtaq922
 
Library news letter Kitengesa Uganda June 2024
Library news letter Kitengesa Uganda June 2024Library news letter Kitengesa Uganda June 2024
Library news letter Kitengesa Uganda June 2024
Friends of African Village Libraries
 
nutrition in plants chapter 1 class 7...
nutrition in plants chapter 1 class 7...nutrition in plants chapter 1 class 7...
nutrition in plants chapter 1 class 7...
chaudharyreet2244
 
Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17
Celine George
 
IoT (Internet of Things) introduction Notes.pdf
IoT (Internet of Things) introduction Notes.pdfIoT (Internet of Things) introduction Notes.pdf
IoT (Internet of Things) introduction Notes.pdf
roshanranjit222
 
The Science of Learning: implications for modern teaching
The Science of Learning: implications for modern teachingThe Science of Learning: implications for modern teaching
The Science of Learning: implications for modern teaching
Derek Wenmoth
 
What are the new features in the Fleet Odoo 17
What are the new features in the Fleet Odoo 17What are the new features in the Fleet Odoo 17
What are the new features in the Fleet Odoo 17
Celine George
 
How to stay relevant as a cyber professional: Skills, trends and career paths...
How to stay relevant as a cyber professional: Skills, trends and career paths...How to stay relevant as a cyber professional: Skills, trends and career paths...
How to stay relevant as a cyber professional: Skills, trends and career paths...
Infosec
 
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT KanpurDiversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Quiz Club IIT Kanpur
 
Slides Peluncuran Amalan Pemakanan Sihat.pptx
Slides Peluncuran Amalan Pemakanan Sihat.pptxSlides Peluncuran Amalan Pemakanan Sihat.pptx
Slides Peluncuran Amalan Pemakanan Sihat.pptx
shabeluno
 
Keynote given on June 24 for MASSP at Grand Traverse City
Keynote given on June 24 for MASSP at Grand Traverse CityKeynote given on June 24 for MASSP at Grand Traverse City
Keynote given on June 24 for MASSP at Grand Traverse City
PJ Caposey
 

Recently uploaded (20)

Creating Images and Videos through AI.pptx
Creating Images and Videos through AI.pptxCreating Images and Videos through AI.pptx
Creating Images and Videos through AI.pptx
 
Accounting for Restricted Grants When and How To Record Properly
Accounting for Restricted Grants  When and How To Record ProperlyAccounting for Restricted Grants  When and How To Record Properly
Accounting for Restricted Grants When and How To Record Properly
 
managing Behaviour in early childhood education.pptx
managing Behaviour in early childhood education.pptxmanaging Behaviour in early childhood education.pptx
managing Behaviour in early childhood education.pptx
 
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
 
Opportunity scholarships and the schools that receive them
Opportunity scholarships and the schools that receive themOpportunity scholarships and the schools that receive them
Opportunity scholarships and the schools that receive them
 
Decolonizing Universal Design for Learning
Decolonizing Universal Design for LearningDecolonizing Universal Design for Learning
Decolonizing Universal Design for Learning
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
 
220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology
 
220711130100 udita Chakraborty Aims and objectives of national policy on inf...
220711130100 udita Chakraborty  Aims and objectives of national policy on inf...220711130100 udita Chakraborty  Aims and objectives of national policy on inf...
220711130100 udita Chakraborty Aims and objectives of national policy on inf...
 
Observational Learning
Observational Learning Observational Learning
Observational Learning
 
Library news letter Kitengesa Uganda June 2024
Library news letter Kitengesa Uganda June 2024Library news letter Kitengesa Uganda June 2024
Library news letter Kitengesa Uganda June 2024
 
nutrition in plants chapter 1 class 7...
nutrition in plants chapter 1 class 7...nutrition in plants chapter 1 class 7...
nutrition in plants chapter 1 class 7...
 
Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17
 
IoT (Internet of Things) introduction Notes.pdf
IoT (Internet of Things) introduction Notes.pdfIoT (Internet of Things) introduction Notes.pdf
IoT (Internet of Things) introduction Notes.pdf
 
The Science of Learning: implications for modern teaching
The Science of Learning: implications for modern teachingThe Science of Learning: implications for modern teaching
The Science of Learning: implications for modern teaching
 
What are the new features in the Fleet Odoo 17
What are the new features in the Fleet Odoo 17What are the new features in the Fleet Odoo 17
What are the new features in the Fleet Odoo 17
 
How to stay relevant as a cyber professional: Skills, trends and career paths...
How to stay relevant as a cyber professional: Skills, trends and career paths...How to stay relevant as a cyber professional: Skills, trends and career paths...
How to stay relevant as a cyber professional: Skills, trends and career paths...
 
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT KanpurDiversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
 
Slides Peluncuran Amalan Pemakanan Sihat.pptx
Slides Peluncuran Amalan Pemakanan Sihat.pptxSlides Peluncuran Amalan Pemakanan Sihat.pptx
Slides Peluncuran Amalan Pemakanan Sihat.pptx
 
Keynote given on June 24 for MASSP at Grand Traverse City
Keynote given on June 24 for MASSP at Grand Traverse CityKeynote given on June 24 for MASSP at Grand Traverse City
Keynote given on June 24 for MASSP at Grand Traverse City
 

Commands

  • 1. ACROPOLIS INSTITUTE OF TECHNOLOGY & RESEARCH Basic Command of DBMS Ayushi Goyal
  • 2. COMMANDS  Create command : This command is used to create table in database. Created table is also called Base Table. This table has independent existence. It is a physical part of data base. When we create a table then first we determine the name of table and after that we define its fields. In field definition we also determine the data type and its size. Syntax : Create table <table-name> (column- name datatype(size),……….); Ex : create table employee (id number(8,0), name varchar2(50), dept char(15), salary
  • 3.  Alter command : This command is used to modify the structure of table. It can add new field in a table and it can also modify the field of table. Syntax : Alter table <table-name> add/modify (column-name datatype); Ex: 1.Alter table emp add (address varchar2(50)); 2. Alter table emp modify (name varchar2(25));  Following task cannot be performed by this command 1. Change the name of table. 2. Change the name of column. 3. Drop a column.
  • 4.  Deleting a column from a table : We can also delete the column of any table. To delete the column we merge alter and drop command in a single statement. Syntax : Alter table <table-name> drop column <column-name>; Ex: Alter table emp Drop column address;  Renaming tables : In Oracle we can change the name of table object. But it is not possible by alter command. To change the name of table we use rename command. Syntax : Rename <old-table> to <new-table>; Ex: Rename employee to emp;
  • 5.  Destroying tables : we can delete the table of database permanently. For delete the table we use Drop command . Syntax : Drop table <table-name>; Ex. : Drop table employee;  Truncating tables : In database we can empty any table completely. To delete all records of table permanently we can use truncate command. Syntax : Truncate table <table-name>; Ex. : Truncate table employee;  There are some difference between delete and truncate command. 1. This command drop the table and recreate the table 2. Truncate operations are not transaction safe. An error occur if an active transaction or table lock exist 3. The no. of deleted rows are not returned.
  • 6.  Displaying structure of table : To display the structure of any table, we use describe or desc command. Syntax : describe or desc <table-name>; Ex : desc employee;  Inserting data into tables : In oracle after create a table we can insert new data or record in a table. To enter the data in a table we use insert command. By this command we can 1. Creates a new row in the database table. 2. Loads the values passed into the columns specified. Syntax :insert into <table-name> (column- name1, column- name2)values(<expression1>,expression2>);
  • 7. Ex. : Insert into employee (id,name,dept,salary) values (1001,’Amit’,’Computer’,23456.35); Ex:Insert into employee values(&id, &name, &salary);  Delete data from table: In oracle we can delete data from table by using delete command. By this command we can delete some records of table and we can also delete all records from table. Syntax : 1. delete from <table-name>; This command will delete all records from table. Syntax : 2. delete from <table-name> where <conditions>; Ex : delete from employee where name=‘amit’; This command will delete set of records from table or it can also delete single from a table.
  • 8.  Updating the contents of table : In oracle we can update or modify the table by using update command. This command can update all rows of table or in can also update some special records of table. Syntax : Update <table-name> set <column- name> = <expression>; Ex : Update emp set salary = salary +2000; Syntax : Update <table-name> set <column- name> = <expression> where <conditions>; This command will update table conditionally. Ex : Update emp set salary = salary +2000 where id =1002;
  • 9.  Display records of table : In any table we can store records and we can also display these records in different-2 format. To display or select records from table we use Select command. We can display these records by so many types. 1. Display all records of table with all columns. Syntax : select * from <table-name>; Ex : select * from employee; 2. Display set of records. (all column & all records.) Syntax : select * from employee where <condition>; Ex : select * from employee where salary
  • 10. 3. Display some columns and all records syntax : Select column1, column2, column3 from <table-name>; Ex : select id, name, dept from employee; 4. Display some columns and some records. syntax : Select column1, column2, column3 from <table-name> where <conditions>; Ex : select id, name, dept from employee where dept=‘computer’; 5. Eliminating duplicate rows when using a select statement. (distinct) syntax : Select distinct <column-name> from <table-name> ; Ex : select distinct name from employee; we can also use conditions with this statement.
  • 11. 6. Sorting data in a table (order by). Syntax : select * from <table-name> order by <column-name>; Ex: select * from employee order by salary; (It will display records in ascending order.) Ex: select * from employee order by name desc; (It will display records in descending order.) 7. Logical operator (and, or, not) Syntax : select * from <table-name> where <condition1> an <condition2>; Ex : select * from employee where name=‘ankit’ and salary>20000; Ex : select * from employee where id=1004 or salary=20000;
  • 12. 8. Between operator Syntax : select * from <table-name> where between <expression1> and <expression2>; Ex : select * from employee where salary between 20000 and 40000; 9. Pattern matching (%, _) : These characters are used to match the character. Here % represents the all characters. For ex. A% will represent those strings which will start from “A”. Similarly (_) represents a single character. For ex. Ami_ will represent those strings whose length will be 4 and after “Ami” there
  • 13. Ex : Select * from employee where name like ‘S%’ Now this statement will display those records In which name will start from “S”. Ex : Select * from employee where name like ‘Ra ----’; Now this statement will display those records In which the length of name will be 6 and first character will be “Ra”. 10. IN : it is used to select the list of values. Syntax : select * from <table-name> where<cond.>; Ex: select * from emp where salary in (12000,20000);
  • 14. Ex. : select * from emp1 where name in (‘amit’,’anil’); we can also use not keyword with in operator. 11. Null value : In any column of table we can check the null value. We can check it with string or numeric value. Syntax : select * from <table-name> where <column-name> is Null; Ex : select * from emp where name is Null;
  • 15. 1. Creating a table from another table : In oracle we can create new table from another table. This means we can copy the data of an existing table in a new table. Or we can say that we can select some data of any table and it can paste in new table. Syntax: create table <table> (column-name1, column-name2,….) as select column-name1, column-name2,…. From <table>; Ex.: 1. create table emp1 (reg_no, name) as select id, name from employee; 2. create table emp1 as select * from employee where salary>20000;
  • 16. 2. Inserting data into a table from another table : Normally by insert command we can store only 1 record at a time. Buy now we can select so many record from any table and then we can insert these records in existing table. Syntax : Insert into <table-name> select column-name1,column-name2,…. From <table> where <conditions>; Ex : 1. insert into employee select * from emp1 where age >21;
  • 17.  Create table Employee(id(6), name(15), dept(10), address(50), salary(10)) Student(roll(5), name(15), dob, total(4), percentage(5)) 1. Add new field “age” in employee table and “address” in student table. 2. Modify the field size of name from 15 to 20 in both table. 3. Drop dob column from student table. 4. Rename student to stud. 5. Display the structure of both table.
  • 18. 6. Insert 7 records in both table. 7. Enter percentage value through update command. 8. 10% Increment in salary of all employee . 9. Increment 3000 in salary of those employee whose department is “computer” 10. display all records of employee and student. 11. display all records of student whose percentage is greater then 67. 12. Display all records of employee whose salary is greater then 20000. 13. Display id, name, address and salary of all employee.
  • 19. 14. display roll, name , address and total of those students whose percentage between 55 to 75. 15. Display records of those employee whose name starts from “d” or salary >15000. 16. Display records of those student whose the length of name is 7. 17. Display records of student in ascending order according to “percentage”. 18. Display records of employee in descending order according to salary. 19. Delete records of those students whose percentage is less then 40. 20. Delete records of those employee whose age is less then 18.
  翻译: