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

  1. What will be returned by the following queries? If nothing is returned, write empty set.
    1. SELECT SUBSTRING_INDEX(movie, '\'', 1) FROM characters WHERE name='Flik';
    2. SELECT RIGHT('1:10', 2) + SUBSTRING_INDEX('1:20', ':', 1) * 60;
    3. SELECT SUBSTRING(movie, 3, 3) FROM characters WHERE name='Flik';
    4. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!