Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part 1 has been completed. Create a SQL database for a social media purpose, including at least four tables. I used MySQL for this Design

Part 1 has been completed.

Create a SQL database for a social media purpose, including at least four tables. I used MySQL for this Design a table for the users information 10% Design a table for users contacts 10% Design a table for users messages 10% Design a table for users likes 10% Fill the tables with arbitrary data 10% * Each table must include a primary key.

Part 2 is what I need help with:

1. Write a NodeJS program that connects to your database 10% 2. Create an HTTP server using Nodejs 10% 3. Define different URL routes to display each table content on the browser. 30%

For example, http://localhost: 3000/user shows the data of the user table

This is what I have so far, any help would be greatly appreciated.

const mysql = require('mysql'); const http = require('http');

//Create a connection to MySQL Database

let connection = mysql.createConnection({ host: 'localhost', user: 'root', password: '', database: '' });

//Connect connection.connect(function(err) { if (err) { return console.error('error: ' + err.message); } console.log('Connected to the MySQL server.'); });

// create web server http.createServer(function (httpRequest, httpResponse) {

}).listen(8080);

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions

Question

1. What are the major sources of stress in your life?

Answered: 1 week ago