Answer To: Detailed instructions will be provided in attachments. Meet any and all requirements. You will be...
Neha answered on Mar 08 2021
77057 - building DB/77057 - sqlqueries.sql
CREATE TABLE buildingdb.Inspector (
InsID nvarchar(3) Primary Key,
InsName nvarchar(50)
);
INSERT INTO buildingdb.Inspector(InsID,InsName)VALUES
('I11','Jane'),
('I22','Niko'),
('I33','Mick');
CREATE TABLE buildingdb.StaffMember (
SMemberID int Primary Key,
SMemberName nvarchar(50)
);
INSERT INTO buildingdb.StaffMember(SMemberID,SMemberName)VALUES
(5432,'Brian'),
(9876,'Boris'),
(7652,'Caroline');
CREATE TABLE buildingdb.Building (
BuildingID nvarchar(3) Primary Key,
BNoOfFloors int,
BManagerID nvarchar(3)
);
INSERT INTO buildingdb.Building(BuildingID,BNoOfFloors,BManagerID)VALUES
('B1',5,'M12'),
('B2',6,'M23'),
('B3',4,'M23'),
('B4',4,'M34');
CREATE TABLE buildingdb.Manager (
ManagerID nvarchar(3) Primary Key,
MFName nvarchar(50),
MLName nvarchar(50),
MBDate date,
MSalary int,
MBonus int,
MResBuildingID nvarchar(3),
CONSTRAINT FK_BuildingID FOREIGN KEY (MResBuildingID) REFERENCES Building(BuildingID)
);
INSERT INTO...