subject

The SQL below creates Genre and Song tables, inserts some genres and songs, and performs an inner join. Run the SQL. Verify the result table does not include songs with NULL genre or genres that are not associated with songs. Make the following changes: In the CREATE TABLE statement for Song, rename GenreCode to Code.
Modify the SELECT statement to work with the new name. Run the SQL and verify the result table is unchanged.
Modify the SELECT statement to perform a left join. Run the SQL and verify the result table includes songs with NULL genre.
Modify the SELECT statement to perform a right join. Run the SQL and verify the result table includes genres that are not associated with any songs.
Modify the SELECT statement to perform a cross join. Run the SQL and verify the result table includes all combinations of songs and genres.
Hint: Use keywords LEFT, RIGHT, and CROSS. Other join keywords, such as INNER, OUTER, or FULL have non-standard syntax or behavior in MySQL.
Other modifications to try: Perform a left join and a right join.
CREATE TABLE genre (
code CHAR(3),
name VARCHAR(20),
description VARCHAR(200),
PRIMARY KEY (code)
);
CREATE TABLE song (
song_id INT,
title VARCHAR(60),
artist VARCHAR(60),
genre_code CHAR(3),
PRIMARY KEY (song_id),
FOREIGN KEY (genre_code) REFERENCES genre(code)
);
INSERT INTO genre VALUES
('CLA', 'Classical', 'Orchestral music composed and performed by professionally trained artists'),
('COU', 'Country', 'Developed mostly in southern USA, with roots in traditional folk music, spirituals and blues'),
('DRO', 'Drone', 'Minimalist music that emphasizes sustained or repeated sounds, notes, or tone clusters'),
('GRU', 'Grunge', 'Alternative rock inspired by hardcore punk, heavy metal, and indie rock'),
('PRC', 'Pop Rock', 'Rock music with less attitude'),
('RAB', 'R&B', 'Modern version of soul and funk African-American pop music'),
('TEC', 'Techno', 'Electronic music');
INSERT INTO song VALUES
(100, 'Hey Jude', 'Beatles', 'PRC'),
(200, 'You Belong With Me', 'Taylor Swift', NULL),
(300, 'Need You Now', 'Lady Antebellum', 'COU'),
(400, 'Old Town Road', 'Lil Nas X', NULL),
(500, 'That\'s The Way Love Goes', 'Janet Jackson', 'RAB'),
(600, 'Even Flow', 'Pearl Jam', 'GRU');
SELECT *
FROM song
INNER JOIN genre
ON genre_code = code;

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 14:40
For this assignment you have to write a c program that will take an infix expression as input and display the postfix expression of the input. after converting to the postfix expression, the program should evaluate the expression from the postfix and display the result. what should you submit? write all the code in a single file and upload the .c file. compliance with rules: ucf golden rules apply towards this assignment and submission. assignment rules mentioned in syllabus, are also applied in this submission. the ta and instructor can call any students for explaining any part of the code in order to better assess your authorship and for further clarification if needed. problem: we as humans write math expression in infix notation, e.g. 5 + 2 (the operators are written in-between the operands). in computer's language, however, it is preferred to have the operators on the right side of the operands, ie. 5 2 +. for more complex expressions that include parenthesis and multiple operators, a compiler has to convert the expression into postfix first and then evaluate the resulting postfix write a program that takes an "infix" expression as input, uses stacks to convert it into postfix expression, and finally evaluates it. it must support the following operations: + - / * ^ % ( example infix expression: (7-3)/(2+2) postfix expression: 7 3 2 2 result: rubric: 1) if code does not compile in eustis server: 0. 2) checking the balance of the parenthesis: 2 points 3) incorrect postfix expression per test case: -2 points 4) correct postfix but incorrect evaluation per test case: -i points 5) handling single digit inputs: maximum 11 points 6) handling two-digit inputs: 100 percent (if pass all test cases)
Answers: 3
question
Computers and Technology, 23.06.2019 15:00
1. which of the following statements are true about routers and routing on the internet. choose two answers. a. protocols ensure that a single path between two computers is established before sending packets over it. b. routers are hierarchical and the "root" router is responsible for communicating to sub-routers the best paths for them to route internet traffic. c. a packet traveling between two computers on the internet may be rerouted many times along the way or even lost or "dropped". d. routers act independently and route packets as they see fit.
Answers: 2
question
Computers and Technology, 24.06.2019 17:50
Acontact list is a place where you can store a specific contact with other associated information such as a phone number, email address, birthday, etc. write a program that first takes in word pairs that consist of a name and a phone number (both strings). that list is followed by a name, and your program should output that name's phone number.
Answers: 1
question
Computers and Technology, 24.06.2019 23:30
True or false when a host gets an ip address from a dhcp server it is said to be configured manually
Answers: 1
You know the right answer?
The SQL below creates Genre and Song tables, inserts some genres and songs, and performs an inner jo...
Questions
question
Mathematics, 13.02.2020 18:56
question
History, 13.02.2020 18:56
question
Mathematics, 13.02.2020 18:56
Questions on the website: 13722367