How to update employee email address from employee table (need to change just domain name of all employees) [closed] - sql

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have employee table with 100 records and have email-id column in it.
but suppose now company has changed domain of email id example:- earlier it was abc#example.com
now it has changed to abc#gmail.com
so how to update same in employees table only have to change domain name from email id of employee table
Please suggest some way in oracle plsql or sql

You can use REPLACE as follows:
UPDATE EMPLOYEE
SET EMAIL = REPLACE(EMAIL,'#example.com','#gmail.com')

Related

Im trying to to figure out what I need to write on sql command oracle [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
For every customer that lives in Florida, list customer number, last name, first name,
and region.
I will assume that you are trying to get the information from a table called "table".
select customer_number,
last_name,
first_name,
region
from table
where city = 'Florida'

How to pull list of all the customer with first_name as alphanumeric value [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have a table name clients, now I want to pull a list of all the customers having first_name as alphanumeric value as an example, jriqbal23, sam45del etc.
If I need to pull the details of single customer, I can run below SQL:
select customer_id,email,first_name,last_name,middle_name from clients
where
email='jriqbal23#gmail.com';
how to change this query for pulling the list of all the customer having first name in similar way ?
thanks in advance.
If you use Oracle database, you can query client data with regexp_like:
Alphanumeric case:
select *
from clients
where regexp_like(first_name, '\w+');
Digits case:
select *
from clients
where regexp_like(first_name, '\d+');

POSTGRESQL: Insert Data from another table [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
In above table customer ids are listed what I want to do is to get those ids from this table,
create another table named PROMOTION CLASSES where PREMIUM, PLUS AND NORMAL are in columns and put first 100 ids under PREMIUM COLUMN and soon.
Please help.
This creates you table with classification
CREATE TABLE promotion_classes as
SELECT customer_id,
case when customer_id < 100 then
'PREMIUM'
else
'NORMAL'
END as CLASSES
FROM CUSTOMER_TBL

Filter in SQL from search keyword [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I have one table student. If I filter a student using a keyword "ann", then 1st preference should be student name starts with "ann", then student name contains "ann" in SQL Server.
Use LIKE
SELECT * FROM TABLE WHERE NAME LIKE 'ann%' OR NAME LIKE '%ann%'
ORDER BY CASE
WHEN Name LIKE 'ann%' THEN 1
WHEN Name LIKE '%ann%' THEN 2
ELSE 3
END

Adding a prefix to a value [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have a table called EMP_SAL which has 2 columns EID number(7), SAL number(4).
EID column values: 100,101,102
SAL column values: 1000,2000,3000
I want to update the table so that the values in the EID column are displayed like ENO.100,ENO.101,ENO.102 instead of showing 100,101,102.
The answer is No. You cannot put characters in a number column. You should redesign your table and make the EID column varchar2 in order to put characters there.
The update would be simple:
Update EMP set EID='ENO.'||EID;