Table of Contents
SQL allows as a method to a combine more than one tables for processing the field we can update view and delete the information for multiple with a common field.
select std.roll, std name, abc.fee from std,ABC where std.roll=abc.roll
Nested query-> It is a way to range the queries into a nested format the inner query executed at the first time and the outer query of the base of its inner query.
select name from std where the name in 1 select name from std where marks=90;
It is a way to combine the table and its records with union commands. In this method, the output generates all record with repetition.
select from abc union select from std
It is used to combine two table and display common records.
->select roll from abc inter-set select from std
It is used to filter the content from the table and display two records which are not available another table.
->select roll from abc minus select from std
It is a command that allows to create the sequence with a particular value and define starting and ending value.
create sequence name increment value start with the value maximum value and minimum value.
create sequence abc increment by 1 star with 100
It is a command that allows deleting command the table
example->Drop abc table name
NULL value in SQL
It is used to find out the blank record from the table.
select*from abc where the name is NULL.
It is a way to define the SQL command into the program as programming instructions. The programming language like c++, java etc use into the system for developing the software and use SQL command for processing the records. The instructions are defined into the programming known as embedded SQL.
Cursor in SQL
SQL allows as a method to combine multiple commands for executing in a separate area that is known as a cursor. We define the name of the private area and execute the instruction.
Implicit cursor-> It is the type of cursor that automatically define in the database application and allow to execute commands. The cursor is declared implicitly for data manipulation.
Explicitly cusor-> It is the cursor that defines the user for managing the SQL command by defining a block with exec.. end exec for declare the user define a cursor.
Open statement-> It is a cursory statement that opens the cursor for executing the quarter.
Fetch statement-> It is a statement that read the rows from the existing cursor and allows to manage its queries output. Qe define the variable to hold the cursor data.
Close statement-> It is a statement that allows closing the cursor processing.
Example:- close<cursor command>
It is a command that allows defining the permission to the different user on the base of designation SQL provide a technique to define the privileges to a different user of discs command.
Syntax: Grant Relational name or all on object or username or public[with grant option]
Privileges name-> here we define the action for data processing like insert, delete, example all-> select, etc all-> here we define all keyword for all privileges.
Object-> here we define the table name for executing the action.
User-> here we define the username for granting the permission.
Public-> It is used all existing user.
With grant option-> It is used to sign permission to another user with the same privilege.
grant select on table to anna with grant option
It is a command that allows removing privilege. In this, we also define the privileges and it’s permission.
Syntax: Revoke relation name or all an object from user or public.
example-> Revike select the table from Anna.
The view is similar to a table that holds the information as rows and columns. It is basically used to control the data records as view format. We can easily update the main table with its view table within this we can store particular data for processing and filter from the main table with a particular condition.
Syntax: create ciew<view name>as [record]
Example:-create view abc as select Roll, Name from anna
Note:- we can control the view with a similar command of the table.
Structure query language allows as a process to define the instruction and command as programming syntax. It provides a different format for defining the instruction of SQL and execute them. The SQL command can manage and use the programming instruction as condition, looping etc
It provides different methods like processor, function, trigger, and cursor.