Monday, 29 July 2019

Mysql Table | Mysql create table command


Mysql Table | Mysql Create Command




Hello Friends Today we will discuss about Tables . In mysql, tables are also known as Relations.

We have discussed  about Databases in our last topic.If you want to see Practical Demos about Databases Click here

Tables/Relations

A table is a collection of rows and columns in tabular format.Before creating a table , we have to open a database to store table.Database manages the tables.

How to create a table in MySQL
Syntax:

create table table_name(column1_name datatype,column_name2 datatype);

Create Table

Here,Firstly we use database 'school' in which we are creating our table called 'student'.A table has two columns,one column is of integer type and second column is of character type.Integer type column does not take size but In character type columns,we have to mention the size of characters/data.  

In MySQL, there are two types of character datatype.
  • Char(size) :- It declared with a maximum length of characters available for storage.It is fixed length variable.
  • Varchar(size) :- It is variable length datatype.The storage size of varchar is the actual length of data entered.

No comments:

Post a Comment

Recent Post

Python Project | Banking System | Project on Banking System using python

  PYTHON PROJECT Banking System import csv import pandas as pd import matplotlib.pyplot as plt import sys import datetime found=False def ne...