Question

If you need to store the following data in a relational database and MongoDB, how would...

If you need to store the following data in a relational database and MongoDB, how would you implement in each of them. List the design and commands to store these records in relational database (SQL query) and MongoDB separately.

{no:1,name:"ST",salary:2000,role:"OB"}

{no:2,name:"MSD",salary:1500,role:"WK"}

{no:3,name:"YS",salary:1000,role:"ALR"},

Homework Answers

Answer #1

1). ANSWER :

GIVENTHAT :

Relational database, MySQL

Precondition: Create and use database

Step 1: Creation of table "jobs"

create table jobs(no int primary key, name varchar(100), salary int, role varchar(100));

Step 2: Insertion into table "jobs"

insert into jobs values(1,"ST",2000,"OB");

insert into jobs values(2,"MSD",1500,"WK");

insert into jobs values(3, "YS", 1000, "ALR");

MongoDB

Precondition: Create and use database

Step 1: Creation of collection "jobs"

db.createCollection("jobs")

Step 2: Insertion into collection "jobs"

db.jobs.insert([

{no:1,name:"ST",salary:2000,role:"OB" },

{no:2,name:"MSD",salary:1500,role:"WK"},

{no:3,name:"YS",salary:1000,role:"ALR"}

])

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
If you need to store the following data in a relational database and MongoDB, how would...
If you need to store the following data in a relational database and MongoDB, how would you implement in each of them. List the design and commands to store these records in relational database and MongoDB separately. {no:1,name:"ST",salary:2000,role:"OB"} {no:2,name:"MSD",salary:1500,role:"WK"} {no:3,name:"YS",salary:1000,role:"ALR"},
Problem 8.2 c from Databases Illuminated Third Edition:Assume you have a statistical database with the following...
Problem 8.2 c from Databases Illuminated Third Edition:Assume you have a statistical database with the following schema. The only legal queries are those involving COUNT, SUM, and AVERAGE. newFaculty(facId, lastName, firstName, department, salary, rank, dateHired) a. Write a legal SQL query to find the salary of the only faculty member who is an instructor in the Art department. b. Assume the system will refuse to answer queries for which only one record satisfies the predicate as in (a). Write a...
1. Consider the following tables in a relational database. Provide the appropriate "SELECT" SQL statement necessary...
1. Consider the following tables in a relational database. Provide the appropriate "SELECT" SQL statement necessary to answer the queries that follow. Primary keys are underlined and foreign key fields have an asterisk at the end of the field. CUSTOMERS (CUST-NO, C-NAME, C-ADDRESS, BALANCE) SALESPERSONS (SP-NO, S-NAME, DATE-EMPLOYED, SALARY) SALES (INVOICE-NO, DATE, CUST-NO*, SP-NO*) a) List the salesperson name and salary for all sales to customers whose balance outstanding is greater than 20000. b) List the names and addresses of...
SQL DATABASE Task 4 [1.5 marks] Create Index (0.5 marks) Currently, the database only contains a...
SQL DATABASE Task 4 [1.5 marks] Create Index (0.5 marks) Currently, the database only contains a small number of records. However, the data contained within it is expected to grow significantly in the future. Creating indexes on commonly searched columns is a way performance issues can be minimized. Write a command to create an index on student_name column of the student table. Create view – 1 mark Write a command to create a view to list the student ID and...
You are a database consultant with Ace Software, Inc., and have been assigned to develop a...
You are a database consultant with Ace Software, Inc., and have been assigned to develop a database for the Mom and Pop Johnson video store in town. Mom and Pop have been keeping their records of videos and DVDs purchased from distributors and rented to customers in stacks of invoices and piles of rental forms for years. They have finally decided to automate their record keeping with a relational database. You sit down with Mom and Pop to discuss their...
Objective The Final Project aims to demonstrate your ability to analyze data from a big database,...
Objective The Final Project aims to demonstrate your ability to analyze data from a big database, exercise use of arrays of objects, external classes, processing files and user interaction. For this project, you will design and implement a program that analyzes baby name popularities in data provided by the Social Security Administration. Every 10 years, the data gives the 1,000 most popular boy and girl names for kids born in the United States. The data can be boiled down to...
Please read the article and answear about questions. Determining the Value of the Business After you...
Please read the article and answear about questions. Determining the Value of the Business After you have completed a thorough and exacting investigation, you need to analyze all the infor- mation you have gathered. This is the time to consult with your business, financial, and legal advis- ers to arrive at an estimate of the value of the business. Outside advisers are impartial and are more likely to see the bad things about the business than are you. You should...