Showing posts with label MySQL. Show all posts
Showing posts with label MySQL. Show all posts

Saturday, 12 October 2013

MySQL Line Comment.

This is new MySQL Line Comment tutorial.

Part 1:

create simple database and tables through MySQL line comment.

1. Create Database Query
2. Create Tables Query
3. Insert Query
4. Select Query


Step 1:

Open MySql Line Comment window. Enter your system password.


Some instructions display.

Step 2:

Create EMPLOYEE database. Get employee details for employee name, employee address, employee salary and attendance details .. etc.

Syntax:

CREATE DATABASE ;

ex:


CREATE DATABASE EMPLOYEE;


Step 3:

After, particular select one database (ex: EMPLOYEE) from group of database. use this query,

Syntax:

USE ;

USE is reserve word.

ex:
USE EMPLOYEE


Step 4:

After, create more than one table in single database.

Syntax:
CREATE TABLE (fields1 ,fields2 ,,,)
ex:
CREATE TABLE EMPLOYEEINFO(E_ID INT(11), E_NAME VARCHAR(255), E_SALARY INT(11));

The table contains, three fields for E_ID is int datatype, E_NAME is varchar datatype, E_SALARY is int datatype.

varchar datatype is support numeric and characters and it's size 255 characters only.

Step 5:

Insert values in table EMPLOYEEINFO.

Syntax:

INSERT TABLE_NAME VALUES('values',....)

ex:
INSERT EMPLOYEEINFO VALUES(101, 'KUMAR', 10000);


Step 6:

Select values from database use select query. Different type select query use retrive values from database. Such as,

Type 1:
SELECT * FROM EMPLOYEEINFO 
Select all fields(column name) from table.

Type 2:
SELECT E_ID FROM EMPLOYEEINFO

Select E_ID single field from EMPLOYEEINFO table.

Type 3:
SELECT E_ID, E_NAME FROM EMPLOYEEINFO WHERE E_ID=101

Select some fields use where conditions

more select statements upcoming tutorials.


insert more records.


Next tutorial concept:

Part 2:

Different type of select queries and aggregate functions in MySQL database.

Touch with me! Gain more!.