Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
№1
create table dept( dept_id int NOT NULL PRIMARY KEY, dname VARCHAR(20) not null); create table emp( emp_id int NOT NULL PRIMARY KEY, dept_id int FOREIGN KEY references dept(dept_id), ename VARCHAR(15), salary numeric(6,2)) insert into dept values (1, 'Marketing') insert into dept values (2, 'RD') insert into emp values (1, 1, 'James', 1000) insert into emp values (2, 2, 'Smith', 2000) create table dept_arch( dept_arch_id int NOT NULL PRIMARY KEY, dname VARCHAR(20) not null); INSERT INTO dept_arch SELECT dept_id, dname FROM dept; UPDATE emp SET salary = salary * 1.15 WHERE ename = 'Smith' UPDATE dept SET dname = 'RandD' DELETE FROM emp WHERE emp_id = 1 DELETE FROM emp drop table emp
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Window Functions - ROW_NUMBER()
Marco - Arvind
Exam_2_Final
Solution 1
Hotel
Comercio
Mass Insert using Except
Insert multiple parent-child records
Hotel BD
RH
Please log in to post a comment.