Run Code
|
API
|
Code Wall
|
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
SS my sql server 2014 4/7
SQL left join
new
Conditional Operator (IIF)
Campeonato2DLuizFelipe
Microsoft SQL Server T-SQL in 10 mn ~ Lesson 13 Subqueries samples...
TUAN 7_QUAN LY DE TAI
Max from multiple columns
QLCB_BTVN_TUAN 8
SI 1