Priya-Raut / java-programming

1 stars 2 forks source link

Create schema.sql file for dailyshop database schema #3

Open Priya-Raut opened 4 years ago

Priya-Raut commented 4 years ago

Task: Create dailyshop database schema in a schema.sql file on Github

Specifics:

  1. What should be Primary Key
  2. Should a column be nullable
  3. Which column should have indexed for faster access
  4. What should be datatype and size of the column

A sample schema.sql from another project: https://github.com/Priya-Raut/learning-spring/blob/master/src/main/resources/schema.sql

Table and columns designed for our project: https://docs.google.com/document/d/1QdWUL1TrSVuGgdvqRjeE6MIKvLqbacsXXp10wOzI3ig/edit#heading=h.ck71qkyt3peu

Tables:

Where to write the schema? Find /dailyshop/src/main/resources/schema.sql

Please comment on this issue with the name of the table you want to work on. It will be assigned on a first come first serve basis.

Answers to some of the common questions

How to install MySQL? Installation Guide for MySQL MacOS: https://dev.mysql.com/doc/refman/8.0/en/osx-installation.html Windows: https://dev.mysql.com/doc/refman/8.0/en/windows-installation.html Linux: https://dev.mysql.com/doc/refman/8.0/en/linux-installation.html

Note: Make sure after installing you have added MySQL in the path

How to connect to a database from my IDE? Intellij IDEA: https://www.jetbrains.com/help/idea/configuring-database-connections.html Netbeans: https://netbeans.org/kb/docs/ide/mysql.html

How to create/access a database/table? Option 1: Create/Access database using the default database shell/console. Option 2: Create/Access database from your IDE's GUI or IDE's query console.

How to connect to database from my code? Add the following settings in the Application.properties file. (specific to a Spring based project) spring.jpa.database= spring.datasource.platform= spring.datasource.url=jdbc:://:/ spring.datasource.username= spring.datasource.password=

Example: spring.jpa.database=mysql spring.datasource.platform=mysql spring.datasource.url=jdbc:mysql://localhost:3306/dailyshop spring.datasource.username=root spring.datasource.password=password

madhura11-1 commented 4 years ago

Items : i will start working on items table

Priya-Raut commented 4 years ago

@madhura11-1 go for it, it is all yours!