-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstudent_homework.sql
More file actions
40 lines (33 loc) · 1.3 KB
/
student_homework.sql
File metadata and controls
40 lines (33 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
Navicat Premium Data Transfer
Source Server : postgre
Source Server Type : PostgreSQL
Source Server Version : 90601
Source Host : localhost
Source Database : java2016
Source Schema : public
Target Server Type : PostgreSQL
Target Server Version : 90601
File Encoding : utf-8
Date: 12/25/2016 14:53:18 PM
*/
-- ----------------------------
-- Table structure for student_homework
-- ----------------------------
DROP TABLE IF EXISTS "public"."student_homework";
CREATE TABLE "public"."student_homework" (
"stu_id" varchar(13) NOT NULL COLLATE "default",
"homework" int2 NOT NULL,
"score" int2,
"note" text COLLATE "default"
)
WITH (OIDS=FALSE);
ALTER TABLE "public"."student_homework" OWNER TO "postgres";
-- ----------------------------
-- Primary key structure for table student_homework
-- ----------------------------
ALTER TABLE "public"."student_homework" ADD PRIMARY KEY ("stu_id", "homework") NOT DEFERRABLE INITIALLY IMMEDIATE;
-- ----------------------------
-- Foreign keys structure for table student_homework
-- ----------------------------
ALTER TABLE "public"."student_homework" ADD CONSTRAINT "stu_id_fkey" FOREIGN KEY ("stu_id") REFERENCES "public"."student" ("stu_id") ON UPDATE SET NULL ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE;