Skip to main content

Posts

Showing posts with the label Structured query language

Structured query language,SQL Query Processing

Structured query language The common commands and methods used in it are grouped into the following categories: Data Definition Language (DDL), Data Manipulation Language (DML), Data Control Language (DCL), Logical Connectors, Comparison operators, Aggregate functions, Joins, Sub query, Relational operators, Where clause etc. Data definition language covers SQL commands that create and destroy database tables. Data manipulation language covers SQL commands that create, change or destroy the information in a database table or the structure of the table. Data control language covers protection to the database such as granting access to the tables. Comparison operators cover those operators that allow for comparison between two items. Aggregate function deals with those standard SQL functions that allow programmers to narrow the search of a database. Joins category covers those items that allow information from two or more tables to be related. SQL Query Processing ...

Example of PL/Sql for monthly sales

declare start_date date; end_date date; begin select min(sales_date),max(sales_date) into start_date, end_date from t1; for start_date <= end_date loop Insert Into t1 (ShopName , sales_Date, Sales) Select t2.ShopName , nvl(t1.sales_Date,start_date), nvl(t1.Sales,0) From t1, t2 Where t1.sales_Date=start_date; start_date:=start_date+1; end loop; end;