DBMS L1 - Lab
DBMS L1 - Lab
Systems
LAB – 1 & 2
By
Dr. Priyambada Subudhi
Assistant Professor
SQL
■ SQL is Structured Query Language, which is a computer language for storing, manipulating and
■ SQL is the ANSI/ISO standard language for Relational Database Management Systems (RDBMS).
■ RDBMS: A database management system that manages data as a collection of tables. This table is
basically a collection of related data entries and it consists of numerous columns and rows.
■ Although, there are different versions of the SQL language (T-SQL, PL/SQL, JET SQL) , however,
to be compliant with the ANSI standard, they all support at least the major commands.
■ All RDBMS like MySQL, MS Access, Oracle, Sybase, Informix, Postgres and SQL Server use SQL as
SELECT
1
Retrieves certain records from one or more tables.
INSERT
2
Creates a record.
UPDATE
3
Modifies records.
DELETE
4
Deletes records.
Sample SQL Datatypes
Create Table Construct
▪ An SQL relation is defined using the create table command:
▪ CREATE TABLE table_name (
column1 datatype,
…….
columnN datatype,
(integrity-constraint1),
...,
(integrity-constraintk));
▪ table_name is the name of the table
▪ each columnI is an attribute name in the table table_name
▪ datatype is the data type of values in the domain of attribute columnI
▪ Example:
CREATE TABLE Instructor (
ID int,
name varchar2(30),
dept_name varchar2(20),
salary int);
Describe structure of a Table
• The structure of a table can be viewed using DESCRIBE or DESC command.
• Syntax: DESCRIBE table_name;
or
DESC table_name;