🤖 Ai回答: Here's a basic MySQL script example that you can use to execute SQL commands、Replace the placeholders with your actual database name, table name, column names, and values when running this script:
sql
Sample MySQL Script (execute in MySQL client or script file)
USE your_database_name;
Create a table
CREATE TABLE IF NOT EXISTS your_table (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100) NOT NULL,
age INT DEFAULT 30
);
Insert sample data
INSERT INTO your_table (name, age)
VALUES ('John Doe', 25), ('Jane Smith', 30);
Query all records
SELECT * FROM your_table;
How to Use:
1、Save the script as a `.sql` file (e.g., `your_script.sql`).
2、Run it in a MySQL client or an SQL server (e.g., `mysql -u username -p`).
3、Replace `your_database_name`, `your_table`, and the values inside `INSERT` with your actual DB and table details.
Let me know if you'd like a script for a specific task!