bbennitt / IPRO_Book_Exchange

0 stars 1 forks source link

Create Database #2

Open Guz-Ali opened 1 year ago

Guz-Ali commented 1 year ago

Create the database inside the MySQL.

Database has Tables inside:

Book: Books are books that have been put on the website for sale.

User: User is a person who uses our website. A user has such attributes:

AC: The database should be created and tables put in. In future relational database

Guz-Ali commented 1 year ago

In order to set your database in your machine, here are the steps: (In future we are going to use an online server, but for now if you need to work with a database, use this.)

Download MySQL: https://dev.mysql.com/downloads/mysql/ Install MySQL, note down your root password. By default it should start the local server.

Download DBeaver: https://dbeaver.io/download/ and install Open DBeaver, and on the top left, create a connection to the MySQL server. You don't need to change much, just put the password as the root password of MySQL.

Inside the Server, go into databases, right click and create a new database named 'textbook'. After creating the database, right click on it, and in SQL editor, new SQL script.

Copy and paste this code and run both to create the tables for User and Book. That should set up everything for now.

-- textbook.Book definition

CREATE TABLE Book ( Name varchar(100), Edition varchar(100), ISBN varchar(100), AuthorFirstName varchar(100), AuthorLastName varchar(100), Genre varchar(100), Topic varchar(100), Book_condition` varchar(100), Price float, Comment tinytext );

CREATE TABLE User ( FirstName varchar(100), LastName varchar(100), City varchar(100), Books_selling varchar(100), Books_bought varchar(100), Books_pinned varchar(100), College varchar(100) );

Guz-Ali commented 1 year ago

Database Schema

https://docs.google.com/drawings/d/1jbtGzxDQHuG8pCfuonnsFPFpmlMIdN1zv0nR88NjDJc/edit