Month: July 2014

VARIABLES AND EXPRESSIONS

Posted on

USEFULL FOR TYBSC (IT) & TYBSC (CS) STUDENTS

VARIABLES AND EXPRESSIONS:

  • A variable is an identifier that denotes a storage location in memory. It stores numeric

or string values that might change during the program execution.

  • A  variable may  take  different  values  at  different  times  during  the  execution  of  a program but the name of the variable always remains same.
  • A variable is one of the language elements in C# language expressions. An expression is a collection of different language elements that are used to perform a specific task, for example calculation of number.
  • To use expressions, C# provides a complete set of language elements, which are given

as follows:-

i)  Identifiers

ii)  Keywords

iii) Variables

iv) Constants

v)  Data types

vi) Operators 

i)  Identifiers

  •  In  C#,  an  identifier  is  a  name  given  to  a  variable,  constant  or  any  user-defined programming element.
  •  Rules for naming an identifier- An identifier starts with a letter or an underscore and ends with a character.
  •  Identifier are case sensitive-firstname, FirstName, FIRSTNAME are different.
  •  An identifier can have letters, digits and underscores.
  •  An identifier must not be a reserved word.
  •  An identifier must be a complete word without any blank spaces.

ii)  Keywords

  •  Keywords are the reserved words whose meanings are predefined to the C# compiler used for a specific task.
  •  Keywords cannot  use  as  variable,  methods  and  properties  because  they  are  already defined to the compiler to perform specific functionalities.
  •  For example:-class, public, throw, for, while.

iii) Variables

  • Variable  has  a  data  type  that  determines  the  type  of  values that  can  be  stored  in  a variable.
  •  For example : int i;//declaration  i=20;//initialization
  •  A variable can be declared as local or class variable
    • Local variables exist within the scope of a given method in a class
    • Class variables exist for the entire life time of the object instance of a class.
  • Class variables can be used in any method of a class and can be public, private or protected.

iv) Constants

  • Constant is used to store a value  The value of constant does not change during the execution of a program and if tried to assign another value to a constant and compiled then it will display error showing that the left hand side assignment must be a variable, property, or indexer.
  •  A variable is declared as constant using the const keyword.
  •  For example :const int PI=3.14

v)  Data types

  •  C#  supports a  rich  and  varied  selection  of  data  types,  from  built-in  types,  such  as integers or strings, to user-defined types, such as enumerations, structures and classes.
  • C# language provides a rich set of built-in data types
  •  All  variables  whether  user-defined  or  intrinsic(built-in),can  be  used  as  objects anywhere in a program
  • All variables in a program are automatically initialized to default values by the system when they are declared

vi) Operators

  • It is a symbol that takes one or more operands (variables, expressions or values) and operates on them to give an output.

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

LOCKS

Posted on

USEFULL FOR FYBSC (IT) & TYBSC (CS) STUDENTS

What is Lock?

  • Transaction processing systems usually allow multiple transactions to run concurrently. By allowing multiple transactions to run concurrently will improve the performance of the system in terms of increased throughout or improved response time, but this allows causes several complications with consistency of the data.
  • Ensuring consistency in spite of concurrent execution of transaction require extra work, which is performed by the concurrency controller system of DBMS.
  • A lock is a variable associated with a data item that describes the status of the item withrespect to possible operations that can be applied to it. Generally, there is one lock for each dataitem in the database. Locks are used as a means of synchronizing the access by concurrenttransactions to the database item.

Types of Locks

  • Several types of locks are used in concurrency control. To introduce locking concepts gradually, we first discuss binary locks, which are simple but restrictive and so are not used in practice. Shared/exclusive locks, which provide more general locking capabilities and are used in practical database locking schemes.
  • Depending on the lock mode, when one user has a lock on a record, the lock prevents other users from changing or even reading that record.
  • There are three lock modes: –
  •   SHARED

Row-level shared locks allow multiple users to read data, but do not allow any users to change that data. Table-level shared locks allow multiple users to perform read and write operations on the table, but do not allow any users to perform DDL operations. Multiple users can hold shared locks simultaneously.

  •   EXCLUSIVE

An exclusive lock allows only one user/connection to update a particular piece of data (insert, update, and delete). When one user has an exclusive lock on a row or table, no other lock of any type may be placed on it.

  •   UPDATE

Update locks are always row-level locks. When a user accesses a row with the SELECT… FOR UPDATE statement, the row is locked with an update mode lock. This means that no other user can read or update the row and ensures the current user can later update the row. Update locks are similar to exclusive locks. The main difference between the two is that you can acquire an update lock when another user already has a shared lock on the same record. This lets the holder of the update lock read data without excluding other users. However, once the holder of the update lock changes the data, the update lock is converted into an exclusive lock. Also, update locks are asymmetric with respect to shared locks. You can acquire an update lock on a record that already has a shared lock, but you cannot acquire a shared lock on a record that already has an update lock. Because an update lock prevents subsequent read locks, it is easier to convert the update lock to an exclusive lock.

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

 

OOP in C++

Posted on

OVERLOADABLE/NON-OVERLOADABLEOPERATORS

  • Following is the list of operators which can be overloaded:

1

  • Following is the list of operators, which cannot be overloaded:

::

.*

.

?:

 

  • C# allows user-defined types to overload operators by defining static member functions using the operator keyword. Not all operators can be overloaded, however, and others have restrictions, as listed in this table:

Operators

Overloadability

+, , !, ~, ++, , true, false

These unary operators can be overloaded.

+, , *, /, %, &, |, ^, <<, >>

These binary operators can be overloaded.

==, !=, <, >, <=, >=

The comparison operators can be overloaded (but see the note that follows this table).

&&, ||

The conditional logical operators cannot be overloaded, but they are evaluated using & and |, which can be overloaded.

[]

The array indexing operator cannot be overloaded, but you can define indexers.

(T)x

The cast operator cannot be overloaded, but you can define new conversion operators (see explicit and implicit).

+=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>=

Assignment operators cannot be overloaded, but +=, for example, is evaluated using +, which can be overloaded.

=, ., ?:, ??, ->, =>, f(x), as, checked, unchecked, default, delegate, is, new, sizeof, typeof

These operators cannot be overloaded.

 

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

MANAGED CODE and UNMANAGED CODE

Posted on

USEFULL FOR TYBSC (IT) & TYBSC (CS) STUDENTS

MANAGED CODE

  • The  code  that  is  executed  by  the  CLR  environment  rather  than  executed  by  the operating system is called as managed code.
  • The applications that are created using managed code automatically have CLR services, such  as  type  checking,  security,  and  automatic  garbage  collection  these  CLR compiles the applications to MSIL and not the machine code.
  • This  MSIL  along  with  the  metadata  that  attributes,  classes,  and  methods  of  the  code reside in an assembly.
  • The compilation takes place in the managed execution environment, which assures the working of the code.
  • The  benefits  provided  by  the  CLR  can  be  used  by  selecting  one  or  more  language compilers, such as visual basic, C#, visual C++, or any of the third party compilers, such as COBOL, PERL, or Eiffel.
  • The language compiler determines the syntax the must be Used by the code. When the code is complied into managed code, the compiler converts the source code into MSIL, which is central processing unit (CPU) – independent.
  • At this time, the required metadata is generated. The metadata contains the definition of types, member signature, the members in the code, and other details that the code uses at the time of execution. Next, MSIL must be converted into CPU – specific code by the JIT compiler, before the execution of the code.  The role of JIT compiler is to translate the MSIL into native code.
  • The  runtime  also  supports  another  method  of  compilation  named  install – time  code generation.  It converts MSIL into native code in a single shot by taking a larger unit of code at a time.
  • The  entire  assembly  is  converted  into  native  code  at  the  installation  time  itself.  By default, it takes care of other assemblies’ referred in this assembly. It stores the resulting native code for use when the assembly is loaded and run. Using the install – time code generation, the entire assembly that results in loading the code files more rapidly.

1

Posted By-:Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

 

Atomicity Consistency Isolation Durability (ACID)

Posted on

USEFULL FOR FYBSC (IT) & TYBSC (CS) STUDENTS

Atomicity Consistency Isolation Durability (ACID)

Qu.1 – What does Atomicity Consistency Isolation Durability (ACID) mean?

Atomicity Consistency Isolation Durability (ACID) is a concept referring to a database system’s four transaction properties: atomicity, consistency, isolation and durability.

Qu.2 – Explain Atomicity Consistency Isolation Durability (ACID).

A database guarantees the following four properties to ensure database reliability, as follows:

Atomicity: A database follows the all or nothing rule, i.e., the database considers all transaction operations as one whole unit or atom. Thus, when a database processes a transaction, it is either fully completed or not executed at all.

Consistency: Ensures that only valid data following all rules and constraints is written in the database. When a transaction results in invalid data, the database reverts to its previous state, which abides by all customary rules and constraints.

Isolation: Ensures that transactions are securely and independently processed at the same time without interference, but it does not ensure the order of transactions. For example, user A withdraws $100 and user B withdraws $250 from user Z’s account, which has a balance of $1000. Since both A and B draw from Z’s account, one of the users is required to wait until the other user transaction is completed, avoiding inconsistent data. If B is required to wait, then B must wait until A’s transaction is completed, and Z’s account balance changes to $900. Now, B can withdraw $250 from this $900 balance.

Durability: In the above example, user B may withdraw $100 only after user A’s transaction is completed and is updated in the database. If the system fails before A’s transaction is logged in the database, A cannot withdraw any money, and Z’s account returns to its previous consistent state.

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

OOP in C++

Posted on Updated on

For the students of FYBSc (IT), SYBSc (CS), SYBCA

OPERATOR OVERLOADING

  • C++ allows specifying more than one definition for an operator in the same scope, which is called operator overloading respectively.
  • When to call an overloaded operator, the compiler determines the most appropriate definition to use by comparing the argument types used to call the function or operator with the parameter types specified in the definitions. The process of selecting the most appropriate overloaded operator is called overload resolution.
  • Overload most of the built-in operators available in C++ and thus a programmer can use operators with user-defined types as well.
  • Overloaded operators are functions with special names the keyword operator followed by the symbol for the operator being defined. Like any other function, an overloaded operator has a return type and a parameter list.

Boxoperator+ (constBox&);

  • The above code declares the addition operator that can be used to add two Box objects and returns final Box object. Most overloaded operators may be defined as ordinary non-member functions or as class member functions. In case we define above function as non-member function of a class then we would have to pass two arguments for each operand as follows:

Boxoperator+ (constBox&,constBox&);

  • Following is the example to show the concept of operator over loading using a member function. Here an object is passed as an argument whose properties will be accessed using this object, the object which will call this operator can be accessed using this operator as explained below:

#include <iostream.h>
#include <conio.h>
class Box
{ public:
double getVolume(void)
{
return length * breadth * height; }
void setLength( double len )
{ length = len; }
void setBreadth( double bre )
{ breadth = bre; }
void setHeight( double hei )
{ height = hei; }

// Overload + operator to add two Box objects.
Box operator+(const Box& b)
{ Box box;
box.length = this->length + b.length;
box.breadth = this->breadth + b.breadth;
box.height = this->height + b.height;
return box; }
private:
double length; // Length of a box
double breadth; // Breadth of a box
double height; // Height of a box};

void main( )
{
clrscr();
Box Box1; // Declare Box1 of type Box
Box Box2; // Declare Box2 of type Box
Box Box3; // Declare Box3 of type Box
double volume = 0.0; // Store the volume of a box here

// box 1 specification
Box1.setLength(6.0);
Box1.setBreadth(7.0);
Box1.setHeight(5.0);

// box 2 specification
Box2.setLength(12.0);
Box2.setBreadth(13.0);
Box2.setHeight(10.0);

// volume of box 1
volume = Box1.getVolume();
cout << “Volume of Box1 : ” << volume <<endl;

// volume of box 2
volume = Box2.getVolume();
cout << “Volume of Box2 : ” << volume <<endl;
// Add two object as follows:
Box3 = Box1 + Box2;

// volume of box 3
volume = Box3.getVolume();
cout << “Volume of Box3 : ” << volume <<endl;
getch();}

 

When the above code is compiled and executed, it produces the following result:

Volume ofBox1:210

Volume ofBox2:1560

Volume ofBox3:5400

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

SQL

Posted on

SQL LANGUAGE:

 

  1. SQL is a tool for organizing, managing, and retrieving data stored by a computer      database. The acronym SQL is an abbreviation for Structured Query Language. For historical reasons, SQL is usually pronounced “sequel” but the alternate pronunciation “S.Q.L.” is also used.
  2. As the name implies, SQL is a computer language that to use to interact with a database. In fact, SQL works with one specific type of database, called a relational database.
  3. When you need to retrieve data from a database, we use the SQL language to make the request. The DBMS processes the SQL request, retrieves the requested data, and returns it to us.
  4. This process of requesting data from a database and receiving back the results is called a database query- hence the name Structured Query Language.
  5. SQL is thus a comprehensive language for controlling and interacting which a database management system.
  6. Second, SQL is not really a complete computer language like COBOL, C, C+ +, or java. Instead, SQL is a database sublanguage, These SQL statements can be embedded into another language, such as COBOL or C, to extend that language for use in database access.
  7. SQL is used to control all of the functions that a DBMS provides for its users, including:

                i. Data Definition: SQL lets a user define the structure and organization of the stored data and relationships among the stored data items.

               ii. Data retrieval: SQL allows a user or an application program to retrieve stored data form the database and use it.

              iii. Data manipulation: SQL allows a user or an application program to update the database by adding new data, removing old data, and modifying previously stored data.

              iv. Access control: SQL can be used to restrict a user’s ability to retrieve, add, and modify data, protecting stored data against unauthorized access.

              v. Data sharing: SQL is used to coordinate data sharing by concurrent users, ensuring that they do not interfere with one another.

             vi. Data integrity: SQL defines integrity constraints in the database, protecting it from corruption due to inconsistent updates or system failures.

 

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

 

Question and Answer in Computer Graphics

Posted on Updated on

Q1. Define Computer Graphics.

Ans. Computer  graphics  remains  one  of  the  most  existing  and  rapidly  growing  computer  fields.Computer graphics may be defined as a pictorial representation or graphical representation of objects in a computer.

Q2. Define Random Scan/Raster Scan displays.

Random  scan  is  a  method  in  which  the  display  is  made  by  the  electronic  beam,  which  is directed, only to the points or part of the screen where the picture is to be drawn.The Raster scan system is a scanning technique in which the electrons sweep from top to bottom and from left to right. The intensity is turned on or off to light and unlight the pixel.

Q3. Explain the merits and demerits of Penetration techniques.

Ans. The merits and demerits of the Penetration techniques are as follows:

  1. It is an inexpensive technique.
  2. It has only four colors.
  3. The quality of the picture is not good when it is compared to other techniques.
  4. It can display color scans in monitors.

Q4. Explain the merits and demerits of DVST.

Ans. The merits and demerits of direct view storage tubes (DVST) are as follows:

  1. It has a flat screen.
  2. Refreshing of screen is not required.
  3. Selective or part erasing of screen is not possible.
  4. It has poor contrast.
  5. Performance is inferior to the refresh CRT.

Q5. Explain the merits and demerits of Plasma panel display.

Ans. ADVANTAGES:

    1.  Refreshing is not required.

  1. Produce a very steady image free of Flicker.
  2. Less bulky than a CRT.

DISADVANTAGES:

  1. Poor resolution of up to 60 d.p.i.
  2. It requires complex addressing and wiring.
  3. It is costlier than CRT.

 

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

SQL Security in DBMS

Posted on

  1. INTRODUCTION
  2. Security of data in a DBMS is of major concern, because in an SQL based DBMS, interactive SQL makes database access very easy.
  3. The security of a database may vary:
    1. Data in the table should be accessible to only some users.
    2. Only some users can update data in the table.
    3. Access should be restricted on column by column basis.
    4. Some users can use only application programs on a table
  1. SECURITY CONCEPTS

1

  1. Enforcing and implementing security for a database is the responsibility of the DBMS.
  2. SQL defines an overall framework for security, and SQL statements are used to specify security restrictions.
  3. SQL security is based on three concepts:

                        i.      USERS: The actors in the database. Each time the DBMS retrieves, inserts, deletes, or updates data, it does so, on behalf of some user. The DBMS permits or prohibits the action depending on which user is making the request

                       ii.      DATABASE OBJECTS: The items to which SQL security protection can be applied. Security is usually applied to tables and views, but other objects such as forms, application programs, and entire database can also be protected. Most users will have permission to use certain database objects but will be prohibited form using others.

                      iii.      PRIVILEGES: The actions that a user is permitted to carry out for a given database object. A user may have permission it SELECT and INSERT rows in a certain table, for example, but may lock permission to DELETE or UPDATE rows of the table. A different user may have a different set of privileges.

  1. To establish security SQL uses GRANT and REVOKE statements on different users.
  2. USER ID

             i.      Each user of a SQL-based database is typically assigned a user-id, a sort name that identifies the user to the DBMS software.

            ii.      The user-id is at the heart of SQL security.  Every SQL statement executed by the DBMS is carried out on behalf of a specific user-id.

           iii.      The user-id determines whether the statement will be permitted or prohibited by the DBMS.

           iv.      A personal computer database may have only a single user-id, identifying the user who created and who owns the database.

           v.      In practice, the restrictions on the names that can be chosen as user-ids very from implantation to implementations

  1. The SQL1 standard permitted user-ids of up to 18 characters and required them to be valid SQL names.
  2. In some mainframe DBMS systems, user-ids may have no more than eight characters.
  3. In Sybase and SQL Server, user-ids many have up to 30 characters. If portability is a concern, it’s best to limit user-ids to eight or fewer characters. 
  4. The ANSI / ISO SQL standard uses the term authorization-id instead of user-id
  1. USER AUTHENTICATION

                        i.The SQL standard specifies that user-ides provide database security; however, the specific mechanism for associating a user-id with a SQL statement is outside the scope the standard because a database can be accessed in many different ways.

                       ii.Most commercial SQL implementation establishes a user-id for each database session.

                       iii.In interactive SQL, the session begins when you start the interactive SQL program and it lasts until you exit the program.

                      iv.Usually, you must supply both a user-id and an associated password at the beginning of a session. The DBMS checks the password to verify that you are, in fact, authorized to use the user-id that you supply.

                      v. Although user-id and password are common across most SQL products, specific techniques used to specify the user-id and password very from one product to another.

                     vi. The SQL2 standard also allows a program to use and authorization-id associated with a specific set of SQL statements (called a module), rather then the user-id of the particular person running the program.

  1. USER GROUP

                     i. A large production database often has groups of user with similar needs.

                    ii. You can assign the same user-id to very person in the group: This scheme simplifies security administration because it allows you to specify data access privileges once for the single user-id. However, under this scheme. The people sharing the user-id cannot be distinguished from one another in system operator displays and DBMS reports.

                   iii. You can assign a different user-id to very person in the group: This scheme lets you differentiate between the users in reports produced the DBMS, and it lets you establish different privileges for the individual users later. However, you must specify privileges for each user individually, making security administration tedious and error-prone

                  iv. Another alternative is to make use of group – IDs which identify groups of related user ID.

  1. SECURITY OBJECTS

                         i.SQL security protections apply to specific objects contained in a database. The SQL1 standard specified tow types of security objects

  1. Tables and Views.

                        ii.Thus, each table and view can be individually protected. Access to a table or view can be permitted for certain user-ids and prohibited for other user-ids.

                       iii.The SQL2 standard expanded security protections to include other objects, including domains and user-defined character sets, and added a new type of protection for table or view access.

                      iv.However, the underling SQL security scheme -of specific privileges applied to specific objects, granted or revoked through the same SQL statements –is almost universally applied.

 

  1. PRIVILEGES:
    1. The set of actions that a user can carry out against a database object are called the privileges for the object.
    2. The SQL standard specifies four basic privileges for tables and views.:

                             i.The SELECT privilege allows you to retrieve data from a table or view. With this privilege, you can specify the table or view in the FROM clause of a SELECT statement or subquery.

                            ii.The INSERT privilege allows you to insert new rows into a table or view. With this privilege, you can specify the table or view in the INTO clause of an INSERT statement.

                            ii.The DELETE privilege allows you to delete rows of data from a table or view. With this privilege, you can specify the table or view in the FROM clause of a DELETE statement.

                           iv.The UPDATE privilege allows you to modify rows of data in a table or view. With this privilege, you can specify the table or view as the target table in an UPDATE statement. The UPDATE privilege can be restricted to specific columns of the table or view, allowing updates to these columns but disallowing updates to any other columns.

  1. SQL2 Extended Privileges

                        i. The SQL2 standard expended the basic SQL1 privilege in several dimensions:It added new capabilities to the SQL1 INSERT and UPDATE privileges.

                       ii. It added a new REFERENCES privilege that restricts a user’s ability to create a reference to a table from a foreign key in another table.

                      iii.It also added a new USAGE privilege that controls access to new SQL2 database structures of domains, character sets, collation sequences, and translations.  

                      iv.These privilege may now be granted for a specify column or columns within a table, instead of applying to the entire table.

  1. Ownership Privileges

                      i.When you create a table with the CREATE TABLEB statement, you become its owner and receive full privileges for the table (SELECT, INSERT, DELETE, UPDATE, and other privileges supported by the DBMS).

                     ii.Other users initially have no privileges on the newly created table. If they or to be given access to the table, you must explicitly grant privileges to them, using the GRANT statement.

                    iii.When you create a view with the CREATE VIEW statement, you become the owner of the view, but you do not necessarily receive full privileges on it.

 

  1. VIEWS & SQL SECURITY

2

  1. In addition to the restrictions on the table access provided by the SQL privileges, views also play key role in SQL security.
  2. By defining a view and giving a user permission to access the view but not its source tables, you can effectively restrict the user’s access to only selected columns and rows.
  3. Views thus offer a way to exercise very precise control over what data is made to which users.
  4. Update restriction. The SELECT privilege can be used with read-only views to limit data retrieval, but the INSERT, DETELE, and UPDATE privileges are meaningless for those views. If a user must update the data visible in a read-only view, the user must be given permission to update the underlying tables and must use INSERT, DELETE, and PUDATE statement that reference those tables.
  5. Performance. Because the DBMS translates every access to the view into a corresponding access to its source tables, views can add significant overhead to database operations. Views cannot be used indiscriminately to restrict database access without causing overall database performance to suffer.

 

  1. GRANTING PRIVILEGES
    1. The basic GRANT statements, is used to grant security privileges on database objects to specific users.
    2. Normally, the GRANT statements are used by the owner of a table or view to give other users access to the data.
    3. It includes a list of privileges to be granted, name of the table to which privileges apply and user ID to which privileges are applied.
    4. The syntax for GRANT statement is:

3

  1. For convenience grant statement provides two shortcuts that can be used when:

                i. Granting many privileges

               ii. Granting privileges to many users

  1. Instead of specifically listing all privileges available for a particular object keyword ALL PPRIVILEGES is used.
  2. Instead of giving privileges to all uses of the database on-by-one keyword PUBLIC can be used to grant a privilege to every database authorized users.
  1. PASSING PRIVILEGES:

4

  1. When you create a database object and become its owner, you are the only person who can grant privileges to use the object. When you grant privileges to other users, they are
  2. allowed to use the object, but they cannot pass those privileges on to other users.
  3. In this way, the owner of an object maintains very tight control both over who has permission to use the object and over what forms of access are allowed.
  4. Occasionally you may want to allow other users to grant privileges on an object that you own.
  5. Once a user has been granted certain privileges with the GRANT OPTION, that user may
  6. grant those privileges and the GRANT OPTION to other users.
  7. Those other users can, in turn, continue to grant both the privileges and the GRANT OPTION.
  8. For this reason you should use great care when giving other users the GRANT OPTION. Note that the GRANT OPTION applies only to the specific privileges named in the GRANT statement.
  1. REVOKING PRIVILEGES

5

  1. In most SQL-based databases, the privileges that you have granted with the GRANT statement can be taken away with the REVOKE statement.
  2. The REVOKE statement has a structure that closely parallels the GRANT statement, specifying a specific set of privileges to be taken away, for a specific database object, from one or more user-ids.
  3. When you issue a REVOKE statement, you can take away only those privileges that you previously granted to another user.
  4. That user may also have privileges that were granted by other users; those privileges are not affected by your REVOKE statement.
  5. Note specifically that if two different users grant the same privilege on the same object to a user and one of them later revokes the privilege, the second user’s grant will still allow the user to access the object.
  6. This handling of “overlapping grants” of privileges is illustrated in the following example sequence.
  1. REVOKE AND GRANT OPTION

6

  1. When you grant privileges with the GRANT OPTION and later revoke these privileges, most DBMS brands will automatically revoke all privileges derived from the original grant.
  2. In a different brand of DBMS, Sue’s privileges might remain intact because the grant from
  3. George to Larry remains intact.
  4. Thus the time sequence of GRANT and REVOKE statements, rather than just the privileges themselves, can determine how far the effects of a REVOKE statement will cascade. Granting and revoking privileges with the GRANT OPTION must be handled very carefully, to ensure that the results are those you intend.

 

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

What is SQL. /Define SQL

Posted on

SQL LANGUAGE:

 

  1. SQL is a tool for organizing, managing, and retrieving data stored by a computer      database. The acronym SQL is an abbreviation for Structured Query Language. For historical reasons, SQL is usually pronounced “sequel” but the alternate pronunciation “S.Q.L.” is also used.
  2. As the name implies, SQL is a computer language that to use to interact with a database. In fact, SQL works with one specific type of database, called a relational database.
  3. When you need to retrieve data from a database, we use the SQL language to make the request. The DBMS processes the SQL request, retrieves the requested data, and returns it to us.
  4. This process of requesting data from a database and receiving back the results is called a database query- hence the name Structured Query Language.
  5. SQL is thus a comprehensive language for controlling and interacting which a database management system.
  6. Second, SQL is not really a complete computer language like COBOL, C, C+ +, or java. Instead, SQL is a database sublanguage, These SQL statements can be embedded into another language, such as COBOL or C, to extend that language for use in database access.
  7. SQL is used to control all of the functions that a DBMS provides for its users, including:

   

     i. Data Definition: SQL lets a user define the structure and organization of the stored data and relationships among the stored data items.

    ii. Data retrieval: SQL allows a user or an application program to retrieve stored data form the database and use it.

   iii. Data manipulation: SQL allows a user or an application program to update the database by adding new data, removing old data, and modifying previously stored data.

   iv. Access control: SQL can be used to restrict a user’s ability to retrieve, add, and modify data, protecting stored data against unauthorized access.

   v. Data sharing: SQL is used to coordinate data sharing by concurrent users, ensuring that they do not interfere with one another.

  vi. Data integrity: SQL defines integrity constraints in the database, protecting it from corruption due to inconsistent updates or system failures.

 

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com