Content about Java ERP Solution for Reviews Best ERP Software for sale and Free Software with Java OpenSource for Free Download

SQL queries create table example sql command to create table

We can Create table with SQL command for example code below

CREATE TABLE table_name(
  column_name1 data_type(size),
  column_name2 data_type(size),
  column_name3 data_type(size));

Example SQL code for create table

CREATE TABLE Student(
   student_id int,
   student_name varchar(255));

Note: with difference DBMS  the command will not the same for example mysql  have datatype varchar but in Oracle use data type Vaarchar2

Mysql query for creating table example sql code for create new table with select command

We can create table with select command from another table with example sql command below

Example sql command for mysql query for creating table

CREATE TABLE new_std_table
  SELECT * from std_table

you can select with specify field name or using where condition , group by , order by for example below

CREATE TABLE new_std_table
  SELECT std_id,std_name from std_table where std_name like '%anna%' order by std_id

 Note: this command will support  MySql DBMS in other DBMS may be some difference