-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadditional.sql
More file actions
39 lines (39 loc) · 975 Bytes
/
additional.sql
File metadata and controls
39 lines (39 loc) · 975 Bytes
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
create database rashmi;
use rashmi;
create table instructors(
`name` varchar(50),
emp_id int primary key,
ssn int,
dob varchar(50),
email varchar(50),
salary int
);
create table courses(
title_s varchar(50),
course_id int primary key,
emp_id int, foreign key (emp_id) references instructors(emp_id),
title varchar(50), foreign key (title) references programs(title),
`time` time,
location varchar(50),
`description` varchar(50)
);
create table programs(
title varchar(50) primary key,
chair int,
office varchar(50),
contact int,
`description` varchar(50)
);
create table students(
name varchar(50),
stu_id int primary key,
dob date,
email varchar(50)
);
create table program_student(
title varchar(50), foreign key (title) references programs(title),
stu_id int, foreign key (stu_id) references students (stu_id),
primary key(title, stu_id)
);
insert instructors values ('Trishna', 1, 2, '2015-05-12', 'trishna@gmail.com', 5000);
select * from instructors where salary= 5000;