Desklib Online Library for Study Material with Solved Assignments, Essays, Dissertation etc
7 Pages505 Words106 Views
Added on 2019-10-18
About This Document
This page contains an ERD, tables with insert commands, and queries for a database related to users, groups, and rooms. The queries include retrieving all groups and the users in each group, all rooms and the groups assigned to each room, and a list of users, the groups they belong to, and the rooms to which they are assigned. The database is created using MySQL.
Desklib Online Library for Study Material with Solved Assignments, Essays, Dissertation etc
Added on 2019-10-18
BookmarkShareRelated Documents
ContentsERD.............................................................................................................................................................2TABLES with insert commands..................................................................................................................2QUERIES....................................................................................................................................................4Q1)...........................................................................................................................................................4Q2)...........................................................................................................................................................6Q3)...........................................................................................................................................................6
ERDTABLES with insert commandsCREATE DATABASE EMP_GROUP_DB;USE EMP_GROUP_DB;CREATE TABLE USERS(userID INT PRIMARY KEY,user_name VARCHAR(20) NOT NULL);
INSERT INTO USERS VALUES(1,'Modesto'),(2,'Ayine'),(3,'Christopher'),(4,'Cheong woo'),(5,'Saulat'),(6,'Heidy');CREATE TABLE GROUPS(groupID INT PRIMARY KEY,group_name VARCHAR(30)NOT NULL);INSERT INTO GROUPS VALUES(10,'I.T.'),(11,'Sales'),(12,'Administration'),(13,'Operations');CREATE TABLE ROOMS(roomID INT PRIMARY KEY,roomName VARCHAR(30) NOT NULL);INSERT INTO ROOMS VALUES(1,'101'),(2,'102'),(3,'Auditorium A'),(4,'Auditorium B');CREATE TABLE USERS_GROUP(userID INT,groupID INT,PRIMARY KEY( userID, groupID),FOREIGN KEY (userID) REFERENCES USERS(userID),FOREIGN KEY (groupID) REFERENCES GROUPS(groupID));
End of preview
Want to access all the pages? Upload your documents or become a member.
Related Documents
SQL Database Design for Employee Group Managementlg...