Question

mysql Imagine ,you have a table named as 'accounts' table, where you have a column names...

mysql

Imagine ,you have a table named as 'accounts' table, where you have a column names as 'usernames'. So, find all the usernames that contain the letters “r” followed by “a” followed by “g” in that order anywhere in the string. a. Example: radiogenius should match OR iamaradiogenius

0 0
Add a comment Improve this question Transcribed image text
Answer #1

create table accounts(usernames varchar(20));

insert into accounts values('radiogenius');
insert into accounts values('iamaradiogenius');
insert into accounts values('notgenius');
insert into accounts values('iamnotgenius');
select * from accounts;
usernames
-----------
radiogenius
iamaradioge
notgenius
iamnotgeniu

query

select usernames from accounts where usernames LIKE '%r%a%g%';
usernames
-----------
radiogenius
iamaradioge

Add a comment
Know the answer?
Add Answer to:
mysql Imagine ,you have a table named as 'accounts' table, where you have a column names...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • MySQL 1. Add a column named Status to the Vendor Table. This is to contain a...

    MySQL 1. Add a column named Status to the Vendor Table. This is to contain a 0 -10 value to represent their selection choice as a vendor. 2. Find the last name and first name for every customer who has a credit limit of at least $800. 3.List the part number, part description, unit price, and quantity on hand for every part that has a unit price greater than the unit price of any part on hand.

  • Need MySql commands for Use a UNION statement. Display the address ID, address, and district from...

    Need MySql commands for Use a UNION statement. Display the address ID, address, and district from the address table where the district is California or Alberta. Display the address ID, address, and district only from the address table where the address contains Jol. Display the language ID and name from the language table and the film ID from the film table. Display all languages whether they have an associated film or not. Order results by language ID in ascending order....

  • Consider the following table definition, where the primary keys are underlined. Give an expression in relational...

    Consider the following table definition, where the primary keys are underlined. Give an expression in relational algebra for each of the following queries. Athlete (aID integer, aName string, ranking integer, age integer) Event (eID string, eName string, eLocation string) Competes (aID integer, eID string, sport string, year integer) 1. Find the names of athletes who have competed in event 1Sk8P (eiD = ‘1Sk8P’) 2. Find the names of athletes who have competed in the event XGames (eName = ‘XGames’) 3....

  • This assignment will continue our hardware store system. You will turn in a java file named...

    This assignment will continue our hardware store system. You will turn in a java file named "MyMethods.java". It will contain one class named "MyMethods". That class will contain three methods. These methods must be exactly as specified (including method names): getAnInt will return a value of type int, and take as an argument a string to prompt the user. The actual prompt presented to the user should include not only the string argument, but also the information that the user...

  • You will turn in a java file named "MyMethods.java". It will contain one class named "MyMethods". That class will contain three methods. These methods must be in JOptionPane and must c...

    You will turn in a java file named "MyMethods.java". It will contain one class named "MyMethods". That class will contain three methods. These methods must be in JOptionPane and must contain: getAnInt will return a value of type int, and take as an argument a string to prompt the user. The actual prompt presented to the user should include not only the string argument, but also the information that the user may press Cancel or enter an empty string to...

  • Write you code in a class named HighScores, in file named HighScores.java. Write a program that...

    Write you code in a class named HighScores, in file named HighScores.java. Write a program that records high-score data for a fictitious game. The program will ask the user to enter five names, and five scores. It will store the data in memory, and print it back out sorted by score. The output from your program should look approximately like this: Enter the name for score #1: Suzy Enter the score for score #1: 600 Enter the name for score...

  • Put all of your SQL code in a file named grades.sql and submit it below. Download...

    Put all of your SQL code in a file named grades.sql and submit it below. Download the starter code, which contains import_grades.sql and the grades.csv file. Using he import_grades, sql file, create your database and table. - 0 eded. 1 T Une Modify the LOAD DATA INFILE to correct the path to load the grades.csv file, and add/remove LOCAL he only modification you may make to the import_grades.sql or the grades.csv files. The data represents grades for assignments in a...

  • For this problem, assume salesperson data are stored in a database table named staff. Also assume the columns in the table are named name, carsSold, and totalSales Write a Python function named ge...

    For this problem, assume salesperson data are stored in a database table named staff. Also assume the columns in the table are named name, carsSold, and totalSales Write a Python function named getSalesSortedByNames. Your function will have 2 parameters. The first parameter is a database cursor and the second parameter is a float. Your function should start by retrieving those rows in the staff table whose totalsales field is equal to the second parameter. (The next paragraph shows the Python...

  • 0. Modify or create the table(file) named Staff first used in assignment 5. There is no...

    0. Modify or create the table(file) named Staff first used in assignment 5. There is no change to the structure, and if you need to recreate it the column names, data types and lengths are described below: Table Name Column Name Data Type Length Comment/constraint Staff: id int name varchar office char fee decimal reviewDate date 3 primary key 15 not null 7 7,2 default 0.00 Initials have been added to the name column values, so data for an insert...

  • File Processing and Arrays Create a class named FilesAndArrays. Download the sidewalk.txt file so it is...

    File Processing and Arrays Create a class named FilesAndArrays. Download the sidewalk.txt file so it is in your project’s root folder. Write a static method named findFirstMatch that accepts as its parameters a Scanner for an input file and an array of Strings keywords representing a list of keywords in a search. Your method will read lines from its input Scanner and should return the line number of the first line in the file that contains one or more words...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT