MySQL is the world most popular open source database It is also the fastest

Mysql is the world most popular open source database

This preview shows page 21 - 24 out of 30 pages.

MySQL is the world most popular open source database. It is also the fastest growing database in the industry, with over 70,000 downloads per day. MySQL is a command line program that act as a text based front end for the server. It is used for issuing queries and viewing the results interactively. SQL means (Structured Query Language), the way of describing a database in a tabular form. SQL divided into many parts of command: 1. DDL (Data Definition Language command). It is only a structure of database. It contains Creation, Altering and Drop. 2. DML (Data manipulation Language command). Is a language that provides a set of operations to support the basic data manipulation operations on the data held in the database. Operation such as: Insertion of new data into database. Modification of data stored in the database. Retrieval of data contained in the database. Deletion of data from the database. 3. DCL (Data Control Language command). That is (Grant, Revoke) means its allow you have an access to the data or to hide the data by using some Page | 21 Mr. Saifullahi Muhammad
Image of page 21
Lecture Note Introduction to File Processing command, you can may be have an access to data to view but you cannot have permission to change the data for security reasons. 4. TCL (Transaction Control Language command). Is a logical unit of work on the database, an action or series of actions carried out by a single user or application program, which reads or updates the contents of the database. DATA TYPES In MySQL the data types available can be broken down into four (4) major categories: - Numeric Integer for storing whole numbers e.g. Population INT (11) Floating – point that store approximate value (real) numbers e.g. FLOAT (8,2) or DOUBLE (10,2) Fixed – point e.g. Cost DECIMAL (10,2) stores exact value (real) numbers Bit field e.g. Bin BIT (4) it represents bit field values. - Character CHAR fixed-length character string VARCHAR variable-length character string ENUM Enumeration consisting of a fixed set of legal values Some are: - Binary, Binary data strings - Temporal, Time and Dates Creating a Table (File) The syntax for creating a table is: CREATE TABLE <tablename> ( <column name1> <column type> [<column option>], <column name2> <column type> [<column option>],…., ] [<list of table constraints and or indexes>] Page | 22 Mr. Saifullahi Muhammad
Image of page 22
Lecture Note Introduction to File Processing ) [<table option>] A table always has a table name (which is the file name) and always has atleast one column (field), other items are optional. Example: CREATE TABLE CountryLanguage ( CountryCode CHAR (3) NOT NULL, Language VARCHAR (30) NOT NULL, IsOfficial ENUM (‘True’, ‘False’) NOT NULL DEFAULT ‘False’, Percentage FLOAT (3,1) NOT NULL, PRIMARY KEY (CountryCode, Language) ) ENGINE = MyISAM COMMENT = ‘lists language spoken’; We can also create a table LIKE existing one. E.g. CREATE TABLE country LIKE countryLanguage We can also create a TEMPORARY table. E.g. CREATE TEMPORARY TABLE newCountry LIKE countryLanguage; or CREATE TEMPORARY TABLE newCountry as SELECT * FROM countryLanguage; Column Options: NULL or NOT NULL: specify the nullability for the column. A nullable column
Image of page 23
Image of page 24

You've reached the end of your free preview.

Want to read all 30 pages?

  • Summer '16
  • teresia
  • Filename, Filename extension, Computer file, Mr. Saifullahi Muhammad

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture