DBMS Lab Report
DBMS Lab Report
DBMS Lab Report
Introduction to SQL
Pronounced as SEQUEL: Structured English QUERY Language
Pure non-procedural query language
Designed and developed by IBM, Implemented by Oracle
1978 System/R IBM- 1st Relational DBMS
1979 Oracle and Ingres
1982 SQL/DS and DB2 IBM
Accepted by both ANSI + ISO as Standard Query Language for any RDBMS
SQL86 (SQL1) : first by ANSI and ratified by ISO (SQL-87), minor revision on 89
(SQL-89)
SQL92 (SQL2) : major revision
SQL99 (SQL3) : add recursive query, trigger, some OO features, and non-scholar type
SQL2003 : XML, Window functions, and sequences (Not free)
Supports all the three sublanguages of DBMS: DDL, DML, DCL
Supports Aggregate functions, String Manipulation functions, Set theory operations, Date
Manipulation functions, rich set of operators ( IN, BETWEEN, LIKE, IS NULL,
EXISTS)
Supports REPORT writing features and Forms for designing GUI based applications
Data Definition in SQL
CREATE, ALTER and DROP
table…………………………………….……relation
row……………………………………..…….tuple
column………………………………….……attribute
DATA TYPES
Numeric: NUMBER, NUMBER(s,p), INTEGER, INT, FLOAT, DECIMAL
Character: CHAR(n), VARCHAR(n), VARCHAR2(n), CHAR VARYING(n)
Bit String: BLOB, CLOB
Boolean: true, false, and null
List of Contents
1. Draw E-R diagram and convert entities and relationships to relation table for a given scenario.
a. Two assignments shall be carried out i.e. consider two different scenarios (eg. bank,
college)
Database.
5. For a given set of relation schemes, create tables and perform the following
Simple Queries, Simple Queries with Aggregate functions, Queries with Aggregate
functions (group by and having clause), Queries involving- Date Functions, String
a. Creating Views (with and without check option), Dropping views, Selecting from a
view