-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSqlQuery.sql
49 lines (39 loc) · 1.21 KB
/
SqlQuery.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
drop database hibernate;
create database hibernate;
use hibernate;
show tables;
-- type 1 table per class hierarchy
select * from tabperch;
select * from hibernate_sequence;
drop table tabperch;
drop table hibernate_sequence;
-- type 2 table per Subclass
-- 3 different tables with foreignkey
select * from tabpersubc;
select * from contractualemployee;
select * from permanentemployee;
select * from hibernate_sequence;
describe contractualemployee;
drop table tabperconc;
drop table contractualemployee;
drop table permanentemployee;
drop table hibernate_sequences;
-- type 3 table per concrete class
select * from tabperconc;
select * from contractualemployee;
select * from permanentemployee;
select * from hibernate_sequences;
drop table tabperconc;
drop table contractualemployee;
drop table permanentemployee;
drop table hibernate_sequences;
--
select * from collections;
select * from email;
select * from emails;
select * from phonenumber;
describe collections;
create table employee (id int,name varchar(50),email varchar(50), address varchar(50), age int,salary float, phonenumber long);
select * from employee;
delete from employee where id=101;
update employee set name=null where name="ritesh";