Answered step by step
Verified Expert Solution
Question
1 Approved Answer
How might we specify the following SQL in MongoDB ? CREATE TABLE course ( code CHAR ( 3 ) PRIMARY KEY, name VARCHAR ( 3
How might we specify the following SQL in MongoDB
CREATE TABLE course
code CHAR PRIMARY KEY,
name VARCHAR NOT NULL,
credits TINYINT NOT NULL
;
INSERT INTO course codenamecredits
VALUES
WSD 'Web Systems Development',
DDM 'Database Design & Management',
NSF 'Network Security & Forensics', ;
CREATE TABLE Module
code CHAR PRIMARY KEY,
name VARCHAR NOT NULL,
cost DECIMAL NOT NULL,
credits TINYINT NOT NULL,
coursecode CHAR NOT NULL,
CONSTRAINT fkcoursecode
FOREIGN KEY coursecode
REFERENCES course code
ON UPDATE CASCADE
ON DELETE RESTRICT
;
INSERT INTO module codenamecostcreditscoursecode
VALUES
A 'ASP.NET', WSD
APHPWSD
A 'JavaFX', WSD
B 'Oracle', DDM
BSQLSDDM
C 'Law', NSF
C 'Forensics', NSF
C 'Networks', NSF;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started