Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
db3
--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 ( dependantname varchar(20) not null, essn varchar(9), bdate date, sex varchar(1), relationship varchar(10), primary key (dependantname) , --foreing key (essn) references employee(ssn) );
run
|
edit
|
history
|
help
0
db6
Admno
Null as default value
Studiu Individual 1
Change
Resolved error
sql
Project 1
search all tables for string
f