Saturday 6 December 2014

MYSQL


  Introduction:

                      MySQL is the most popular open source SQL database management system is developed, distributed, and supported by MySQL AB. MySQL AB is a commercial company, founded by the MySQL developers.
                A database is a collection of data that is organized so that its contents can be easily accessed, managed and updated. MySQL is a data storage area. In this storage area, there are small sections called Tables.
                A Relational Database Management System (RDBMS) may be a DBMS in which data is stored in the form of tables and the relationship among the data is also stored in the form of tables.
        The data in MySQL is stored in database objects called tables. A table is a collection of related data entries and it consists of columns and rows. The MySQL database has become the world's most popular
open source database because of its consistent fast performance, high reliability and ease of use.

 Advantages:
o   MySQL is Cross-Platform.
o   MySQL is fast and free.
o   Reliable and easy to use.
o   Multi-Threaded multi-user and robust SQL Database server.

 Disadvantages:
o Missing Sub-selects.
o MySQL doesn't yet support the Oracle SQL extension.
o Does not support Stored Procedures and Triggers.
o MySQL doesn't support views, but this is on the TODO.
Account Management Statements:
 CREATE USER:

                         The CREATE USER statement creates new MySQL accounts.
Syntax:-

                    CREATE USER user [IDENTIFIED BY [PASSWORD] 'password']
           [, user [IDENTIFIED BY [PASSWORD] 'password']] ...

Example:

CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';

 DROPUP USER:

                      The DROP USER statement removes one or more MySQL accounts and their privileges.
Syntax:-

                      DROP USER user [, user] ....
GRANT :
                   The GRANT statement enables system administrators to grant privileges to MySQL user accounts.

Syntax:--
                 GRANT
                 priv_type [(column_list)]
                 [, priv_type [(column_list)]] ...
     ON [object_type] priv_level
      TO user [IDENTIFIED BY [PASSWORD] 'password']
      [, user [IDENTIFIED BY [PASSWORD] 'password']] ...
      [REQUIRE {NONE | ssl_option [[AND] ssl_option] ...}]
      [WITH with_option ...].

Example:-
                  GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost' WITH GRANT OPTION;
RENAME USER :
                                  The RENAME USER statement renames existing MySQL accounts.
Syntax:-

                   RENAME USER old user TO new user[, old user TO new user] ...
Example:-

                 RENAME USER 'jeffrey'@'localhost' TO 'jeff'@'127.0.0.1';

REVOKE:     
                   The REVOKE statement enables system administrators to revoke privileges from MySQL accounts.

Syntax:-

REVOKE
priv_type [(column_list)]
[, priv_type [(column_list)]] ...
ON [object_type] priv_level
FROM user [, user] ...
REVOKE ALL PRIVILEGES, GRANT OPTION
FROM user [, user] ...
Example:-

                  RENAME USER 'jeffrey'@'localhost' TO 'jeff'@'127.0.0.1';

SET PASSWORD :
                        The SET PASSWORD statement assigns a password to an existing MySQL user.
Syntax:--

SET PASSWORD [FOR user] =
{
PASSWORD('some password')
| OLD_PASSWORD('some password')
| 'encrypted password'
}
Example:-

                    SET PASSWORD FOR 'bob'@'%.loc.gov' = PASSWORD('newpass');
USING SEQUENCE:-
                              A sequence is a database object that generates numbers in sequential order. Applications most often use these numbers when they require a unique value in a table such as primary key values.

The  following list describes the characteristics of sequences.

o Sequences are available to all users of the database
o Sequences are created using SQL statements (see below)
o Sequences have a minimum and maximum value (the defaults are minimum=0 and             maximum=263-1); they can be dropped, but not reset
Once a sequence returns a value, the sequence can never return that same value
o While sequence values are not tied to any particular table, a sequence is usually used to               generate values for only one table
o Sequences increment by an amount specified when created (the default is 1).

Creating a Sequence:-
                                   To create sequences, execute a CREATE SEQUENCE statement in the same way as an UPDATE or INSERT statement. The sequence information is stored in a data dictionary file.
The format for a CREATE SEQUENCE statement is as follows:-

CREATE SEQUENCE sequence_name
[INCREMENT BY #]
[START WITH #]
[MAXVALUE # | NOMAXVALUE]
[MINVALUE # | NOMINVALUE]
[CYCLE | NOCYCLE]

Variable Description:--

INCREMENT BY:- The increment value. This can be a positive or negative number.
START WITH :-The start value for the sequence.
MAXVALUE:- The maximum value that the sequence can generate. If specifying
NOMAXVALUE”- the maximum value is 263-1.
MINVALUE:- The minimum value that the sequence can generate. If specifying
NOMINVALUE:- the minimum value is -263.
CYCLE:- Specify CYCLE to indicate that when the maximum value is reached the
                  sequence starts over again at the start value. Specify NOCYCLE to generate
                  an error upon reaching the maximum value.

Dropping a Sequence:

To drop a sequence, execute a DROP SEQUENCE statement. Use this function when a sequence is
no longer useful, or to reset a sequence to an older number. To reset a sequence, first drop the sequence and
then recreate it.
Drop a sequence following this format:
DROP SEQUENCE my sequence
Using a Sequence:

Use sequences when an application requires a unique identifier. INSERT statements, and
occasionally UPDATE statements, are the most common places to use sequences. Two "functions" are available on sequences:

NEXTVAL: Returns the next value from the sequence.
CURVAL: Returns the value from the last call to NEXTVAL by the current user during the current connection.

EXAMPLE:-
                    CREATE SEQUENCE customer_seq INCREMENT BY 1 START WITH 100

Friday 10 October 2014

SDLC FOR PROJECT


SDLC Overview

  •  It is also called as Software development process.
  • SDLC, is a process used by software industry to design, develop and test high quality software.
  • the SDLC aims to produce a high quality software that meets customer expectations, reaches completion within time and cost estimates.

Definition

  •  The software development life cycle (SDLC) is a framework defining tasks performed at each step in the software development process.

What is sdlc?

                          It consists of a detailed plan describing how to develop, maintain, replace and alter or enhance specific software. The life cycle defines a methodology for improving the quality of software and the overall development process.

 
Various stages in SDLC:- 

                 

  Planning and Requirement Analysis :

·   Requirement analysis is the most important and fundamental stage in SDLC.
·  This information is then used to plan the basic project approach and to conduct         product feasibility study in the economical, operational, and technical areas.
·  Planning for the quality assurance requirements and identification of the risks    associated with  the project is also done in the planning stage.
·  The outcome of the technical feasibility study is to define the various technical  approaches that can be followed to implement the project successfully with minimum risks.

  Defining Requirements :
                  Once the requirement analysis is done the next step is to clearly define and              document the product requirements and get them approved from the customer or             the market analysts.
·     This is done through‘SRS’– Software Requirement Specification document which consists of all the product requirements to be designed and developed during the project life cycle.

 Designing the product architecture :
·         SRS is the reference for product architects to come out with the best architecture for the product to be developed.
·          Based on the requirements specified in SRS, usually more than one design approach for the product architecture is proposed and documented in a DDS - Design Document Specification.
  •    A design approach clearly defines all the architectural modules of the product along with its communication and data flow representation with the external and third party modules .
  Building or Developing the Product :
  •    In this stage of SDLC the actual development starts and the product is built. The programming code is generated as per DDS during this stage
  •  If the design is performed in a detailed and organized manner, code generation can be accomplished without much hassle.
  •  Developers have to follow the coding guidelines defined by their organization and programming tools like compilers, interpreters, debuggers etc are used to generate the code.
  •      Different high level programming languages such as C, C++, Pascal, Java, and PHP are used for coding. The programming language is chosen with respect to the type of software being developed
.  
 Testing the Product:
  •      This stage is usually a subset of all the stages as in the modern SDLC models, the testing activities are mostly involved in all the stages of SDLC.
  •          However this stage refers to the testing only stage of the product where products defects are reported, tracked, fixed and retested, until the product reaches the quality standards defined in the SRS
       Deployment in the Market and Maintenance :
·         Once the product is tested and ready to be deployed it is released formally in the appropriate market.
·         Sometime product deployment happens in stages as per the organizations business strategy. The product may first be released in a limited segment and tested in the real business environment .