WebClub-NITK / Hacktoberfest-2k20

Repository for Hacktoberfest 2020 Meetup at NITK Surathkal
14 stars 53 forks source link

SQL Operations using MySQL or SQLite3 #89

Closed krithikvaidya closed 4 years ago

krithikvaidya commented 4 years ago

Description

Using MySQL or SQLite3, create a database named 'smartphones'. Within this database, create a single table 'smartphone_details'. In this table, create the following fields with the appropriate types and constraints:

Then, insert the following tuples of data into the 'smartphone_details' table:

(1, 'Pixel 3', 'Google', 57000.00, 'Android', '2018-10-09'), (2, 'iPhone XR', 'Apple', 49999.00, 'iOS', '2018-09-12'), (3, 'iPhone 11 Pro', 'Apple', 99900.00, 'iOS', '2019-09-10'), (4, 'Galaxy Note 10 Plus', 'Samsung', 85000.00, 'Android', '2019-08-07'), (5, 'iPhone XS Max', 'Apple', 94999.00, 'iOS', '2018-09-12'), (6, 'Galaxy A50s ', 'Samsung', 19949.00, 'Android', '2019-08-22'), (7, 'Galaxy S9', 'Samsung', 44990.00, 'Android', '2018-03-16'), (8, 'ROG Phone II', 'Asus', 37999.00, 'Android', '2019-09-23'), (9, 'Mi A3', 'Xiaomi', 12999.00, 'Android', '2019-08-21'), (10, 'Galaxy A10', 'Samsung', 7990.00, 'Android', '2019-03-02')

Now, perform the following queries on your database (Print values in all columns for each tuple):

  1. Display all smartphones with price less than Rs. 60,000
  2. List all smartphones released between 1st March, 2018 to 31st December, 2018.
  3. Find the 2 cheapest smartphones released by Samsung after January 1, 2019 (less expensive one should be displayed first).

Details

Issue requirements / progress

Resources

MySQL Youtube Tutorial SQLite3 Youtube Tutorial

Directory Structure

Within this repository's 'systems' folder, create a folder called 'SQL_Operations' (if it doesn't exist yet). Within this folder, place the file in which you have written the script for the task. The file name should be either MySQL(.txt/.sql) or SQLite3 (.txt/.sql)

Note

Please claim the issue first by commenting here before starting to work on it. While submitting a PR, request a review from @krithikvaidya Doubts and clarifications are welcome.

bhawesh96 commented 4 years ago

@krithikvaidya I'd like to work on this. Can you please assign this to me?

krithikvaidya commented 4 years ago

@bhawesh96 sure, go ahead :). Mention whether you'll be doing it in MySQL or SQLite3 though

PriyanshTri commented 4 years ago

can I perfrom this in Mysql?

bhawesh96 commented 4 years ago

@PriyanshTri , I've already completed this in MySQL. Can you look for some other issue? I'm about to submit a PR.

krithikvaidya commented 4 years ago

@PriyanshTri you can try it with SQLite if you wish

henrykorir commented 4 years ago

Assign this to me. I will do it in MySQL

priyalgupta09 commented 4 years ago

please assign this to me i can do this in sqlite3

krithikvaidya commented 4 years ago

Cool, go ahead @priyalgupta09

krithikvaidya commented 4 years ago

Assign this to me. I will do it in MySQL

@henrykorir sorry, it's already been done in MySQL

adhamale2810 commented 4 years ago

Please assign it to me i have already done such database in sqlite3. should i upload both .txt and .sqlite files or only one of them. @krithikvaidya

adhamale2810 commented 4 years ago

@krithikvaidya Bro i am done with the sqlite3 version on the database. Please assign it to me so that i can make a PR

adhamale2810 commented 4 years ago

@krithikvaidya please reply, whether you are assigning it to me or letting her make that pr with sqlite3

krithikvaidya commented 4 years ago

@adhamale2810 please be patient and give the issue creator time to respond.

Since the person who claimed it before didn't complete it within the time limit, you can go ahead.

adhamale2810 commented 4 years ago

Sorry brother i wasn't knowing that there is some time limit.This is my first time participating in HacktoberFest

krithikvaidya commented 4 years ago

@adhamale2810 no problem, the purpose of Hacktoberfest is to get accustomed to contributing to open source projects :)