![]() |
|||
Database Management System
By: rekha singh | 29 Apr 2010 12:18 pm
Database Management System
DBMS example
Tables
Queries
Structured Query Language
Data Definition Language
create database payroll
![]() ![]() e.g. 2 To create a table employee with following fields
Field Name Data Type
Empid Integer
Empname Text
Age Integer
Salary integer
create table employee (Empid int,Empname varchar(50), age int, salary int);
![]() USE
e.g. we want to select payroll database
USE payroll;
Drop
Data Manipulation Language (DML)
Insert statement is used to insert records into a database.
e.g. To insert a record into the above created table employee
insert into employee values (001,'Saman Silva', 34,12000);
SELECT
Allow database users to retrieve the specific information they desire from an operational database. Consider the above create table with sample data
Empid Empname Age Salary
001 Saman Silva 34 12000
002 Kamal Perera 30 20000
003 Mala Fernando 26 10000
Retrieve all the records
select * from employee
Retrieve employees whose salary is greater than 15000
select * from employee where salary>15000
Find the employee name whose empid is 003
select empname from employee where empid=003
|

.jpg)
.jpg)
.jpg)