+ 1

SQL Create table from other tables

My Create Tables skills are a little rusty. Can someone assist in helping me create the appropriate answer/solution to this question? Thank you. https://www.testdome.com/questions/sql/users-and-roles/24623?visibility=1&skillId=17

11th Mar 2019, 6:40 PM
Becky Leetch
Becky Leetch - avatar
4 Réponses
+ 1
// Please, use a search bar before publishing your question : https://www.sololearn.com/learn/SQL/1870/?ref=app
11th Mar 2019, 8:25 PM
program
program - avatar
0
Thank you, Zohir. I did search and didn't find an answer. Additionally, the link you provided goes to a page which is not found.
11th Mar 2019, 11:58 PM
Becky Leetch
Becky Leetch - avatar
0
Thank you for showing me the way to testdome. Always looking for test sites.
12th Mar 2019, 9:47 PM
[No Name]
0
I ended up working with a buddy of mine and got the correct answer. It's a many to many relationship. CREATE TABLE users_roles ( UserId INTEGER NOT NULL, RoleId INTEGER NOT NULL, FOREIGN KEY (UserId) REFERENCES users(id), FOREIGN KEY (RoleId) REFERENCES roles(id), UNIQUE (UserId, roleId) )
13th Mar 2019, 9:43 PM
Becky Leetch
Becky Leetch - avatar