MySQL snippets – CREATE TABLE statement sample as bash shell.

Posted by Jiltin     15 April, 2009    1,600 views   

The CREATE TABLE statement is used to create a table in MySQL.

Syntax:

CREATE TABLE table_name
(
column_name1 data_type,
column_name2 data_type,
column_name3 data_type,
….
)

sample

#!/bin/sh
#
# Developed by notesbit
# Shows all users and the user status
#
#mysql> desc user_transactions;
#+——————+————-+——+—–+——————-+——-+
#‘ Field            ’ Type        ‘ Null ‘ Key ‘ Default           ‘ Extra
#+——————+————-+——+—–+——————-+——-+
#’
appl_name        ‘ varchar(20) ‘ YES  ‘     ‘ NULL              ‘       ‘
#‘ computer_id      ’ varchar(20) ‘ YES  ’     ‘ NULL              ’      
#’
motherboard_id   ‘ varchar(20) ‘ YES  ‘     ‘ NULL              ‘       ‘
#‘ public_ip        ’ varchar(20) ‘ YES  ’     ‘ NULL              ’      
#’
user_name        ‘ varchar(20) ‘ YES  ‘     ‘ NULL              ‘       ‘
#‘ transaction_date ‘ timestamp   ‘ NO   ‘     ‘ CURRENT_TIMESTAMP ‘      
#+——————+————-+——+—–+——————-+——-+
#
mysql <<ENDOF
use testdb;
drop table user_transactions;
create table user_transactions
(
        appl_name                       varchar(20),           
        computer_id                     varchar(20),
        motherboard_id  varchar(20),
        public_ip                       varchar(20),
        user_name                       varchar(20),
        transaction_date  TIMESTAMP DEFAULT NOW()        
);
ENDOF

Following Google Searches Lead To This Post: mysql shell script example
bash script add to mysql database
mysql create table bash script
example of a table shell
mysql statement example
shell script to create a mysql table
mysql bash script example
how to add timestamp to a table name in a table create statement in Oracle APPS
insert mysql bash
bash mysql insert
bash mysql examples
create mysql table c# example
bash mysql create-table
bash mysql sample
mysql insert from bash script
bash script create tables
mysql create table c#
sample create table in mysql
mysql command from bash shell create database
how to drop table with bash script
bash script mysql timestamp
nsis “create database” oracle
sample create tables
nsis mysql create table
create table samples
create wordpress table mysql
script shell create table
bash create mysql table
create a mysql database from bash
shell script to create new table in mysql
bash create table bash
bash script insert to mysql
bash create database ‘
shell script example using mysql database create table
bash mysql CREATE TABLE
mysql statemen in a bash shell
create table script+nsis
mysql update from bourne shell
script bash creation table mysql
BASH Scripting for MySQL create a table
bash script to take details from mysql
create a table in mysql credit card
create table oracle à partir d’un script shell bash
shell script+ssh+mysql+insert
“create table” statement examples
create database bash shell mysql
mysql create table examples
mysql script example bash
mySql C# Drop Table
mysql create table from shell script
mysql nsis create table
sample create script for mysql
mysql bash sample
mysql statements in bash
create tables on mysql in bash scripting
create table from bash script
shell script to create a table in database
sample mysql statement
bash shell to add table to mysql
shell scripts mysql create table
Sample create table statement in oracle
bash shell with mysql
mysql create table from bash
bash shell script + Mysql + insert
dynamically create database table using bash
linux mysql create table from bash script
delete mysql tables with bash
“add table” wp database mysql posts
linux bash mysql create table
bash script create database mysql
create mysql table shell script
nsis mysql
create table mysql mit c#
Bash script for create tables in mysql
mysql sample create table
bash mysql create database
shell create table comment
mysql update shell script
mysql snippets

Post to Twitter  Post to Delicious  Post to Digg    Post to StumbleUpon

Categories : MySQL, Web Mysql Tags : ,

Comments

No comments yet.


Leave a comment

(required)

(required)