Professional Documents
Culture Documents
The Server ( My SQL Server ) : listens for client requests coming in over the network
and accesses database contents according to those requests and provides that to the
clients.
Clients : are programs that connects to the database server and issue queries in a pre
specified format. MySQL is compatible with the standards based SQL.
MySQL and SQL : In order to access data within the MySQL database, all programs
and users must use Structured Query Language(SQL). SQL is the set of commands
that is recognized by all nearly all RDBMS.
The SQL is language that enables you to create and operate on relational databases,
which are sets of related information stored in tables.
1. Data Definition Language (DDL) Commands: Commands that allow you to perform
tasks related to data definition : Creating, altering and dropping tables
-1-
2. Data Manipulation Language (DML) commands: Commands that allows you to
perform data manipulation for example : retrieval, insertion, deletion and modification of
data stored in a database.
The difference between CHAR and VARCHAR is that of fixed length and variable
length. The CHAR data types specifies a fixed length character string. When a column
is given data type as CHAR(n), then SQL ensures that all values stored in that column
have this length i.e. n bytes. If a value is shorter than this length n then blanks are
added, but the size of the value remains n bytes.
VARCHAR on other hand specifies a variable length string. When a column is given
data type as VARCHAR(n), then the maximum size a value in this column can have is n
bytes. Each value that is stored in this column stores exactly as you specify it i.e. no
blanks are added.
-2-
Test is the sample database provided by the SQL.
To view the databases stored on MySQL we can give the following command is:
Tables are defined the CREATE TABLE command. When a table is created, its
columns are named, data types and sizes are supplied for each column. Each table
must have at least one column.
Eg. CREATE TABLE STUDENT ( RNo Integer Primary key, Name Varchar(20), Marks
integer);