当前位置:网站首页>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中右键---逆向表到模型---可以查看所有表的相关属性

边栏推荐
- RS note: industry recommendation system YouTube DNN model (recall layer + sorting layer) [2016 youtube]
- 必会面试题:1.浅拷贝和深拷贝_深拷贝
- 买收益百分之6的理财产品,需要开户吗?
- I'd like to ask if the table creation DDL of ODPs can't be directly executed in MySQL. The string type is incompatible. Can you only adjust this by yourself
- 做一个文艺的测试/开发程序员,慢慢改变自己......
- 你还在使用System.currentTimeMillis()?来看看StopWatch吧
- Beisen prospectus: the advantages of the track are prominent, and integration + medium and large customers are plus points
- 基于TensorFlow和Keras的卷积神经网络实现猫狗数据集分类实验
- Salesforce zero foundation learning (116) workflow - & gt; On flow
- 痞子衡嵌入式:MCUXpresso IDE下将源码制作成Lib库方法及其与IAR,MDK差异
猜你喜欢

Pointrender parsing

Notes of Teacher Li Hongyi's 2020 in-depth learning series 9

salesforce零基础学习(一百一十六)workflow -> flow浅谈

Notes of Teacher Li Hongyi's 2020 in-depth learning series 7

Digital stopwatch based on Verilog HDL

Live broadcast preview | online seminar on open source security governance models and tools

Notes of Teacher Li Hongyi's 2020 in-depth learning series 6

2022 the most NB JVM foundation to tuning notes, thoroughly understand Alibaba P6 small case

Bug summary

Go basic notes_ 4_ map
随机推荐
50 places are limited to open | with the news of oceanbase's annual press conference coming!
The new version of SSM video tutorial in shangsilicon valley was released
Network Security Learning (IV) user and group management, NTFS
Browser cache
Notes of Teacher Li Hongyi's 2020 in-depth learning series 8
Convert a string to an integer and don't double it
价值驱动为商业BP转型提供核心动力——业务场景下的BP实现-商业BP分享
Use of serial queues
Detailed explanation of zhanrui Huben T310: introduce the big core and dynamiq architecture into the entry-level market for the first time!
Architecture design of multi live shopping mall
基于TensorFlow和Keras的卷积神经网络实现猫狗数据集分类实验
Talk about how redis handles requests
HTB-Aragog
What are the meanings and application scenarios of the three giants of cloud computing: IAAs, PAAS and SaaS?
Multithreading & high concurrency (the latest in the whole network: interview questions + map + Notes) the interviewer is calm
How to put long links into Excel
Network Security Learning (V) DHCP
Network Security Learning (I) virtual machine
Answers to some problems encountered in the process of Xperia XZ (f8332) brushing and root
Beisen prospectus: the advantages of the track are prominent, and integration + medium and large customers are plus points