sqlite 怎么设定外键啊

快乐大法师 2010-12-08 11:02:18
RT
...全文
569 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
wwwwb 2010-12-08
  • 打赏
  • 举报
回复
PRAGMA foreign_keys = ON;
wwwwb 2010-12-08
  • 打赏
  • 举报
回复
从SQLite 3.6.19 开始支持 外键约束
CREATE TABLE artist(
artistid INTEGER PRIMARY KEY,
artistname TEXT
);
CREATE TABLE track(
trackid INTEGER,
trackname TEXT,
trackartist INTEGER,
FOREIGN KEY(trackartist) REFERENCES artist(artistid)
);
ACMAIN_CHM 2010-12-08
  • 打赏
  • 举报
回复
你的版本是多少?
SQLite Expert: A powerful administration tool for your SQLite databases Are you developing SQLite3 databases and need an easy and powerful tool? SQLite Expert is the perfect choice. It is the most feature rich administration and development tool for SQLite. SQLite Expert is designed to answer the needs of all users, from writing simple SQL queries to developing complex databases. The graphical interface supports all SQLite features. It includes a visual query builder, an SQL editor with syntax highlighting and code completion, visual table and view designers and powerful import and export capabilities. Supported platforms: Windows 2000, XP, Vista, 7. Visual SQL Query Builder Build complex SQL queries with ease. Formatted SQL query text layout. Powerful means of SQL query parsing and analysis. Advanced SQL editor with syntax highlighting and code completion. Powerful restructure capabilities Visual editors for table columns, indexes, foreign keys, triggers, unique and check constraints. Restructure any complex table without losing data. Any restructure operation is wrapped in a nested transaction which is rolled back if any errors occur when applying changes. Import and Export data Import data from ADO data source, CSV files, SQL script or SQLite. Export data to CSV files, SQL script, Excel or SQLite. Copy tables between SQLite databases using drag and drop operations. Export data to Excel via clipboard. Data editing Edit data in the grid using powerful in-place editors. Image editor currently supporting JPEG, PNG, BMP, GIF and ICO image formats. Visualize and modify BLOB fields using the integrated Hex editor. Other features Full Unicode support. Support for attached databases. Support for encrypted databases. Lua and Pascal scripting support. Recent features View all the functions and collations installed by each SQLite extension! New in 3.0: Customize the look and feel of the application using skins. New in 3.0: Send the contents of any grid to printer or export it to a PDF file. SQLite的专家:一个强大的管理工具,为您的SQLite数据库 你发展sqlite3的数据库,并需要一个简单而强大的的工具? SQLite的专家是最完美的选择。它是功能最丰富的管理和对SQLite的开发工具。 SQLite的专家的目的是回答所有用户的需求,编写简单的SQL查询,以开发复杂的数据库。 图形界面,支持所有的SQLite功能。它包括一个可视化查询生成器,SQL编辑器与语法高亮和代码完成,视力表和视图设计师和强大的进口和出口能力。 支持平台:视窗2000,XP,VISTA,7。 可视SQL查询生成器 轻松建立复杂的SQL查询。 格式化的SQL查询文本布局。 SQL查询解析和分析的有力手段。 高级SQL编辑器与语法高亮和代码完成。 强大的重组功能 表列,索引,外键,触发器,独特和检查约束的可视化编辑器。 任何复杂的表,而不会丢失数据重组。 任何重组操作被包裹在一个嵌套事务回滚,如果发生任何错误更改应用时。 导入和导出数据 从ADO数据源,CSV文件,SQL脚本或SQLite导入数据。 数据导出到CSV文件,SQL脚本,Excel或SQLite的。 使用拖放操作之间的SQLite数据库复制表。 通过剪贴板中的数据导出到Excel。 数据编辑 在使用功能强大的就地编辑网格的编辑数据。 图像编辑器目前支持JPEG,PNG,BMP,GIF和ICO图像格式。 使用集成的十六进制编辑器可视化和修改BLOB字段。 其他特点 完整的Unicode支持。 支持附加的数据库。 支持加密的数据库。 Lua和Pascal的脚本支持。 最新功能 查看所有的功能和安装排序规则每个SQLite扩展! 在3.0的新功能:自定义的外观和感觉的应用程序使用外观。 在3.0的新功能:发送到打印机的网格任何内容或将其导出到一个PDF文件。

2,209

社区成员

发帖
与我相关
我的任务
社区描述
其他数据库开发 其他数据库
社区管理员
  • 其他数据库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧