Assignment # 1: Data Warehousing & Data Mining

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

1 Oct 2018

ASSIGNMENT # 1
Data Warehousing & Data Mining

SECTION – S

SUBMITTED BY:
Sabeel Butt
BSSE02161053

SUBMITTED TO:
Dr Faiza Iqbal
1 Oct 2018

Question No 1
Explain the followings with example.
According to the ANSI standard every SQL language has some classified set of statements, irrespective of the
database tool like SQL server, Oracle or my SQL. These statements are classified into different types of
languages. Following are defined the database languages.

1. DML
It Stands for Data Manipulation Language.
Data is manipulated or modified in this language. DML statements affect records in a table. It has two types
Procedural DML and Non-Procedural DML.

Example:
Insert – It used to insert data for one or more rows in a Table.
E.g. inserting grades of Student in online result

Update– It is used to update the existing data in the Table.


E.g. update a row or multiple rows or columns.

Delete –It is used to delete one or more rows form a Table/record.


E.g. a particular student leaves the school so to delete his record form the Student database.

Select – It is used to retrieve one or more rows from a Table or View.


E.g. to get a grade and percentage column form the result Table.

2. DCL
It stands for Data Control Language.
It controls whether the access of data stored in database will be provided to the user or not. A Database
Administrator (DBA) has control rights over the data. DCL statements are used to provide data security.

Example:
Grant – It is used to grant access rights to other user.
E.g. if a user is granted just to select Table he cannot delete or modify data, he can only select data.

Revoke – It is used to take the access back from the user.


E.g. For some reason the security of database needs to be strong so a DBA can remove a previously granted
access.

These two commands of DCL control the level of access that is given to the user.
1 Oct 2018

3. DDL
It Stands for Data Definition Language.
It defines the database schema. The data is stored in the form of relational tables in databases so the DDL
statements are used to create, alter and drop the existing database objects. Objects are the table, views, store
procedure and functions.

Example:
Basic DDL commands
Create – It is used to create Table, View, Procedure, Function and other database objects.
E.g. a Table of employee payroll is created.

Alter – It is used to modify the schema of the database.


E.g. add, delete or change the data type of column.

Drop – It is used to delete database and Tables.


E.g. drop the Table and Views.

Rename – It is used to change the name of a Table, view or sequence.


E.g. used for renaming Table name from Student record to Student result.

__________

You might also like