Skip to content

Latest commit

 

History

History
47 lines (28 loc) · 2.11 KB

README.md

File metadata and controls

47 lines (28 loc) · 2.11 KB

fs-8

iXperience - Full Stack

Welcome to iXperience Full Stack 2019!

MySQL

Create Database

Run the following SQL query to create a database called fs_bnb

CREATE DATABASE fs_bnb 

Create Table

Run the following query to create a table called listing. The table has a primary key: id and fields userId, title, description, location and pricePerNight.

CREATE TABLE `fs_bnb`.`listing` (
  `id` INT(6) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `userId` INT(6) UNSIGNED NOT NULL,
  `title` VARCHAR(45) NOT NULL,
  `description` VARCHAR(45) NULL,
  `location` VARCHAR(45) NULL,
  `pricePerNight` DECIMAL(10) NOT NULL
)

Insert Data into Table

Run the following query to insert data in the listing table. The insert query contains data for the fields userId, title, description, location and pricePerNight.

INSERT INTO fs_bnb.listing (userId, title, description, location, pricePerNight)
VALUES (2, "Hout Bay Town House", "Town House", "Hout Bay", "120")

fs-8