当前位置:网站首页>Sql文件导入数据库-保姆级教程
Sql文件导入数据库-保姆级教程
2022-07-24 23:38:00 【我今年十六岁】
目录
再点击表----刷新一下-----即可看到所有需要的表都已经被创建好了
main中右键---逆向表到模型---可以查看所有表的相关属性
一:准备工作---.sql文件
首先可以在桌面创建.text文件----修改文件为.sql文件(如下)

二:在编辑工具中打开创建的sql文件---存放指令并保存


/*
Navicat SQLite Data Transfer
Source Server : school
Source Server Version : 30808
Source Host : :0
Target Server Type : SQLite
Target Server Version : 30808
File Encoding : 65001
Date: 2021-12-23 16:06:04
*/
PRAGMA foreign_keys = OFF;
-- ----------------------------
-- Table structure for Course
-- ----------------------------
DROP TABLE IF EXISTS "main"."Course";
CREATE TABLE Course(
courseid integer primary key autoincrement,
courseme varchar(32),
teacherid int
);
-- ----------------------------
-- Records of Course
-- ----------------------------
INSERT INTO "main"."Course" VALUES (3001, '语文', 1001);
INSERT INTO "main"."Course" VALUES (3002, '数学', 1002);
-- ----------------------------
-- Table structure for Mark
-- ----------------------------
DROP TABLE IF EXISTS "main"."Mark";
CREATE TABLE Mark(
userid integer,
courseid integer not null,
score int default 0
);
-- ----------------------------
-- Records of Mark
-- ----------------------------
INSERT INTO "main"."Mark" VALUES (2001, 3001, 89);
INSERT INTO "main"."Mark" VALUES (2001, 3002, 90);
INSERT INTO "main"."Mark" VALUES (2002, 3001, 66);
INSERT INTO "main"."Mark" VALUES (2003, 3002, 85);
-- ----------------------------
-- Records of sqlite_sequence
-- ----------------------------
INSERT INTO "main"."sqlite_sequence" VALUES ('Teacher', 1002);
INSERT INTO "main"."sqlite_sequence" VALUES ('Student', 2002);
INSERT INTO "main"."sqlite_sequence" VALUES ('Course', 3002);
-- ----------------------------
-- Table structure for Student
-- ----------------------------
DROP TABLE IF EXISTS "main"."Student";
CREATE TABLE Student(
userid integer primary key autoincrement,
username varchar(32),
userage int,
usersex varchar(32)
);
-- ----------------------------
-- Records of Student
-- ----------------------------
INSERT INTO "main"."Student" VALUES (2001, '小明', 18, '男');
INSERT INTO "main"."Student" VALUES (2002, '小红', 18, '女');
-- ----------------------------
-- Table structure for Teacher
-- ----------------------------
DROP TABLE IF EXISTS "main"."Teacher";
CREATE TABLE Teacher(
teacherid integer primary key autoincrement,
teachername varchar(32)
);
-- ----------------------------
-- Records of Teacher
-- ----------------------------
INSERT INTO "main"."Teacher" VALUES (1001, '张三');
INSERT INTO "main"."Teacher" VALUES (1002, '李四');
三:右键点击运行SQL文件


打开.sql文件

点击开始,加载完成后点击关闭
再点击表----刷新一下-----即可看到所有需要的表都已经被创建好了





四:在数据库中导出SQL脚本文件

全部记录

选择SQL脚本文件

自己勾选,点击下一步

下一步

下一步

点击开始

加载完成后点击保存

输入111(随意)

回到桌面即可看到导出的sql文件了
将.sql文件拖进编辑器----可以查看相关指令


若是想看表的结果和数据

右键选择---转储SQL文件---结构和数据即可
五:查看表中的相关数据----右键----逆向表到模型




main中右键---逆向表到模型---可以查看所有表的相关属性

边栏推荐
- Modify the existing annotator name in the word document
- Routing policy in republishing
- Do you need to open an account to buy a wealth management product with a 6% income?
- Shell调试Debug的三种方式
- codeforces round #805 ABCDEFG
- Yaml writing rules and comparison between yaml and JSON
- Can Baidu network disk yundetectservice.exe be disabled and closed
- Be an artistic test / development programmer and slowly change yourself
- 代码覆盖率
- Browser cache
猜你喜欢

Introduction to HLS programming

Can Baidu network disk yundetectservice.exe be disabled and closed

多线程&高并发(全网最新:面试题 + 导图 + 笔记)面试手稳心不慌

Multithreading & high concurrency (the latest in the whole network: interview questions + map + Notes) the interviewer is calm

Opengauss kernel analysis: query rewriting

Be an artistic test / development programmer and slowly change yourself

Only by learning these JMeter plug-ins can we design complex performance test scenarios

你还在使用System.currentTimeMillis()?来看看StopWatch吧

每周小结(*66):下一个五年

Go basic notes_ 4_ map
随机推荐
凸优化基础知识
必会面试题:1.浅拷贝和深拷贝_浅拷贝
Simple message queue implementation nodejs + redis =mq
Install Kaspersky 2018 under win server 2012 R2
How to propose effective solutions for high-end products? (1 methodology + 2 cases + 1 List)
With screen and nohup running, there is no need to worry about deep learning code anymore | exiting the terminal will not affect the operation of server program code
常用在线测试工具集合
Paper time review MB2: build a behavior model for autonomous databases
来自大佬洗礼!2022 头条首发纯手打 MySQL 高级进阶笔记, 吃透 P7 有望
Answers to some problems encountered in the process of Xperia XZ (f8332) brushing and root
dpkg : Breaks: libapt-pkg5.0 (< 1.7~b) but 1.6.15 is to be installedE: Broken packages
LP liquidity pledge mining system development detailed procedure
Piziheng embedded: the method of making source code into lib Library under MCU Xpress IDE and its difference with IAR and MDK
Routing policy in republishing
Implementation of cat and dog data set classification experiment based on tensorflow and keras convolutional neural network
Is the income of CICC securities' new financial products 6%? I want to open an account and manage money
Are you still using system. Currenttimemillis()? Take a look at stopwatch
Paper notes: accurate causal influence on discrete data
基于TensorFlow和Keras的卷积神经网络实现猫狗数据集分类实验
In pgplsql: = and=