Skip to content

Commit d213af4

Browse files
committed
Create Journal_Question.sql to define Journals database and related tables
1 parent 43a34ea commit d213af4

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

Journal_Question.sql

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
create database Journals;
2+
use Journals;
3+
4+
create table Journal (
5+
JID varchar(10) Primary key,
6+
J_Name varchar(40) not null,
7+
`Index` VARCHAR(20) not null,
8+
Fee Decimal(10,2) not null);
9+
10+
insert into Journal (JID, J_Name, `Index`, Fee)
11+
VALUES
12+
('J01', 'IEEE TSC', 'SCI-E', 200000.00),
13+
('J02', 'IJWSR', 'SCI-E', 150000.00),
14+
('J03', 'IJIR', 'ΕΙ', 50000.00);
15+
16+
select * from Journal;
17+
18+
create temporary table Temp_Journal as
19+
select J_name, `Index`
20+
from Journal ;
21+
22+
select * from Temp_Journal;
23+
24+
create temporary table Journal_fee as
25+
select J_Name
26+
from Journal
27+
where Fee < (select AVG(fee) from Journal);
28+
29+
select * from Journal_fee;
30+

0 commit comments

Comments
 (0)