Advertisement
exihs

Untitled

Jan 12th, 2024 (edited)
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 29.51 KB | None | 0 0
  1. /* Staff table */
  2. CREATE TABLE Staff
  3. (
  4. StaffID smallint,
  5. StaffName VarChar(70) NOT NULL,
  6. StaffContactNo Char(8) NOT NULL,
  7. StaffDateJoined smalldatetime NOT NULL,
  8. StaffRole VarChar(50) NOT NULL,
  9. CONSTRAINT PK_Staff PRIMARY KEY (StaffID)
  10. );
  11.  
  12. /*Condo table*/
  13. CREATE TABLE Condo
  14. (
  15. CondoID smallint,
  16. CondoName varchar(50) NOT NULL,
  17. CondoAddress varchar(150) NOT NULL,
  18. CONSTRAINT PK_Condo PRIMARY KEY (CondoID)
  19. );
  20.  
  21. /*Account table*/
  22. CREATE TABLE Account
  23. (
  24. AccID Char(10),
  25. AccName VarChar(70) NOT NULL,
  26. AccAddress VarChar(150) NULL,
  27. AccCtcNo Char(8) NULL,
  28. AccEmail VarChar(50) NULL,
  29. CondoID smallint NOT NULL,
  30. ApprovedBy smallint NOT NULL,
  31. CONSTRAINT PK_Acc PRIMARY KEY (AccID),
  32. CONSTRAINT FK_Acc_Condo FOREIGN KEY (CondoID) REFERENCES Condo(CondoID),
  33. CONSTRAINT FK_Acc_Staff FOREIGN KEY (ApprovedBy) REFERENCES Staff(StaffID)
  34. );
  35.  
  36. /*CondoMgmt table*/
  37. CREATE TABLE CondoMgmt
  38. (
  39. CondoMgmtID Char(10),
  40. ContactPerson VarChar(70) NOT NULL,
  41. CtcPersonMobile  Char(8) NOT NULL,
  42. CONSTRAINT PK_CondoMgmt PRIMARY KEY (CondoMgmtID),
  43. CONSTRAINT FK_CondoMgmt_AccID FOREIGN KEY (CondoMgmtID) REFERENCES Account(AccID)
  44. );
  45.  
  46. /*Announcement table*/
  47. CREATE TABLE Announcement
  48. (
  49. AnnID smallint,
  50. AnnText VarChar(200) NOT NULL,
  51. AnnStartDate smalldatetime NOT NULL,
  52. AnnEndDate smalldatetime NULL,
  53. CondoMgmtID Char(10) NOT NULL,
  54. CONSTRAINT PK_Announcement PRIMARY KEY (AnnID),
  55. CONSTRAINT FK_Announcement FOREIGN KEY (CondoMgmtID) REFERENCES CondoMgmt(CondoMgmtID)
  56. );
  57.  
  58.  
  59. /*Message table*/
  60. CREATE TABLE Message
  61. (
  62. MsgID smallint,
  63. MsgText VarChar(200) NOT NULL,
  64. MsgType VarChar(50) NOT NULL,
  65. PostedBy Char(10) NOT NULL,
  66. ReplyTo smallint NULL,
  67. CONSTRAINT PK_Message PRIMARY KEY (MsgID),
  68. CONSTRAINT FK_Message_PostedBy FOREIGN KEY (PostedBy) REFERENCES Account(AccID),
  69. CONSTRAINT FK_Message_ReplyTo FOREIGN KEY (ReplyTo) REFERENCES Message(MsgID),
  70. CONSTRAINT CHK_Message CHECK (MsgType IN ('Chatterbox', 'Garage Sale', 'Find a Buddy'))
  71. );
  72.  
  73. /*ContactCat table*/
  74. CREATE TABLE ContactCat
  75. (
  76. CtcCatID smallint,
  77. CtcCatDesc varchar(100) NULL,
  78. CONSTRAINT PK_ContactCat PRIMARY KEY (CtcCatID)
  79. );
  80.  
  81. /*Facility table*/
  82. CREATE TABLE Facility
  83. (
  84. FacID smallint,
  85. FacName varchar(50) NOT NULL,
  86. Deposit smallmoney NULL,
  87. CondoID smallint NOT NULL,
  88. CONSTRAINT PK_Facility PRIMARY KEY (FacID),
  89. CONSTRAINT FK_Facility_CondoID FOREIGN KEY (CondoID) REFERENCES Condo(CondoID)
  90. );
  91.  
  92. /*FacTimeSlot table*/
  93. CREATE TABLE FacTimeSlot
  94. (
  95. FacID smallint,
  96. TimeSlotSN smallint,
  97. SlotDesc VarChar(100) NOT NULL,
  98. CONSTRAINT PK_FacTimeSlot PRIMARY KEY (FacID,TimeSlotSN),
  99. CONSTRAINT FK_FacTimeSlot_FacID FOREIGN KEY (FacID) REFERENCES Facility(FacID)
  100. );
  101.  
  102.  
  103. /*FeedbkCat table*/
  104. CREATE TABLE FeedbkCat
  105. (
  106. FbkCatID smallint,
  107. FbkCatDesc varchar(100) NOT NULL,
  108. CONSTRAINT PK_FeedbkCat PRIMARY KEY (FbkCatID)
  109. );
  110.  
  111. /* Feedback table */
  112. CREATE TABLE Feedback
  113. (
  114. FbkID smallint,
  115. FbkDesc VarChar(200) NOT NULL,
  116. FbkDateTime smalldatetime NOT NULL,
  117. FbkStatus VarChar(20) NOT NULL,
  118. ByAccID Char(10) NOT NULL,
  119. FbkCatID smallint NOT NULL,
  120. CondoMgmtID Char(10) NOT NULL,
  121. CONSTRAINT PK_Feedback PRIMARY KEY(FbkID),
  122. CONSTRAINT FK_Feedback_ByAccID FOREIGN KEY(ByAccID) REFERENCES Account(AccID),
  123. CONSTRAINT FK_Feedback_FbkCatID FOREIGN KEY(FbkCatID) REFERENCES FeedbkCat(FbkCatID),
  124. CONSTRAINT FK_Feedback_CondoMgmtID FOREIGN KEY(CondoMgmtID) REFERENCES CondoMgmt(CondoMgmtID)
  125. );
  126.  
  127. /*ItemCategory table*/
  128. CREATE TABLE ItemCategory
  129. (
  130. ItemCatID smallint,
  131. ItemCatDesc varchar(100) NOT NULL,
  132. CONSTRAINT PK_ItemCategory PRIMARY KEY (ItemCatID)
  133. );
  134.  
  135. /*ItemRelated table*/
  136. CREATE TABLE ItemRelated
  137. (
  138. ItemID smallint,
  139. ItemDesc VarChar(200) NULL,
  140. ItemPrice smallmoney NULL,
  141. ItemStatus VarChar(9) NOT NULL,
  142. SaleOrRent Char(4) NOT NULL,
  143. ItemCatID smallint NOT NULL,
  144. CONSTRAINT PK_ItemRelated PRIMARY KEY (ItemID),
  145. CONSTRAINT FK_ItemRelated_ItemID FOREIGN KEY (ItemID) REFERENCES Message(MsgID),
  146. CONSTRAINT CHK_ItemRelated CHECK (ItemStatus IN ('Available', 'Sold', 'Reserved') AND SaleOrRent IN ('Rent','Sale')),
  147. CONSTRAINT FK_ItemRelated_ItemCatID FOREIGN KEY (ItemCatID) REFERENCES ItemCategory(ItemCatID)
  148. );
  149.  
  150. /*ItemPhoto table*/
  151. CREATE TABLE ItemPhoto
  152. (
  153. ItemID smallint,
  154. Photo varchar(100) NOT NULL,
  155. CONSTRAINT PK_ItemPhoto PRIMARY KEY (ItemID,Photo),
  156. CONSTRAINT FK_ItemPhoto_ItemID FOREIGN KEY (ItemID) REFERENCES ItemRelated(ItemID)
  157. );
  158.  
  159. /*BookSlot table*/
  160. CREATE TABLE BookSlot
  161. (
  162. FacID smallint,
  163. TimeSlotSN smallint NOT NULL,
  164. SlotDate smalldatetime NOT NULL DEFAULT(GETDATE()),
  165. SlotStatus VarChar(15) NOT NULL,
  166. CONSTRAINT PK_BookSlot PRIMARY KEY(FacID,TimeSlotSN,SlotDate),  
  167. CONSTRAINT FK_BookSlot FOREIGN KEY(FacID, TimeSlotSN) REFERENCES FacTimeSlot(FacID, TimeSlotSN),
  168. CONSTRAINT CHK_BookSlot CHECK (SlotStatus in ('Booked', 'Available', 'Maintenance'))
  169. );
  170.  
  171. /*Likes table*/
  172. CREATE TABLE Likes
  173. (
  174. AccID Char(10),
  175. MessageID smallint,
  176. CONSTRAINT PK_Likes PRIMARY KEY (AccID, MessageID),
  177. CONSTRAINT FK_Likes_AccID FOREIGN KEY (AccID) REFERENCES ACCOUNT(AccID),
  178. CONSTRAINT FK_Likes_MessageID FOREIGN KEY (MessageID) REFERENCES Message(MsgID)
  179. );
  180.  
  181. /*Owner table*/
  182. CREATE TABLE Owner
  183. (
  184. OwnerID Char(10),
  185. OwnStartDate smalldatetime NOT NULL,
  186. CheckedBy Char(10) NOT NULL,
  187. CONSTRAINT PK_Owner PRIMARY KEY (OwnerID),
  188. CONSTRAINT FK_Owner_OwnerID FOREIGN KEY (OwnerID) REFERENCES Account(AccID),
  189. CONSTRAINT FK_Owner_CheckedBy FOREIGN KEY (CheckedBy) REFERENCES CondoMgmt(CondoMgmtID)
  190. );
  191.  
  192. /*TempVehLabel table*/
  193. CREATE TABLE TempVehLabel
  194. (
  195. VehLblAppID smallint,
  196. TempStartDate smalldatetime NOT NULL,
  197. TempExpiryDate smalldatetime NOT NULL,
  198. CONSTRAINT PK_TempVehLabel PRIMARY KEY (VehLblAppID)
  199. );
  200.  
  201. /*Tenant table*/
  202. CREATE TABLE Tenant
  203. (
  204. TenantID Char(10),
  205. ContractStartDate smalldatetime NOT NULL,
  206. ContractEndDate smalldatetime NULL,
  207. VerifiedBy Char(10) NOT NULL,
  208. CONSTRAINT PK_Tenant PRIMARY KEY (TenantID),
  209. CONSTRAINT FK_Tenant_TenantID FOREIGN KEY (TenantID) REFERENCES Account(AccID),
  210. CONSTRAINT FK_Tenant_VerifiedBy FOREIGN KEY (VerifiedBy) REFERENCES CondoMgmt(CondoMgmtID)
  211. );
  212.  
  213. /* UsefulContact Table */
  214. CREATE TABLE UsefulContact
  215. (
  216. UsefulCtcID smallint,
  217. UsefulCtcName VarChar(50) NOT NULL,
  218. UsefulCtcDesc VarChar(100) NULL,
  219. UsefulCtcPhone Char(8) NOT NULL,
  220. CtcCatID smallint NOT NULL,
  221. CONSTRAINT PK_UsefulContact PRIMARY KEY (UsefulCtcID),
  222. CONSTRAINT FK_UsefulContact_CtcCatID FOREIGN KEY(CtcCatID) REFERENCES ContactCat(CtcCatID)
  223. );
  224.  
  225. /*CondoUsefulContact table*/
  226. CREATE TABLE CondoUsefulContact
  227. (
  228. CondoID smallint,
  229. UsefulCtcID smallint NOT NULL,
  230. CONSTRAINT PK_CondoUsefulContact PRIMARY KEY (CondoID,UsefulCtcID),
  231. CONSTRAINT FK_CondoUsefulContact_CondoID FOREIGN KEY (CondoID) REFERENCES Condo(CondoID),
  232. CONSTRAINT FK_CondoUsefulContact_UsefulCtcID FOREIGN KEY (UsefulCtcID) REFERENCES UsefulContact(UsefulCtcID)
  233. );
  234.  
  235. /*Vehicle table*/
  236. CREATE TABLE Vehicle
  237. (
  238. VehicleNo varchar(10),
  239. IUNo char(10) NOT NULL,
  240. Ownership varchar(50) NOT NULL,
  241. Make varchar(50) NOT NULL,
  242. Model varchar(50) NOT NULL,
  243. CONSTRAINT PK_Vehicle PRIMARY KEY (VehicleNo)
  244. );
  245.  
  246. /*Booking table*/
  247. CREATE TABLE Booking
  248. (
  249. BookingID smallint,
  250. BookingDate smalldatetime NOT NULL,
  251. BookingStatus VarChar(20) NOT NULL,
  252. AccID Char(10) NOT NULL,
  253. FacID smallint NOT NULL,
  254. TimeSlotSN smallint NOT NULL,
  255. SlotDate smalldatetime NOT NULL,
  256. CONSTRAINT PK_Booking PRIMARY KEY(BookingID),
  257. CONSTRAINT FK_Booking_FacIDTimeSlotSNSlotDate FOREIGN KEY (FacID,TimeSlotSN,SlotDate) REFERENCES BookSlot(FacID,TimeSlotSN,SlotDate),
  258. CONSTRAINT FK_Booking_AccID FOREIGN KEY (AccID) REFERENCES Account(AccID)
  259. );
  260.  
  261. /*VehicleLabel table*/
  262. CREATE TABLE VehicleLabel
  263. (
  264. VehLblAppID smallint,
  265. VehLblStatus Varchar(10) NOT NULL,
  266. VehLblNum Varchar(10) NULL,
  267. VehicleNo Varchar(10) NOT NULL,
  268. AppliedBy Char(10) NOT NULL,
  269. IssuedBy Char(10) NOT NULL,
  270. CONSTRAINT PK_VehicleLabel PRIMARY KEY(VehLblAppID),
  271. CONSTRAINT FK_VehicleLabel_VehicleNo FOREIGN KEY(VehicleNo) REFERENCES Vehicle(VehicleNo),
  272. CONSTRAINT FK_VehicleLabel_AppliedBy FOREIGN KEY(AppliedBy) REFERENCES Account(AccID),
  273. CONSTRAINT FK_VehicleLabel_IssuedBy FOREIGN KEY(IssuedBy) REFERENCES CondoMgmt(CondoMgmtID),
  274. CONSTRAINT CHK_VehicleLabel CHECK (VehLblStatus in ('Pending', 'Approved', 'Rejected'))
  275. );
  276.  
  277. INSERT INTO Staff  
  278. VALUES  
  279. (1, 'Leon Kennedy', '94326543','20120305','Customer Service'),  
  280. (2, 'Kurt Tay', '82534544','20151108','Tech Support'),  
  281. (3, 'Jill Valentine', '96489453','20191215','Admin'),  
  282. (4, 'Walter White', '87651234','20220111','Customer Service'),  
  283. (5, 'John Tan', '91415555','20170605','Tech Support'),  
  284. (6, 'Freddie Mercury', '94456784','20140522','Customer Service'),  
  285. (7, 'Wong Boon Kiat', '82563759','20120824','Customer Service'),  
  286. (8, 'Xiao Ming', '94326543','20100913','Admin'),  
  287. (9, 'Ron Lee', '92476733','20230506','Tech Support'),  
  288. (10, 'Brandon Koh', '88376470','20130912','Tech Support');  
  289.  
  290. INSERT INTO Condo  
  291. VALUES  
  292. (1, 'Hillview View', '59 Hillview Avenue 5'),  
  293. (2, 'Bukit View', 'Bukit Batok Avenue 23'),  
  294. (3, 'Hume Park', 'Hume Avenue 2'),  
  295. (4, 'Clementi Town', 'Clementi Avenue 3'),  
  296. (5, 'Serangoon Vista', '5 Serangoon Street'),  
  297. (6, 'Yishun Home', 'Yishun Central 1'),  
  298. (7, 'Mi Casa', 'Choa Chu Kang Avenue 3'),  
  299. (8, 'King of Albert', ' 664 Bukit Timah Road'),  
  300. (9, 'Marina', 'Raffles Avenue 54'),  
  301. (10, 'The View of The Seas', '21 Keppel Bay')
  302.  
  303.  
  304.  
  305. INSERT INTO Account  
  306. VALUES  
  307. ('1025700010', 'James Charles', '59 Hillview Avenue 5 Blk69 #01-04', '93691269', 'jamesc@gmail.com',1,3),  
  308. ('1536750790', 'Tom Scott', '59 Hillview Avenue 5 Blk69 #29-01', '96389264', 'tomscott@hotmail.com',1,3),  
  309. ('1000006783', 'Daniel Robert Middleton', '59 Hillview Avenue 5 Blk99 #19-02', '91459087', 'danTDM@yahoo.com',1,8),  
  310. ('1134397390', 'Charles Christopher White Jr.', 'Bukit Batok Avenue 23 Blk 1 #03-04', '93824561', 'moistCritical@yahoo.com',2,8),  
  311. ('1254397420', 'Albert Spencer Aretz', 'Bukit Batok Avenue 23 Blk 3 #05-01', '63134587', 'albertstuff@gmail.com',2,8),
  312. ('1948567869', 'Felix Arvid Ulf Kjellberg', 'Bukit Batok Avenue 23 Blk 3 #05-01', '90267891', 'pewdiepie@gmail.com',2,3),
  313. ('1114398950', 'Jake Paul', 'Hume Avenue 2 Blk 3 #11-01', '63134587', 'JakePaul@yahoo.com',3,3),
  314. ('1432604331', 'Ludwig Anders Ahgren', 'Hume Avenue 2 Blk 3 #11-01', '81942340', 'Ludwig@hotmail.com',3,8),
  315. ('1074910486', 'Orr Piamenta', 'Clementi Avenue 3 Tower 4 #22-01', '92386710', 'pinely@hotmail.com',4,8),
  316. ('1920715644', 'Vladislav Vashketov ', '5 Serangoon Street Blk3 #02-01', '91890094', 'VladAndNiki@outlook.com',6,3),
  317. ('1301890675', 'Nikita Vashketov', '5 Serangoon Street Blk3 #02-01', '92345890', 'VladAndNiki@outlook.com',6,3),
  318.  
  319. ('1056790881', 'Chris P. Bacon', ' 5 Serangoon Street Blk1 #01-03', '57619081', ' ParashockX @outlook.com',6,8),
  320. ('1048558391', 'Abigail Thorn', 'Choa Chu Kang Avenue 3 Blk65 #014-03', '91867816', 'PhilosophyTube@outlook.com',7,3),  
  321. ('1069438594', 'Adam Bahner', 'Choa Chu Kang Avenue 3 Blk70 #01-03', '81623045', 'TayZonday@outlook.com',7,8),  
  322. ('1584809167', 'Adin Ross', '664 Bukit Timah Road Blk4 #01-03', '65430981', 'AdinRoss@outlook.com',8,8),
  323. ('1202848607', 'Nicholas Kolcheff ', '664 Bukit Timah Road Blk2 #05-05', '98375021', 'NICKMERCS@gmail.com',8,8),
  324. ('1039576914', 'PJ Liguori', '664 Bukit Timah Road Blk2 #07-03', '89750456', 'PJTheKick@gmail.com',8,3),
  325. ('1908715639', 'Ryan Higa', 'Raffles Avenue 54 #07-03', '98713902', 'higatv@gmail.com',9,3),
  326. ('1739154783', 'Sabine Hossenfelder', 'Raffles Avenue 54 #15-04', '91725899', 'SabineHossenfelder@gmail.com',9,8),
  327. ('1654103865', 'Salman Khan', 'Raffles Avenue 54 #25-03', '86513555', 'KhanAcedemy@yahoo.com',9,8),
  328. ('1000247813', 'Sara Maria Forsberg', '21 Keppel Bay Blk 5 #12-03', '61530977', 'SAARA@gmail.com',10,8),
  329. ('1333091845', 'Vi Hart', '21 Keppel Bay Blk 1 #08-02', '63450914', 'ViHart@gmail.com',10,3),
  330.  
  331. ('2010234890', 'Lee P.', NULL, '98751045', NULL,1,8),
  332. ('2094015869', 'Long Mush Jr.', NULL, '87160985', NULL,2,3),
  333. ('2034590184', 'Tom Law', NULL, NULL, '67815607',3,3),
  334. ('2010385869', 'Saul Goodman', NULL, '98554015', NULL,4,3),
  335. ('2095867861', 'Tim Cooking', NULL, '81764132', NULL,5,8),
  336. ('2034958493', 'E. Long Mask', NULL, '82907819', NULL,6,8),
  337. ('2098475749', 'Jeff Pesos', NULL, '84965823', NULL,7,3),
  338. ('2064758343', 'Bill Hates ', NULL, '61789087', NULL,8,3),
  339. ('2078104785', 'Warrant Buffet', NULL, '91833145', NULL,9,8),
  340. ('2038485941', 'Surgay Brin', NULL, '91132013', NULL,10,3)
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352. INSERT INTO CondoMgmt  
  353. VALUES
  354. ('2010234890', 'Lee P.', '98751045'),
  355. ('2094015869', 'Long Mush Jr.', '87160985'),
  356. ('2034590184', 'Tom Law', '67815607'),
  357. ('2010385869', 'Saul Goodman', '98554015'),
  358. ('2095867861', 'Tim Cooking', '81764132'),
  359. ('2034958493', 'E. Long Mask', '82907819'),
  360. ('2098475749', 'Jeff Pesos', '84965823'),
  361. ('2064758343', 'Bill Hates ', '61789087'),
  362. ('2078104785', 'Warrant Buffet', '91833145'),
  363. ('2038485941', 'Surgay Brin', '91132013')
  364.  
  365. INSERT INTO Announcement
  366. VALUES
  367. (1, 'Fire Alarm testing will be commenced on 09/12 some time between 2pm and 3pm', '2022-12-01 00:00:00', '2022-12-10 00:00:00',  '2010234890'),
  368. (2, 'Christmas Celebrations. There will be a Christmas lunch buffet from 11am to 2pm on December 25. Free of charge.', '2022-12-10 00:00:00', '2022-12-25 15:00:00',  '2010234890'),
  369. (3, 'Mosquito fogging will be carried out between 4 to 5pm near the pool and carpark areas on Jan 3', '2023-12-30 00:00:00', '2024-01-03 18:00:00',  '2094015869'),
  370. (4, 'Due to reports of residents smoking in the reading rooms, smoking detectors have been installed. Reminder that smoking in the reading rooms are prohibited. ', '2023-11-10 00:00:00',NULL,  '2034590184'),
  371. (5, 'There will be lift repair works from 8pm to 11pm for Blk 3 on 20 Feb. During this time, both lifts in the block will be not operational', '2023-02-15 00:00:00', '2023-02-21 00:00:00',  '2034590184'),
  372. (6, 'The Fire Alarm will be tested on 10 Jan, 1pm-2pm', '2024-01-05 00:00:00', '2024-01-10 14:30:00',  '2095867861'),
  373. (7, 'Pool Maintenance. The swimming pools will be undergoing maintenance to fix the tiles and lights. It will be closed on November 20, from 10am to 1pm', '2023-11-14 00:00:00', '2023-11-20 14:00:00',  '2034958493'),
  374. (8, 'The Gym has re-opened for resident use.', '2023-12-14 00:00:00',NULL,  '2034958493'),
  375. (9, 'Blk 12 unit 12-03 will be undergoing construction works on 24 March. Apologies for the inconvenience.', '2023-3-18 00:00:00', '2022-03-25 00:00:00',  '2034958493'),
  376. (10, 'Chinese New year. A special lion dance event has been organised to celebrate Chinese New Year at the main lobby on 31 Jan at 2pm', '2022-01-25 00:00:00', '2022-01-31 22:00:00',  '2098475749'),
  377. (11, 'One of the lifts at block 4 will be undergoing maintenance from 5pm to 7pm on 8 April. Apologies for any inconvenience caused.', '2023-04-01 00:00:00', '2023-04-08 20:00:00',  '2064758343'),
  378. (12, 'There will be mosquito fogging around block 5 from 4pm to 5pm on 20 Oct.', '2023-10-10 00:00:00', '2023-10-20 20:00:00',  '2078104785'),
  379. (13, 'The tennis courts are now open. The rollers and nets have been replaced with new ones', '2024-01-03 00:00:00',NULL,  '2078104785'),
  380. (14, ' Portable CCTVs has been placed for enhanced security monitoring at Block 71', '2024-01-06 00:00:00',NULL,  '2038485941')
  381.  
  382. INSERT INTO Message
  383. VALUES
  384. (1, 'Hitachi Fridge', 'Garage Sale', '1025700010', NULL),
  385. (2, ' Fear of God Essentials Hoodie. ', 'Garage Sale', '1000006783', NULL),
  386. (3, ' Dell latitude 15.6 fully HD display core i5 gen 8 Ram', 'Garage Sale', '1000006783', NULL),
  387. (4, ' I3 budget gaming desktop ', 'Garage Sale', '1000006783', NULL),
  388. (5, ' Pandora Bracelet', 'Garage Sale', '1025700010', NULL),
  389. (6, '5-Port Gigabit Desktop Switch', 'Garage Sale', '1025700010', NULL),
  390. (7, 'Two-seat sofa/couch', 'Garage Sale', '1301890675', NULL),
  391. (8, '3Sixty, Pikes, Loop Trifold Bicycle', 'Garage Sale', '1254397420', NULL),
  392. (9, 'Foldable bicycle', 'Garage Sale', '1254397420', NULL),
  393. (10, ' [RARE] ROLEX BUBBLEBACK ROSE GOLD1', 'Garage Sale', '1114398950', NULL),
  394. (11, 'Anyone free to play tennis over the weekend?', 'Find a Buddy', '1301890675', NULL),
  395. (12, 'Im down, where?', 'Find a Buddy', '1432604331', 3),
  396. (13, 'At my place, Serangoon Vista. Does 10am sound good?', 'Find a Buddy', '1301890675', 4),
  397. (14, 'Sure', 'Find a Buddy', '1432604331', 5),
  398. (15, 'Anyone know where good chicken rice is at queenstown?', 'Chatterbox', '1432604331', NULL),
  399. (16,  'I like the one at the mei ling hawker centre', 'Chatterbox', '1074910486', 7),
  400. (17,  'How much do you guys give away in your ang paos', 'Chatterbox', '1114398950', NULL),
  401. (18,  'Cats or dogs?', 'Chatterbox', '1114398950', NULL),
  402. (19,  'Mountain lions', 'Chatterbox', '1254397420', 10)
  403.  
  404. INSERT INTO ContactCat
  405. VALUES
  406. (1, 'Businesses'),
  407. (2, 'Emergency Services'),
  408. (3, 'Condo Management')
  409.  
  410. INSERT INTO Facility
  411. VALUES
  412. (1, 'Tennis Court 1',NULL,1),
  413. (2, 'Tennis Court 2',NULL,1),
  414. (3, 'Barbeque Pit 1',NULL,1),
  415. (4, 'Barbeque Pit 2',NULL,1),
  416. (5, 'Tennis Court A',NULL,2),
  417. (6, 'Tennis Court B',NULL,2),
  418. (7, 'Barbeque Pit A',5,2),
  419. (8, 'Barbeque Pit B',5,2),
  420. (9, 'Badminton Court A',NULL,3),
  421. (10, 'Badminton Court B',NULL,3),
  422. (11, 'Function Room A',NULL,3),
  423. (12, 'Function Room B',NULL,3),
  424. (13, 'Function Room C',NULL,3),
  425. (14, 'Function Room 1',10,4),
  426. (15, 'Function Room 2',10,4),
  427. (16, 'Function Room 3',10,4),
  428. (17, 'Squash Court',4,5),
  429. (18, 'Tennis Court' ,3,5),
  430. (19, 'Barbeque Pit',10,6),
  431. (20, 'Game Room A',NULL,7),
  432. (21, 'Game Room B',NULL,7),
  433. (22, 'Karaoke Room A',10,7),
  434. (23, 'Function Room',10,7),
  435. (24, 'Badminton Court 1',NULL,8),
  436. (25, 'Badminton Court 2',NULL,8),
  437. (26, 'Badminton Court 3',NULL,8),
  438. (27, 'Squash Court 1',NULL,8),
  439. (28, 'Squash Court 2',NULL,8),
  440. (29, 'Tennis Court',NULL,9),
  441. (30, 'Barbeque Pit 1',5,9),
  442. (31, 'Barbeque Pit 2',NULL,9),
  443. (32, 'Badminton Court',NULL,10)
  444.  
  445. INSERT INTO FacTimeSlot  
  446. VALUES  
  447. (2, 1, '9-10AM'),  
  448. (2, 2, '1-2PM'),  
  449. (3, 1, '3-4PM'),
  450. (5, 1, '3-4PM'),  
  451. (14, 1, '9-10AM'),  
  452. (14, 2, '12-2PM'),  
  453. (18, 1, '8-9AM'),  
  454. (22, 1, '9-10AM'),  
  455. (22, 2, '10-11AM'),
  456. (22, 3, '1-3PM'),  
  457. (22, 4, '5-6PM'),
  458. (25, 1, '2-4PM'),
  459. (25, 2, '5-6PM')
  460.  
  461. INSERT INTO FeedbkCat
  462. VALUES
  463. (1, 'Suggestions'),
  464. (2, 'Maintenance'),
  465. (3, 'Noise'),
  466. (4, 'Plumbing'),
  467. (5, 'Security'),
  468. (6, 'Facilities'),
  469. (7, 'Parking'),
  470. (8, 'Landscaping'),
  471. (9, 'Accessibility'),
  472. (10, 'Pets'),
  473. (11, 'Cleanliness')
  474.  
  475. INSERT INTO Feedback
  476. VALUES
  477. (1, 'The grass at the entrance walkway is severely overgrown', '2023-12-01 09:23:00', 'Attended', '1025700010', 8, '2010234890'),
  478. (2, 'The hallway lights on the 5th floor are flickering. It creates a safety concern for residents and visitors.', '2021-05-12 14:30:00', 'Sent', '1025700010', 5, '2010234890'),
  479. (3, 'The water tap in the kitchen of unit #29-01 is leaking. It needs urgent attention to avoid water damage.', '2022-08-21 09:45:00', 'In Progress', '1536750790', 4, '2094015869'),
  480. (4, 'The elevator in Block 1, Unit #03-04 is making strange noises. It may need maintenance.', '2020-11-30 12:15:00', 'Attended', '1134397390', 2, '2034590184'),
  481. (5, 'There is a suspicious individual loitering near the entrance. Security needs to investigate.', '2023-01-17 18:20:00', 'Attended', '1948567869', 5, '2010385869'),
  482. (6, 'The swimming pool gate is not closing properly, posing a safety risk. It requires immediate attention.', '2020-07-05 16:10:00', 'In Progress', '1114398950', 6, '2095867861'),
  483. (7, 'The designated parking space for Unit #02-01 is frequently occupied by other vehicles.', '2022-03-28 07:55:00', 'Sent', '1432604331', 7, '2034958493'),
  484. (8, 'The flower beds in the common area look neglected. They need attention to enhance the landscaping.', '2021-09-14 11:40:00', 'Attended', '1074910486', 8, '2098475749'),
  485. (9, 'The wheelchair ramp near Block 3 is damaged, making it difficult for residents with mobility challenges.', '2022-05-03 13:25:00', 'In Progress', '1920715644', 9, '2064758343'),
  486. (10, 'A resident reported a neighbour not adhering to the pet policy, allowing their dog to roam freely.', '2023-04-02 20:05:00', 'Sent', '1301890675', 10, '2078104785'),
  487. (11, 'The common areas, especially the lobby, need more frequent cleaning to maintain a high standard of cleanliness.', '2020-12-10 10:30:00', 'Attended', '1056790881', 11, '2038485941'),
  488.  
  489. (12, 'The playground equipment needs repairs. Some items are broken and may pose a risk to children.', '2022-06-18 15:50:00', 'Sent', '1025700010', 6, '2010234890'),
  490. (13, 'The hallway carpet on the 19th floor has a persistent stain. It affects the aesthetic appeal of the building.', '2021-08-02 11:15:00', 'In Progress', '1536750790', 11, '2094015869'),
  491. (14, 'The lighting in the parking lot near Block 4 is insufficient. It raises safety concerns for residents and their vehicles.', '2023-02-28 08:40:00', 'Attended', '1000006783', 7, '2034590184'),
  492. (15, 'Residents have observed unfamiliar individuals entering the premises without proper authorization. Security needs to investigate.', '2020-10-14 19:30:00', 'In Progress', '1134397390', 5, '2010385869'),
  493. (16, 'The communal garden needs more seating arrangements. It would enhance the facilities for residents to relax outdoors.', '2022-04-25 14:20:00', 'Sent', '1254397420', 6, '2095867861');
  494.  
  495. INSERT INTO ItemCategory
  496. VALUES
  497. (1, 'Homeware'),
  498. (2, 'Furniture'),
  499. (3, 'Fashion'),
  500. (4, 'Electronics'),
  501. (5, 'Books and Stationery'),
  502. (6, 'Sports and Outdoors'),
  503. (7, 'Toys and Games'),
  504. (8, 'Health and Fitness'),
  505. (9, 'Collectibles and Art'),
  506. (10, 'Music and Instruments'),
  507. (11, 'Others');
  508.  
  509. INSERT INTO ItemRelated
  510. VALUES
  511. (1, 'Hitachi Fridge 7/10 condition used for 3 years', 200, 'Available', 'Sale',  4),
  512. (2, 'FOG Essentials hoodie bought in 2022 but worn only thrice', 75, 'Sold', 'Sale',  3),
  513. (3, ' Dell laptop for work. Selling as I have upgraded already', 1500, 'Reserved', 'Sale', 4),
  514. (4, 'budget gaming desktop, can play games like valorant and cs:go at 60fps and above', 800, 'Available', 'Sale',  4),
  515. (5, 'pandora marvel series bracelet. Comes with Spider man charm', 85, 'Available', 'Sale',  3),
  516. (6, 'switch used for 3 months, condition is like new and everything is working', 30, 'Sold', 'Sale',  4),
  517. (7, 'sofa couch from ikea. Bought at 400', 245, 'Reserved', 'Sale', 2),
  518. (8, '3Sixty, Pikes, Loop Trifold Bicycle from RodaLink store, used once, no scratches and in perfect condition', 325, 'Available', 'Sale', 6),
  519. (9, 'Foldable bicycle, from Polygon, 14 inch wheel, 3 speed, V brake. Weight: 7.6kg. ', 195, 'Sold', 'Sale',  6),
  520. (10, ' Today i will be selling a 32mm Rolex bubbleback in rose gold (Watch only). Well condition', 2799, 'Reserved', 'Sale',  3);
  521.  
  522. INSERT INTO ItemPhoto
  523. VALUES
  524. (1, 'photo 1'),
  525. (2, 'photo 2'),
  526. (3, 'photo 3'),
  527. (4, 'photo 4'),
  528. (5, 'photo 5'),
  529. (6, 'photo 6'),
  530. (7, 'photo 7'),
  531. (8, 'photo 8'),
  532. (9, 'photo 9'),
  533. (10, 'photo 10');
  534.  
  535.  
  536.  
  537. INSERT INTO BookSlot
  538. VALUES
  539. (2,1, '2023-12-30 00:00:00', 'Available'),
  540. (2,1, '2023-12-31 00:00:00', 'Booked'),
  541. (2,2, '2023-12-30 00:00:00', 'Available'),
  542. (3,1, '2023-12-31 00:00:00', 'Booked'),
  543. (5,1, '2023-12-30 00:00:00', 'Available'),
  544. (5,1, '2023-12-31 00:00:00', 'Available'),
  545. (14,1, '2023-12-30 00:00:00', 'Maintenance'),
  546. (14,1, '2023-12-31 00:00:00', 'Maintenance'),
  547. (14,2, '2023-12-31 00:00:00', 'Available'),
  548. (14,2, '2024-01-01 00:00:00', 'Booked'),
  549. (18,1, '2023-12-29 00:00:00', 'Booked'),
  550. (18,1, '2023-12-30 00:00:00', 'Maintenance'),    
  551. (22,1, '2023-12-31 00:00:00', 'Maintenance'),
  552. (22,2, '2023-12-31 00:00:00', 'Maintenance'),
  553. (22,3, '2023-12-31 00:00:00', 'Maintenance'),
  554. (22,4, '2023-12-31 00:00:00', 'Booked'),
  555. (25,1, '2023-12-31 00:00:00', 'Booked'),
  556. (25,1, '2024-01-01 00:00:00', 'Available'),
  557. (25,2, '2024-01-01 00:00:00', 'Maintenance')
  558.  
  559. INSERT INTO Likes
  560. VALUES
  561. ('1025700010', 14),
  562. ('1025700010', 8),
  563. ('1536750790', 14),
  564. ('1000006783', 6),
  565. ('1134397390', 1),
  566. ('1254397420', 17),
  567. ('1948567869', 2),
  568. ('1114398950', 19),
  569. ('1432604331', 3),
  570. ('1074910486', 10),
  571. ('1920715644', 5),
  572. ('1301890675', 12),
  573. ('1056790881', 7);
  574.  
  575. INSERT INTO Owner
  576. VALUES
  577. ('1056790881', '2019-12-10 00:00:00', '2010234890'),
  578. ('1000006783', '2018-10-03 00:00:00', '2010234890'),
  579. ('1536750790', '2020-12-02 00:00:00', '2095867861'),
  580. ('1134397390', '2020-04-24 00:00:00', '2010234890'),
  581. ('1254397420', '2017-12-06 00:00:00', '2078104785'),
  582. ('1948567869', '2016-07-14 00:00:00', '2078104785'),
  583. ('1432604331', '2013-01-30 00:00:00', '2098475749'),
  584. ('1074910486', '2017-03-27 00:00:00', '2078104785'),
  585. ('1920715644', '2015-12-25 00:00:00', '2038485941'),
  586. ('1301890675', '2017-12-10 00:00:00', '2038485941');
  587.  
  588. INSERT INTO Tenant
  589. VALUES
  590. ('1025700010', '2023-04-05', '2025-04-05', '2095867861'),
  591. ('1114398950', '2023-05-12', '2024-05-12', '2010385869'),
  592. ('1048558391', '2023-07-18', '2024-07-18', '2034590184'),
  593. ('1069438594', '2023-09-03', '2024-09-03', '2078104785'),
  594. ('1584809167', '2023-11-22', '2024-11-22', '2098475749'),
  595. ('1202848607', '2023-03-15', '2024-03-15', '2034958493'),
  596. ('1039576914', '2023-01-08', '2024-01-08', '2038485941'),
  597. ('1908715639', '2023-04-30', '2024-04-30', '2095867861'),
  598. ('1739154783', '2023-06-25', '2024-06-25', '2064758343'),
  599. ('1654103865', '2023-08-17', '2024-08-17', '2094015869'),
  600. ('1000247813', '2023-10-05', '2024-10-05', '2010234890'),
  601. ('1333091845', '2023-12-12', '2024-12-12', '2094015869');
  602.  
  603. INSERT INTO UsefulContact
  604. VALUES
  605. (1, 'QQ Barber', 'An affordable barber shop', '83462624', 1),
  606. (2, 'Fast Plumbing', '24/7 plumbing services', '68971234', 1),
  607. (3, 'Green Thumb Landscaping', 'Landscaping and garden maintenance', '98763456', 3),
  608. (4, 'Tech Haven', 'Electronics repair and support', '87654321', 1),
  609. (5, 'Healthy Bites Grocery', 'Organic and health-focused groceries', '68901234', 1),
  610. (6, 'Secure Solutions', 'Security systems installation and maintenance', '89012345', 3),
  611. (7, 'Read & Relax Bookstore', 'A wide selection of books and stationery', '98765432', 1),
  612. (8, 'FitHub Gym', 'Fitness classes and personal training', '89067890', 3),
  613. (9, 'Paws and Claws Pet Store', 'Pet supplies and grooming services', '67890123', 1),
  614. (10, 'Artistry Gallery', 'Exquisite art pieces and collectibles', '78901234', 1),
  615. (11, 'Melody Instruments', 'Music instruments sales and repair', '89056789', 1),
  616. (12, 'Tasty Delights Cafe', 'Delicious food and beverages', '67890123', 1),
  617. (13, 'Express Clean Laundry', 'Laundry and dry-cleaning services', '87654321', 1),
  618. (14, 'CarCare Auto Services', 'Car maintenance and repairs', '68901234', 1),
  619. (15, 'Wise Words Legal Services', 'Legal advice and consultation', '89012345', 3);
  620.  
  621. INSERT INTO CondoUsefulContact
  622. VALUES
  623. (5, 1),
  624. (9, 2),
  625. (3, 3),
  626. (2, 4),
  627. (8, 5),
  628. (1, 6),
  629. (4, 7),
  630. (7, 8),
  631. (10, 9),
  632. (6, 10),
  633. (2, 11),
  634. (1, 12),
  635. (9, 13),
  636. (7, 14),
  637. (5, 15);
  638.  
  639. INSERT INTO Vehicle
  640. VALUES
  641. ('SKA 1234 Y', '1234567890', 'Own', 'Mazda', 'CX-5'),
  642. ('SKB 5678 B', '2345678901', 'Rented', 'BMW', 'X3'),
  643. ('SKC 9012 C', '3456789012', 'Company Car', 'Subaru', 'Forester'),
  644. ('SKD 3456 D', '4567890123', 'Own', 'Mercedes-Benz', 'GLC'),
  645. ('SKE 7890 E', '5678901234', 'Rented', 'Audi', 'Q5'),
  646. ('SKF 2345 F', '6789012345', 'Own', 'Lexus', 'RX'),
  647. ('SKG 6789 G', '7890123456', 'Company Car', 'Volvo', 'XC60'),
  648. ('SKH 1234 H', '8901234567', 'Own', 'Jeep', 'Grand Cherokee'),
  649. ('SKJ 5678 J', '9012345678', 'Rented', 'Ford', 'Explorer'),
  650. ('SKK 9012 K', '2468101214', 'Own', 'Nissan', 'Rogue'),
  651. ('SKL 3456 L', '1369121518', 'Company Car', 'Chevrolet', 'Equinox'),
  652. ('SKM 7890 M', '4816326412', 'Own', 'Hyundai', 'Santa Fe'),
  653. ('SKN 2345 N', '4812162428', 'Rented', 'Kia', 'Sorento'),
  654. ('SKP 6789 P', '9182754108', 'Own', 'Volkswagen', 'Tiguan'),
  655. ('SKQ 1234 Q', '6121824307', 'Company Car', 'Porsche', 'Macan');
  656.  
  657. INSERT INTO Booking
  658. VALUES
  659. (1, '2023-12-20', 'Confirmed', '1025700010', 2,1, '2023-12-31'),
  660. (2, '2023-12-22', 'Confirmed', '1000006783', 3,1, '2023-12-31'),
  661. (3, '2023-12-23', 'Pending Payment', '1254397420', 5,1, '2023-12-30'),
  662. (4, '2023-12-23', 'Cancelled', '1056790881', 14, 1, '2023-12-30'),
  663. (5, '2023-12-23', 'Cancelled', '1202848607', 5, 1, '2023-12-31'),
  664. (6, '2023-12-24', 'Confirmed', '1654103865', 14, 2, '2024-01-01'),
  665. (7, '2023-12-24', 'Confirmed', '1000247813', 18,1, '2023-12-29'),
  666. (8, '2023-12-25', 'Confirmed', '1333091845', 22,4, '2023-12-31'),
  667. (9, '2023-12-25', 'Confirmed', '1739154783', 25,1, '2023-12-31'),
  668. (10, '2023-12-26', 'Pending Payment', '1908715639', 25,1, '2024-01-01')
  669.  
  670. INSERT INTO VehicleLabel
  671. VALUES
  672. (1, 'Approved', 'AAAAA00000', 'SKB 5678 B', '1000006783', '2010234890'),
  673. (2, 'Approved', 'KEBAB00001', 'SKC 9012 C', '1134397390', '2094015869'),
  674. (3, 'Approved', 'AAABB00002', 'SKD 3456 D', '1134397390', '2094015869'),
  675. (4, 'Approved', 'AAACC00055', 'SKA 1234 Y', '1254397420', '2010385869'),
  676. (5, 'Pending', 'BABAB10000', 'SKE 7890 E', '1432604331', '2034590184'),
  677. (6, 'Approved', 'KNNCB42069', 'SKF 2345 F', '1074910486', '2010234890'),
  678. (7, 'Approved', 'NNBCB55569', 'SKK 9012 K', '1301890675', '2034958493'),
  679. (8, 'Rejected', 'BBCKA55678', 'SKJ 5678 J', '1056790881', '2078104785'),
  680. (9, 'Rejected', 'MESSI31234', 'SKN 2345 N', '1048558391', '2038485941'),
  681. (10, 'Pending', 'VENUS13151', 'SKQ 1234 Q', '1908715639', '2095867861')
  682.  
  683. INSERT INTO TempVehLabel
  684. VALUES
  685. (1, '2023-10-11', '2023-12-11'),
  686. (2, '2023-12-01', '2024-02-01'),
  687. (3, '2023-12-06', '2024-02-06'),
  688. (4, '2024-01-10', '2024-03-10'),
  689. (5, '2024-01-11', '2024-03-11'),
  690. (6, '2024-02-10', '2024-04-10'),
  691. (7, '2024-02-11', '2024-04-11'),
  692. (8, '2023-11-11', '2024-01-11'),
  693. (9, '2024-03-09', '2024-05-09'),
  694. (10, '2024-03-15', '2024-05-15')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement