Tables

an anonymous user · January 15, 2022 · SQL
create table Emp(eno int primary key,name varchar (20),dno int, salary numeric,city varchar(20));
insert into Emp values(1,'Punam',10,20000,'Pune');
insert into Emp values(2,'Prachi',11,22000,'Thane');
select*from Emp;
create table Project(pno int primary key,pname varchar(20),control_dno int,budget numeric);
insert into Project values(11,'Hotel mngt system'1101,230000);
insert into Project values(12,'Bank mngt system',1102,300000);
select *from Project;
create table Emp_prj(eno int references Emp (eno),pno int references Project(pno),no_of_days int);
insert into Emp_prj values(1,11,40);
insert into Emp_prj values (2,12,10);
select * from Emp_prj;
  name TEXT NOT NULL,
  gender TEXT NOT NULL
);
-- insert some values
INSERT INTO students VALUES (1, 'Ryan', 'M');
INSERT INTO students VALUES (2, 'Joanna', 'F');
-- fetch some values
SELECT * FROM students WHERE gender = 'F';

Comments

Please sign up or log in to contribute to the discussion.