Database Reference
In-Depth Information
Figure 5.4
The webpage2 table populated from another table.
For example, the following file is a collection of commands that creates a table called
Cookies and fills it with some sample data:
USE mysqlfast;
CREATE TABLE Cookies (CookieID MEDIUMINT
NOT NULL
AUTO_INCREMENT
PRIMARY KEY,
DateCreated DATETIME);
INSERT INTO Cookies (DateCreated) VALUES (“2002-01-01”);
INSERT INTO Cookies (DateCreated) VALUES (“2002-01-02”);
INSERT INTO Cookies (DateCreated) VALUES (“2002-01-04”);
INSERT INTO Cookies (DateCreated) VALUES (“2002-01-07”);
INSERT INTO Cookies (DateCreated) VALUES (“2002-01-13”);
INSERT INTO Cookies (DateCreated) VALUES (“2002-01-22”);
SELECT * FROM Cookies;
Unfortunately, WinMySQLGUI does not support the running of script files, so we need
to use the mysql command line to execute the script. Type the above script into a text editor
such as Notepad and save it as scriptimport.sql in the directory:
C:\mysql\bin
The file needs to be saved within that directory as it is hard to select files from directo-
Search WWH ::




Custom Search