Question 1 = (Single UPDATE Statement) With a single statement change the emails
ID: 3841724 • Letter: Q
Question
Question 1 = (Single UPDATE Statement)
With a single statement change the emails of all the members to the format "LastName@ArtistName.com".
Use the replace function to get rid of spaces in the artistname
e.g.
SELECT REPLACE(ArtistName, " ", "") FROM Artists;
The above lists all the artistnames with spaces removed
After you are done, this is how the output should look like:
mysql> select firstname, email from members;
+-----------+-----------------------------+
| firstname | email |
+-----------+-----------------------------+
| Bryce | Sanders@TheNeurotics.com |
| Marcellin | Lambert@Sonata.com |
| Caroline | Kale@Sonata.com |
| Kerry | Fernandez@Sonata.com |
| Roberto | Alvarez@Word.com |
| Mary | Chrisman@Word.com |
Question 2 = English to SQL
Show the names of all salespeople who represent members of the Bullets. Do not use joins, use subqueries only.
Question 3 = Explain in 1 or 2 sentences
Explain what the following sequence of 3 statements do to the database: (What effect will 'ROLLBACK' have?)
BEGIN;
ALTER TABLE ARTISTS CHANGE webaddress homepage varchar(255);
ROLLBACK;
Explanation / Answer
PLEASE POST AS SEPARATE QUESTIONS:
Answer 3)
BEGIN;
> Beginning of a new transaction
ALTER TABLE ARTISTS CHANGE webaddress homepage varchar(255);
> Change column name "webaddress" to "homepage" and sets its data type to varchar(255)
ROLLBACK;
>ROLLBACK rolls back the current transaction, canceling its changes. Thus the above statement will
be rolled back and column name and its datatype will be rolled back to "webaddress".
DO THUMBS UP ^_^
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.