Beruflich Dokumente
Kultur Dokumente
Query language includes a set of commands used in retrieving data from (or modifying or
updating) a database. Query languages are used to make queries into databases.
broadly, Query languages can be classified according to whether they are database query
languages or information retrieval query languages.
Structured query Language
SQL is a database sublanguage for querying and modifying relational databases. It was developed by IBM
Research in the mid 70's and standardized by ANSI in 1986.
Major Features:
Queries typed at an SQL prompt.
SQL is a non-procedural language.
SQL specifies WHAT, not HOW.
It is not case sensitive.
Pure SQL is good for.
(i) defining database structure; (h) generating low-volume, ad hoc queries (w) prototyping
Sophisticated applications are often implemented by using SQL in combinations with a programming
language.
Embedded SQL
SQL can be embedded within procedural programming languages,
These languages may include C/C++, Java etc.
Embedded SQL supports:
Highly customised applications.
Background applications running without user intervention.
Combining database took with programming tools.
Databases on the WWW.
1
SQL Statements
There are 3 basic categories of SQL Statements:
SQL-Data Statements - query and modify tables and columns
>SELECT Statement - query tables and views in the database
> INSERT Statement - add rows to tables >UPDATE Statement - modify columns in table rows
>DELETE Statement - remove rows from tables
SQL Statements (contd.)
SQL-Transaction Statements - control transactions
>COMMIT Statement - commit-the current transactions
Roll back Statement - roll back the current transactions
SQL Statements (contd.)
SQL-Schema Statements ~ maintain schema (catalog)
>CREATE TABLE Statement - create tables
>CREATE VIEW Statement - create views
>DROP TABLE Statement - drop tables
>DROP VIEW Statement - drop views
>GRANT Statement - grant privileges on tables and views to other users
> REVOKE Statement - revoke privileges on tables and views from other users
DDLDCL& DML
SQL is divided into three main categories; Data Definition Language (DDL), Data Control Language and
Data Manipulation Language (DML).
Examples of DDL commands
CREATE DATABASE - Creates a new database
These are just some of the object classes that can be defined using DDL
Examples of DCL commands
DML is a language for accessing and manipulating the data organized by the appropriate data model.
A data repository which stores integrated information for efficient querying, analysis and
reporting.
Heterogeneous data transformed and combined into homogenous data, typically summarized
Forecasting
Operational database
it holds read-only data.
Operational databases include
Updated periodically
Four Keywords:
Subject-oriented: Organized around major subjects such as customer, supplier, product, sales
etc. vis-a-vis Application oriented for DBMS, to provide concise view around particular subject issue
Static/Non-volatile: Usually read-only, updated or refreshed periodically, separated from operational
db
integrated: data from multiple disparate sources are transformed and combined in a separate
data repository
Time variant: Stores historical data, used to analyze the business or market trends and facilitate
future predictions. Every key structure in data warehouse contains, either explicitly or Implicitly, an
element of time
Data Warehouse
Repository of information
Data cleaning
Data Transformation
integration
Data Loading
4
Periodic Refreshing
Extracting or Mining knowledge from large data set to find patterns that art
valid: hold on new data with some certainty novel: non-obvious to the system
useful: should be possible to act on the item understandable: humans should be able to
interpret the pattern
Example
Fraudulent usage of credit cards - detect purchase of extremely large' amount compared to
regular purchases
Applications
Targeted marketing
Scientific data analysis: identify new galaxies by searching for sub clusters
Web site/store design and promotion: find affinity of visitor to pages and modify layout
5
Relational Database
Data Warehouse
Flat files
Web
Transaction Database
The algorithms examine the data and determine a model that is a closest to the characteristics
of the data being examined
Regression
Classification
Summarization
Sequence Discovery