IITDU Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

MYSQL commands Collection

2 posters

Go down

MYSQL commands Collection Empty MYSQL commands Collection

Post by BIT0122-Amit Sun Oct 24, 2010 11:33 pm

Don't get too happy. I don't plan to give completely all mysql commands for you here.
yeah, I am going give some, you are going to give some, and together, we are going to give all necessary commands here.
Ibrahim helped a lot by providing some necessary SQL commands collection as well.

You can take a look at at some mysql command structures from here:

[You must be registered and logged in to see this link.]

Making account table:


Code:
create table account (
account_no varchar(10) PRIMARY KEY,
bank_name varchar(15),
balance smallint(10) );

Delete a table:

Code:
drop table account;

Add a column:


Code:
alter table account add newcolumn Text(10);

Delete a Column:

Code:
alter table account drop new;

Update a value:

Code:
update account set new="newvalue" where bank_no="Round Hill";

Export data from table:

Code:
select * from account into outfile '/tmp/account.o'
fields terminated by ','
lines terminated by '\r';

Import data to table:
Code:

load data local infile '/tmp/account'
into TABLE account
fields terminated by ','
lines terminated by '\n';

Create Webpage:

Code:
CREATE TABLE webpage ( id MEDIUMINT NOT NULL AUTO_INCREMENT,
Content TEXT,
Title VARCHAR(50),
PRIMARY KEY (id));

create Log:

Code:
CREATE TABLE Log ( ID MEDIUMINT
NOT NULL
AUTO_INCREMENT
PRIMARY KEY,
DateCreated DATE,
Browser VARCHAR(50),
IPNumber VARCHAR(15),
WebpageID MEDIUMINT,
CookieID MEDIUMINT,
ReferringPage VARCHAR(255) );

Export table for Log:

Code:
1,2002-01-01,Mozilla/4.0,192.168.1.10,2,1,http://yahoo.com
2,2003-02-01,Mozilla/4.0,192.168.1.10,2,2,http://minbar.homeip.net/
3,2001-04-01,Mozilla/4.0,192.168.1.10,2,3,http://www.google.com
4,2004-01-01,Mozilla/4.0,192.168.1.10,2,1,http://www.easyrew.com
5,2005-04-04,Mozilla/4.0,192.168.1.10,2,1,http://www.kli.org


Last edited by LordAmit on Tue Oct 26, 2010 5:17 am; edited 1 time in total
BIT0122-Amit
BIT0122-Amit
Founder
Founder

Course(s) :
  • BIT

Blood Group : O+
Posts : 4187
Points : 6605

https://iitdu.forumotion.com

Back to top Go down

MYSQL commands Collection Empty Re: MYSQL commands Collection

Post by BIT0129-Tabassum Mon Oct 25, 2010 4:53 am

Thanks a lot Amit.
I would be very glad if I could contribute here.
But I don't know more Crying or Very sad

rep++
BIT0129-Tabassum
BIT0129-Tabassum
Global Moderator
Global Moderator

Course(s) :
  • BIT

Blood Group : A+
Posts : 1496
Points : 2298

http://probe-tabassum.blogspot.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum