Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Old 10-22-2008, 03:17 PM MYSQL True or faluse
millwalll's Avatar
Webmaster Talker

Posts: 674
Name: James
Location: KENT
Trades: 3
Hi all,

I am pretty new to MYSQL I am creating a table and have got a few question.

1)How do I set a boolean Value True/False is it case of

DelPresenter bool not null,

2)This is the code for my first table (below) my question is the engine = innodb do I have to have this line for every table I make ??

create table delegate
(DelNo int not null,
DelName varchar() not null,
DelAddress varchar() not null,
DelTelphone varchar(),
DelPresenter bool,
primary key (DelNo))
engine = innodb;

many thanks
__________________

Please login or register to view this content. Registration is FREE
millwalll is offline
Reply With Quote
View Public Profile Visit millwalll's homepage!
 
 
Register now for full access!
Old 10-22-2008, 04:29 PM Re: MYSQL True or faluse
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
1/
Yep

or DelPresenter TINYINT(1) not null,

BOOL & BOOLEAN are synonyms for TINYINT(1) and zero values are false all non-zero values are true.

2/ Yes if you want to use InnoDB as the storage engine for your database.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-22-2008, 04:49 PM Re: MYSQL True or faluse
millwalll's Avatar
Webmaster Talker

Posts: 674
Name: James
Location: KENT
Trades: 3
Hi thanks Chris one more question when we have bit code like this what does the 15 mean is it how many characters it can hold ?

DelName varchar(15)
__________________

Please login or register to view this content. Registration is FREE
millwalll is offline
Reply With Quote
View Public Profile Visit millwalll's homepage!
 
Old 10-22-2008, 04:50 PM Re: MYSQL True or faluse
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
yep ...
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-22-2008, 04:51 PM Re: MYSQL True or faluse
millwalll's Avatar
Webmaster Talker

Posts: 674
Name: James
Location: KENT
Trades: 3
your a star
__________________

Please login or register to view this content. Registration is FREE
millwalll is offline
Reply With Quote
View Public Profile Visit millwalll's homepage!
 
Old 10-24-2008, 03:36 PM Re: MYSQL True or faluse
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
Quote:
Originally Posted by millwalll View Post
Hi thanks Chris one more question when we have bit code like this what does the 15 mean is it how many characters it can hold ?

DelName varchar(15)
It means the column can store anywhere from 0 to 15 characters. If you only ask it to store 3 bytes, it won't pad the other 12. BUT the database incurs some overhead (15 bytes in SQL Server, ironically) to manage a variable character column. Generally people use them with larger ranges, ie varChar(230), and in this case you basically pay for what you use.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to MYSQL True or faluse
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.56088 seconds with 12 queries