DataBase project physical design
DataBase physical design
//Table:
/*student*/
create table student(
id int not null primary key, /*学号*/
name varchar(20) not null, /*姓名*/
college varchar(20) not null, /*学院*/
grade int not null, /*年级*/
gender varchar(6) not null, /*性别*/
age int not null /*年龄*/
);
Table student(学生信息)
| id | name | college | grade | gender | age |
|---|---|---|---|---|---|
| 14001 | pual | CS | junior | male | 20 |
| 14002 | alice | AD | junjor | femele | 21 |
可按上述表格形式插入
/*study*/
create table curriculum(
s_id int not null, /*学号*/
c_id int not null /*课程号*/
constraint c_id_fk foreign key (c_id) references course(c_id)
);
Table curriculum(课表)
| s_id | c_id |
|---|---|
| 14001 | 9001 |
| 14001 | 9002 |
| 14002 | 9001 |
| 14002 | 9003 |
| 14003 | 9004 |
/*study*/
create table course(
c_id int not null constraint primary key, /*课程号*/
teacher varchar(20) not null, /*老师*/
credit int not null, /*学分*/
signed int not null, /*签到率*/
c_difficulty int not null /*课程难度*/
);
Table course
| c_id | c_name | teacher | signed(10) | c_difficulty(10) |
|---|---|---|---|---|
| 9001 | DataBase | Dr.Guan JiHong | 10 | 8 |
| 9002 | Computer Graphic | Dr.Zhao Junqiao | 0 | 9 |
| 9003 | Computer Architecture | Dr.Qin Guofeng | 9 | 8 |
| 9004 | Operate System | Dr.Fang Yu | 0 | 8.5 |
/*do*/
create table task(
t_id varchar(7) not null constraint primary key,/*作业号(任务创立日期+编号)*/
/* 格式: Year+M + D + number
e.g 7 + 12 + 16 + 02 */
t_course int constraint t_c_fk
foreign key references course(c_id), /*作业所属课程*/
t_deadline datetime, /*20161210 最后期限*/
t_detail varchar(20), /*详情*/
t_amount int not null, /*1.2.3.4.5 作业数量*/
t_difficulty int not null /*1.2.3.4.5 作业难度*/
);
Table task
| t_id | t_course | t_deadline | t_detail | t_amount(10) | t_difficulty(10) |
|---|---|---|---|---|---|
| 6121601 | 9001 | 2016-12-20 23:59:59 | P232,2/3/5 | 3 | 7 |
| 2 | 9002 | 2017-01-09 23:59:59 | Assignment3 | 2 | 9 |
create table message(
m_id int not null constraint primary key,/*信息号(任务创立日期+编号)
格式: Year+M + D + number
e.g 7 + 12 + 16 + 02 */
type varchar(10) not null, /*
信息类型:
娱乐(entertainment)
兴趣(interest)
工作(job)
学习(study)
信仰(faith)
*/
details varchar(30), /*详情*/
m_deadline datetime, /*最后期限*/
duration datetime, /*持续时间*/
Emergency_index int not null /*1.2.3.4.5 紧急程度*/
);
Table message
| m_id | type | details | Start | End | Emergency_index(10) |
|---|---|---|---|---|---|
| 6120201 | interest | play piano | 2016-12-12 17:30:00 | 2016-12-12-17:59:59 | 9 |
| 6120201 | faith | go to the YangPu church | 2016-12-12 17:30:00 | 2016-12-12-17:59:59 | 9 |
/*live*/
create table birthday(
f_name varchar(20) not null constraint primary key, /*姓名*/
relation varchar(10) not null, /*关系*/
current_age int not null, /*当前年龄*/
f_gender varchar(6) not null, /*性别*/
f_birthdat datetime not null, /*生日*/
gift varchar(1) not null /*是否需要礼物*/
);
| f_name | relation | current_age | f_gender | f_birthday | gift(Y/N) |
|---|---|---|---|---|---|
| Bob | Faother | 34 | male | 2017-09-17 00:00:00 | Y |
| Alice | sister | 23 | female | 2017-02-13 00:00:00 | Y |
| Judy | friend | 20 | female | 2017-02-22 00:00:00 | Y |
以学号建立索引
生日表以姓名建立索引
DataBase project physical design的更多相关文章
- Using MSBuild to publish a VS 2012 SSDT .sqlproj database project
http://blog.danskingdom.com/using-msbuild-to-publish-a-vs-2012-ssdt-sqlproj-database-project-the-sam ...
- use MSBuild cmd to build and deploy the database project.
You can use the below command to implement it. SET TargetDBName="Database name" SET DataBa ...
- Visual Studio 2012创建SQL Server Database Project提示失败解决方法
新建一个SQL Server Database Project,提示: Unable to open Database project This version of SQL Server Data ...
- Physical Standby Database Failover
1.物理standby failover 切换 故障转移时在一些糟糕的事情发生时执行的计划外事件,需要将生产库移动到DR站点.有意思的是,这时候人们通常忙来忙去,试图弄明白发生了什么,需要做些什么才能 ...
- Vivado Design Suite用户指南之约束的使用第二部分(约束方法论)
Constraints Methodology(约束方法论) 关于约束方法论 设计约束定义了编译流程必须满足的要求,以使设计在板上起作用. 并非所有步骤都使用所有约束在编译流程中. 例如,物理约束仅在 ...
- 如何rename sqlserver database
Problem Sometimes there is a need to change the name of your database whether this is because the or ...
- Quality in the Test Automation Review Process and Design Review Template
About this document Prerequisite knowledge/experience: Software Testing, Test Automation Applicable ...
- SMTS Silicon Design Engineer Location: Beijing, Beijing, CN
https://jobs.amd.com/job/Beijing-Physical-Design-Engineer-Beij/603603700/?locale=en_US What you do a ...
- 11g Physical Standby配置
一,准备 Database DB_UNIQUE_NAME Oracle Net Service Name Primary PROD PROD Physical standby PRODDG PRO ...
随机推荐
- sortable实现拖拽功能
使用sortable这个强力插件就很容易实现拖拽功能,它是目前比较牛逼的拖拽插件,无需jquery,就可以全面支持pc和移动,参考以下github文档就有很详细的说明,也给了很多 demo,插件就用我 ...
- Kattis - fence2【二分法】
Kattis - fence2[二分法] 题意 有一个农夫需要建造一个 N - 1 米长的篱笆,需要 N 根柱子,然后有 K 根 柱子 需要将这 K 根柱子 切成 N 段 然后 要尽量保证这 N 段柱 ...
- cdoj1334郭大侠与Rabi-Ribi
地址:http://acm.uestc.edu.cn/#/problem/show/1334 题目: 郭大侠与Rabi-Ribi Time Limit: 3000/1000MS (Java/Other ...
- python的垃圾回收机制 继承的顺序C3算法
Python垃圾回收 -- 引用计数 -- Python为每个对象维护一个引用计数 -- 当引用计数为0的 代表这个对象为垃圾 -- 标记清除 - ...
- 程序员、架构师、技术总监、CTO
程序员 程序员,英文名coder/programmer,大家常自嘲叫码农的阶段.这个角色职责是把需求或产品实现为用户可用的软件产品. 此职位为执行级别.另外因为经验较少,一般需要求助别人,或与别人一起 ...
- 20145219 《Java程序设计》实验五 Java网络编程及安全实验报告
20145219 <Java程序设计>实验五 Java网络编程及安全实验报告 实验内容 1.掌握Socket程序的编写: 2.掌握密码技术的使用: 3.设计安全传输系统. 实验步骤 我和2 ...
- Linux常用命令--文件(夹)查找之find命令
Linux系统用得越久,就会发现这真的是一个很优秀的系统,各种方便各种实用各种高效率. 晚饭前写一下find命令的笔记. 其实这篇笔记,也是看到一篇外文博客,写得不错,自己拿来练一练,然后才顺便写篇笔 ...
- 20145109 《Java实验报告1》
Experiment Ⅰ --getting familiar with JDK (Linux + Eclipse) Content 1.Compile and run easy Java progr ...
- shell-一些有趣的使用
1. 对字符串进行MD5加密 echo test |md5sum|awk '{print $1}' 字符串数量很多时可以这样做: echo test |md5sum|awk '{print $1}' ...
- [Android]android Service后台防杀
网上有很多办法,方法一:在JNI里面fork出子进程service在单独的进程中,在service中调用JNI的代码,然后fork出一个进程,然后让我们的service进程和fork出来的子进程一直运 ...