Question
This question strictly uses mysql. Below is the sql for a bandinfo table. There is a column called releases. This column needs to contain JSON
This question strictly uses mysql.
Below is the sql for a bandinfo table. There is a column called releases.
This column needs to contain JSON for specific rows according to band name indicated.
The releases column should display the json data as such.
The below is just an example the data column is a representation of the releases column in bandinfo table
Please provide mysql code that insterts the below json data into the releases column of the bankinfo table.
The json data is specific to band name.
Please also include the json file with the below data properly formatted and using correct json syntax.
HERE IS THE JSON DATA:
goes in row where BandName BTS: {"type": "Single", "year": 2021, "title": "Butter"} goes in row where BandName Wallows: {"type": "Single", "year": 2019, "title": "Are You Bored Yet?"} goes in row where BandName BLACKPINK: {"type": "Album", "year": 2020, "title": "The Album"} goes in row where BandName Nirvana: {"type": "Single", "year": 1991, "title": "Something in the Way"} goes in row with BandName Coldplay: {"type": "Album", "year": 2000, "title": "Parachutes"}
HERE IS ALL THE OTHER SQL CODE: CREATE DATABASE music; USE music; CREATE TABLE bandinfo ( BandName VARCHAR(255) NOT NULL, FormationYear INT(4) NOT NULL, CurrentStatus ENUM('Active', 'Inactive') NOT NULL, BaseCity VARCHAR(255) NOT NULL, BaseCountry VARCHAR(255) NOT NULL, NumberOfBandMembers INT(1) NOT NULL, NumberOfReleases INT(1) NOT NULL, Genre VARCHAR(255) NOT NULL, releases JSON, PRIMARY KEY (BandName) ); INSERT INTO bandinfo VALUES ( "BTS", 2010, "Active", "Soel", "South Korea", 5, 25, "KPop" ), ( "Mirror", 2018, "Active", "HongKong", "China", 12, 1, "Cantopop" ), ( "Wallows", 2017, "Active", "Los Angelos", "United States", 3, 3, "Rock" ), ( "The Beatles", 1960, "Inactive", "Liverpool", "United Kingdom", 4, 54, "Rock" ), ( "The Rolling Stones", 1962, "Active", "London", "United Kingdom", 3, 71, "Rock" ), ( "Led Zeppelin", 1968, "Inactive", "London", "United Kingdom", 4, 8, "Rock" ), ( "Nirvana", 1987, "Inactive", "Aberdeen", "United States", 3, 18, "Rock" ), ( "Coldplay", 1997, "Active", "London", "United Kingdom", 4, 9, "Rock" ), ( "Twice", 2015, "Active", "Soel", "South Korea", 9, 7, "KPop" ), ( "Green Day", 1987, "Active", "Los Angelos", "United States", 3, 13, "Rock" ), ( "Pink Floyd", 1965, "Inactive", "London", "United Kingdom", 4, 15, "Rock" ), ( "The Beach Boys", 1961, "Active", "Hawthorne", "United States", 5, 29, "Rock" ), ( "Simon & Garfunkel", 2009, "Inactive", "New York", "United States", 2, 5, "Folk" ), ( "U2", 1976, "Active", "Dublin", "Ireland", 4, 14, "Rock" ), ( "BLACKPINK", 2016, "Active", "Soel", "South Korea", 4, 3, "KPop" ), ( "The Kinks", 1963, "Inactive", "London", "United Kingdom", 4, 24, "Rock" ), ( "Maneskin", 2016, "Active", "Rome", "Italy", 4, 4, "Rock" ), ( "AC/DC", 1973, "Active", "Sydney", "Australia", 5, 17, "Rock" ), ( "One Direction", 2010, "Inactive", "London", "United Kingdom", 5, 5, "Pop" ), ( "The Kooks", 2004, "Active", "Brighton", "United Kingdom", 4, 6, "Pop" );
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started