Question: This is an SQL problem: For the following question , refer to the following table of Disney characters, created as: CREATE TABLE characters ( id
This is an SQL problem:
For the following question , refer to the following table of Disney characters, created as:
CREATE TABLE characters ( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(20), movie VARCHAR(20), year INT, toys_sold DEC(5,2), type INT);
| id | name | movie | year | toys_sold | type |
| 1 | Captain Hook | Peter Pan | 1953 | 30 | 2 |
| 2 | Tiger Lily | Peter Pan | 1953 | 10 | 1 |
| 3 | Pocahontas | Pocahontas | 1995 | 20 | 1 |
| 4 | Meeko | Pocahontas | 1995 | 5 |
|
| 5 | Woody | Toy Story |
| 45 | 4 |
| 6 | Flik | A Bugs Life | 1998 | 5 | 3 |
| 7 | Dot | A Bugs Life | 1998 | 5 | 3 |
| 8 | Sofia, the First | Forever Royal | 2018 | 50 | 1 |
- What will be returned by the following queries? If nothing is returned, write empty set.
- SELECT SUBSTRING_INDEX(movie, '\'', 1) FROM characters WHERE name='Flik';
- SELECT RIGHT('1:10', 2) + SUBSTRING_INDEX('1:20', ':', 1) * 60;
- SELECT SUBSTRING(movie, 3, 3) FROM characters WHERE name='Flik';
- SELECT SUBSTRING('1:10:05:678', LENGTH(SUBSTRING_INDEX('1:10:05:678', ':', 2)) + 2);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
