0% found this document useful (0 votes)
2 views4 pages

Advanced DB LAB 2

The document provides instructions for creating and populating two database tables: 'Teacher' and 'emp'. It includes SQL statements for creating the tables, inserting data, and selecting all records from each table. The 'Teacher' table contains information about teachers, while the 'emp' table contains employee details including job roles and salaries.

Uploaded by

23-20911-060
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views4 pages

Advanced DB LAB 2

The document provides instructions for creating and populating two database tables: 'Teacher' and 'emp'. It includes SQL statements for creating the tables, inserting data, and selecting all records from each table. The 'Teacher' table contains information about teachers, while the 'emp' table contains employee details including job roles and salaries.

Uploaded by

23-20911-060
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Fatima Jinnah Women University

Advanced Database Management System


Lab # 2
➢ Create Table.
To create a table, you can give the following statement

STUDENT TABLE:
Create table Teacher(
name varchar2(20),
age int,
course varchar2(20),
gender varchar2(10));

insert into teacher values( 'M. SHOAIB ',35,'ADVANCED DBMS','MALE');


insert into teacher values( 'QURAT-UL-AIN ',29,'DBMS','FEMALE');
insert into teacher values( 'ADEEL KHALID ',55,'OOP','MALE');
insert into teacher values( 'AIMEN NAEEM ',30,'ADVANCED DBMS','FEMALE');
insert into teacher values( 'MAJID SHAFIQUE ',52,'COAL','MALE');
Fatima Jinnah Women University

SELECT * FROM Teacher;

OUTPUT SCREEN:

EMPLOYEE TABLE:
create table emp (empno number(5) primary key,
Fatima Jinnah Women University

name varchar2(20),
sal number(10,2),
job varchar2(20),
mgr number(5),
Hiredate date,
comm number(10,2));

INSERT INTO emp VALUES (1, 'Rida Tahir', 50000, 'Manager',


NULL, TO_DATE('2022-05-10', 'YYYY-MM-DD'), 5000);
INSERT INTO emp VALUES (2, 'Fatima Noor', 40000.00,
'Developer', 1, TO_DATE('2023-03-15', 'YYYY-MM-DD'),
NULL);
INSERT INTO emp VALUES (3, 'Mariha Malik', 45000.00,
'Analyst', 1, TO_DATE('2022-07-21', 'YYYY-MM-DD'), 3000);
INSERT INTO emp VALUES (4, 'Muneeba Jamil', 38000.00,
'HR', 2, TO_DATE('2021-09-18', 'YYYY-MM-DD'), NULL);
Fatima Jinnah Women University

select * from emp;

You might also like