Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago