MySQL is a database management system, like SQL Server, Oracle, Informix, Postgres, etc. MySQL is a RDBMS . Refer installing MYSQL in Annexure - 12th Computer Chapter - - Creating Database . .
To create a database, type the following command in the prompt: CREATE DATABASE ; Example: CREATE DATABASE stud; . To work with the database, type the following command. USE DATABASE; For example to use the stud database created, give the command USE stud; Components of SQL . SQL commands are divided into five categories: DML - Data Manipulation Language DDL - Data Definition Language DCL - Data Control Language TCL - Transaction Control Language DQL - Data Query Language .
. DATA DEFINITION LANGUAGE The Data Definition Language (DDL) consist of SQL statements used to define the database structure or schema. It simply deals with descriptions of the database schema and is used to create and modify the structure of database objects in databases. The DDL provides a set of definitions to specify the storage structure and access methods used by the database system.
A DDL performs the following functions : . It should identify the type of data division such as data item, segment, record and database file. . It gives a unique name to each data item type, record type, file type and data base.
12th Computer Chapter - - Structured Query Language . It should specify the proper data type. . It should define the size of the data item.
. It may define the range of values that a data item may use. . It may specify privacy locks for preventing unauthorized data entry.
SQL commands which comes under Data Definition Language are: Create To create tables in the database. Alter Alters the structure of the database. Drop Delete tables from database. Truncate Remove all records from a table, also release the space occupied by those records.
. . DATA MANIPULATION LANGUAGE A Data Manipulation Language (DML) is a query language used for adding (inserting), removing (deleting), and modifying (updating) data in a database. In SQL, the