Page 332 - IT 402 v2.0 class 10
P. 332

Introduction to MySQL








           INTRODUCING MYSQL

        MySQL is an open-source RDBMS software which is available free of cost.  It can run on all operating systems,
        including Linux, Unix and Windows. It is popular for web-based applications and online publishing. It uses
        a query language called SQL (Structured Query Language). SQL is the standard language for managing
        relational databases and performing various operations on the data in the tables. It would enable us to store,
        retrieve, and manipulate data in the form of tables.

        SQL  is a  high-level interactive language  that  allows users to  specify what  is required  to  be  done  in the
        form of queries. Unlike other high-level languages, we do not need to specify how the SQL operations are
        implemented.
           CREATING A DATABASE


        The CREATE DATABASE command is used to create  a database  in MySQL.  The syntax to create  a
        database is:
           CRE AT E  D AT AB ASE  d atab ase_ name;

        For example,

           CRE AT E  D AT AB ASE  School;
        After creating a database, you need to access the database by using the USE command in the following
        way:

           U SE  School;
           CREATING A TABLE

        As you know that a table is a collection of organised data in the form of rows and columns. It is also
        known as a relation. The CREATE TABLE command is used to create a table in SQL. The syntax to create
        a table is:

           CRE AT E  T AB L E  tab le_ name
           (
               colu mn_ name1  d ata_ ty p e ( siz e) ,
               colu mn_ name2  d ata_ ty p e ( siz e) ,
               colu mn_ name3  d ata_ ty p e ( siz e) ,
               .....
               .....
               colu mn_ nameN d ata_ ty p e ( siz e)
           ) ;
         hile creating a table in S    it is necessary to give a data type for each field column.






         330       Touchpad Information Technology-X
   327   328   329   330   331   332   333   334   335   336   337