+ 3
How to create a new table?
7 odpowiedzi
+ 5
careful with varchar(255)
it reserves the space in the database. so if you want to store small strings, only reserve what you need. that's important for really large databases, but it's a good practice to do it with all your tables.
I've seen database where every column was of type text. even the integers. that's totally messed up...
+ 3
Syntax
CREATE TABLE table_name (
column1 datatype,
column2 datatype,
column3 datatype,
....
);
Example
CREATE TABLE Persons (
PersonID int,
LastName varchar(255),
FirstName varchar(255),
Address varchar(255),
City varchar(255)
);
+ 3
what's the meaning of 225?
+ 3
225 refers to number of characters ..
+ 1
how many bit it will be taken?
+ 1
create tablename (Columnname1 datatype(size/length),Columnname2 ......)
0
varcahr(255) length of the string value