Initial commit
This commit is contained in:
17
create_users_table.sql
Normal file
17
create_users_table.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
-- 建立 users 資料表
|
||||
CREATE TABLE IF NOT EXISTS users (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
name VARCHAR(100) NOT NULL,
|
||||
email VARCHAR(100) NOT NULL,
|
||||
age INT NOT NULL,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
-- 插入一些測試資料
|
||||
INSERT INTO users (name, email, age) VALUES
|
||||
('張三', 'zhang@example.com', 25),
|
||||
('李四', 'li@example.com', 30),
|
||||
('王五', 'wang@example.com', 22),
|
||||
('趙六', 'zhao@example.com', 35),
|
||||
('孫七', 'sun@example.com', 28);
|
Reference in New Issue
Block a user