SQL QUERIES LAB PRACTICE, Lab Reports of Database Management Systems (DBMS)

THESE ARE SOME BASIC DATABASE LABS ASSIGNMENT EASY FOR BEGINNERS..THEY CONTAIN OUPUT PICS AND CODE AS WELL

Typology: Lab Reports

2021/2022

Available from 08/19/2022

SamenKhan
SamenKhan 🇵🇰

231 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
NUST
Military College of Signals,
Rawalpindi.
DATABASE SYSTEM
LAB#3
BATCH-26C
Submitted By:
Aymen Fatima
CMS ID:
345556
Submitted To:
Sir Kabeer Ahmed
DEPARTMENT OF COMPUTER SOFTWARE ENGINEERING.
MILITARY COLLEGE OF SIGNALS.
pf3
pf4
pf5

Partial preview of the text

Download SQL QUERIES LAB PRACTICE and more Lab Reports Database Management Systems (DBMS) in PDF only on Docsity!

NUST

Military College of Signals,

Rawalpindi.

DATABASE SYSTEM

LAB#

BATCH-26C

Submitted By:

Aymen Fatima

CMS ID:

Submitted To:

Sir Kabeer Ahmed

DEPARTMENT OF COMPUTER SOFTWARE ENGINEERING.

MILITARY COLLEGE OF SIGNALS.

EXPERIMENT 3A – Data Definition Languages Lab# 3A EXCERCISE (15 marks) Problem 3A.1 : SQL Query: create table Employee( Empn varchar( 15 ), EmpName varchar( 20 ), Designation char( 20 ), Deapartment char( 20 ), Email varchar( 30 ), Phone varchar( 20 ), Constraint EmpId Primary Key(Empn) ) insert into Employee values ('E- 100','Chuck','Coordinator','Administration','[email protected]',' -3333'), ('E-101','Mary','Manager','Finance','[email protected]', '523- 1111'), ('E-102','Sally','Supervisor','Planning','[email protected]','523-2222'), ('E- 103','Alan','Adminstrator','Administratio','[email protected]','523- 3333'), ('E-104','Qasim','Assistant','Finance','[email protected]','523-1111') select * from employee Table:

Self Referencing entity is also known as Recursive entity. It defines the relationship between the same entity or table as shown in figure. You are required to take any one example of self reference entity and implement it using MS SQL Server. Moreover, enter five sample records. Query create table Student( StudentID varchar( 10 ), FirstName varchar( 30 ), LastName varchar( 30 ), City char( 15 ), Std_State char( 3 ), StudentIDD varchar( 10 ), Constraint StdID Primary key(StudentID), Constraint Pre_StdID Foreign key(StudentIDD) references Student(StudentID) ) insert into Student values insert into Student values ('S-001','Hadeed','Naeem','Sialkot','PU',null), ('S-002','Ahmed','Suleman','Sialkot','PU','S-001'), ('S-003','Ehtisham','Ahmed','Okara','PU','S-002'), ('S-004','Haris','Rauf','Peshawar','KPK','S-001'), ('S-005','Babar','Azam','Karachi','Sd','S-004') select* from Student Table output :

Diagram of Self reference entity :