Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
db2
--Sql Server 2014 Express Edition --Batches are separated by 'go' select @@version as 'sql server version' create table employee ( lname varchar(20) not null, fname varchar(20) not null, ssn varchar(9), superssn varchar(9), bdate date, address varchar(20), sex varchar(1), salary decimal(4), dno varchar(1), primary key (ssn) , --foreign key (superssn) references employee(ssn) --foreign key (dno) references department(dnumber) ); create table department ( dname varchar(20) not null, mgrssn varchar(9), mgrstartdate date, dnumber decimal(4), primary key (dnumber) , ); create table deptlocations ( dlocation varchar(15), dnumber decimal(4), primary key (dlocation) , --foreing key (dnumber) references department (dnumber) ); create table project( pname varchar(20) not null, pnumber varchar(2), plocation varchar(15), dnum varchar(1), primary key (pnumber) , --foreing key (dnum) references department(dnumber) ); create table workson ( deptname varchar(20) not null, pno varchar(1), dnumber decimal(4), --foreing key (essn) references employee(ssn) --foreing key (pno) references project (pnumber) ); create table dependant ( deptname varchar(20) not null, pno varchar(1), dnumber decimal(4), primary key (dnumber) , --foreing key (pno) references projects(pnumber) );
run
|
edit
|
history
|
help
0
REGISTRO_ESTUDIANTES
Insert multiple parent-child records
Mahi
GKM_JOIN
store1
hello
dbms pracs
Where, And
28-02
T-SQL CRUD procedures auto-generator