-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGroupChallenge.sql
59 lines (57 loc) · 1.17 KB
/
GroupChallenge.sql
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
create database group_challenge;
use group_challenge;
create table books
(
ISBN int primary key,
b_name varchar(25),
pages int,
editor_id int,
owner_id int
);
describe books;
create table item
(
i_name varchar(25),
i_id int primary key,
i_no int,
ISBN int,
sup_id int
);
describe item;
create table supplier
(
sup_id int primary key,
sup_name varchar(25),
sup_gst int
);
describe supplier;
create table shop_owner
(
owner_id int primary key,
owner_name varchar(25),
no_books int
);
describe shop_owner;
create table author
(
author_name varchar(25),
author_age int,
subject_name varchar(25),
foreign key(subject_name)
references subject1(subject_name)
);
describe author ;
create table subject1
(
subject_name varchar(25) primary key,
subject_id int,
ISBN int
);
describe subject1;
create table editors
(
editor_id int primary key,
editior_name varchar(25)
);
create table written_by(author_name varchar(50),ISBN int, subject_name varchar(25));
describe written_by