79472
mysq1>CREATE TABLE pet (name VARCHAR(20), owner VARCHAR(20), ->species VARCHAR(20), sex CHAR(l), birth DATĘ, death DATĘ);
VARCHAR is a good choice for the name, owner, and species columns because the column values
vary in length. The lengths in those column definitions need not all be the same, and need not be 20.
You can normally pick any length from l to 65535, whatever seems most reasonable to you. If you
make a poor choice and it turns out later that you need a longer field, MySQL provides an alter table statement.
Several types of values can be chosen to represent sex in animal records, such as 'm' and ' f', or
perhaps ' małe' and 1 female'. It is simplest to use the single characters 'm' and ' f'.
The use of the DATĘ data type for the birth and death columns is a fairly obvious choice.
Wyszukiwarka
Podobne podstrony:
/ PROMPT Creating Table GROMADY CREATE TABLE GROMADY (NAZWA VARCHAR2(20) NOT NULL ,GRO_ICREATE TABLE KIEROWNICY (NAZWISKO VARCHAR2(20) NOT NULL ,KIE_ID NUMBER(8) NOT NULL ,IMIĘCREATE TABLE Droga ( nazwa VARCHAR(20) PRIMARY KEY, szczyt VARCHAR(15) REFERENCES Szczyt, trudn70990 skanuj0267 (3) Rozdział 10. ♦ Podstawy SQL 281 CREATE TABLE Klient( Indeks INTEGER. NazwaSQL Statement: CREATE TABLE Heroes (id int, name varchar(25), siblings int); Edit the SQL Statement,skanuj0315 (2) 330 PHP i MySQL dla każdego CREATE TABLE Autorzy( Id INTEGER PRIMARY KEY. Imię VARCHAPrzykład:Create Table Nagrania (ID Char(lO), Tytuł Varchar2(30), Opis Varchar2(2000), Wykonawcabaza fiz magazyn _J unit Y id_unit INT name VARCHAR(20)CREATE TABLE Wydawnictwo ( ID INT PRIMARY KEY, Nazwa VARCHAR(45), Adres VARCHAR<45)I); NastępnymCREATE TABLE Ksiazka ( ID INT PRIMARY KEY, Tytuł VARCHAR(45), LiczbaStr tinyint, W_ID INT, CONSTRAINf10 2 Create Your User Name To create a User Name, you must enter sonie information ab out yourselfwięcej podobnych podstron