Question

In: Computer Science

Question 3. Issue the following statement to create a copy of the d_clients table named d_clients_copy...

Question 3. Issue the following statement to create a copy of the d_clients table named d_clients_copy and write ONE statement to update this table. create table d_clients_copy as select * from d_cliens Change the phone number for Hiram Peters to 5551212 and email to [email protected]

Solutions

Expert Solution

Hello,

Good Day!

/* Create a table called  d_clients*/
CREATE TABLE d_clients(Name varchar(20), Phone int, email varchar(50));

/* Inserting records in to table d_clients */
INSERT INTO d_clients VALUES('Hiram Peters',5551210,'[email protected]');

/* Display all the records from the table */
SELECT * FROM d_clients;

Output:

Hiram Peters|5551210|[email protected]

Solution:

/*create a copy of the d_clients table named d_clients_copy and write ONE statement to update this table. create table d_clients_copy as select * from d_cliens Change the phone number for Hiram Peters to 5551212 and email to [email protected] */

create table d_clients([name] varchar(20),phone int,email varchar(50));
insert into d_clients ([name],phone,email) values('Hiram Peter',5551210,'[email protected]');
insert into d_clients ([name],phone,email) values('David',5551211,'[email protected]');
select * from d_clients;


select [name],case when[name]='Hiram Peter' then 5551212 else phone end AS phone,email into d_clients_copy from d_clients;
select * from d_clients_copy;

This query will create table d_clients_copy with d_clients skeleton and the value of the one record in the table will be replaced with phone 5551212 and email "[email protected]".

Thank you!


Related Solutions

1. Write the statements to create a table named REQUIREMENTS. The table has the following columns:...
1. Write the statements to create a table named REQUIREMENTS. The table has the following columns: credits number (primary key) and degree name. 2. Write the statements to create a table named CANDIDATE with the following columns names. Pick the best column type: student_id, first name, last name, credits and graduation date. The credits column is a foreign key to the credits column in the REQUIREMENTS table. 3. Write the statement(s) to Insert 2 rows in your REQUIREMENTS table. Make...
Create a new table named CUSTOMER_STATUS.The table will hold the Customer_Status_Id and the Customer_Status_Description with possible...
Create a new table named CUSTOMER_STATUS.The table will hold the Customer_Status_Id and the Customer_Status_Description with possible values: Inactive, Active, Very_Active These values will be used to characterize the customers so that:                   Inactive Customers => Have 0 orders                   Active Customers => Have between 1 and 3 orders Very Active Customers => Have 4 or more orders
Create a Python Module named piphash_rainbow.py that Creates a rainbow table named sixdigithash_rainbow.csv that stores all...
Create a Python Module named piphash_rainbow.py that Creates a rainbow table named sixdigithash_rainbow.csv that stores all possible six-digit pins and their corresponding md5, sha1, sha256, and sha512 hashes.
Question: In a package named "oop" create a Scala class named "Team" and a Scala object...
Question: In a package named "oop" create a Scala class named "Team" and a Scala object named "Referee". Team will have: • State values of type Int representing the strength of the team's offense and defense with a constructor to set these values. The parameters for the constructor should be offense then defense • A third state variable named "score" of type Int that is not in the constructor, is declared as a var, and is initialized to 0 Referee...
In a package named "oop" create a Scala class named "Score" with the following: • A...
In a package named "oop" create a Scala class named "Score" with the following: • A constructor that takes an Int and stores it in a member variable named score • A method named scoreGoal that takes no parameters and has return type Unit that increments the score by 1 • A method named isWinner that takes a Score object as a parameter and returns a Boolean. The method returns true if this instances score is strictly greater than the...
Use a single SQL statement to create a relational table and to load into the table...
Use a single SQL statement to create a relational table and to load into the table department name, subject code, year of running and session of running that offered by the departments. Note that a running subject offered by a department means a lecturer of the department has been assigned to teach the subject. Next, enforce the appropriate consistency constraints on the new table.    When ready use SELECT statement to list the contents of the relational table created and...
3. Write the statements to: • create a user named FooBar with a password of “candybar”...
3. Write the statements to: • create a user named FooBar with a password of “candybar” • assign the payments role created in the previous question to FooBar • assign the create session privilege to FooBar • Show the statements to connect to FooBar 4. For this question, I only need the query statement and not the results. Write the queries that use the user_sys_privs, user_tab_privs, user_role_privs, role_sys_privs and role_tab_privs objects to view the user and role privileges that are...
Question 3: Please create a statement of cash flow with indirect method- Please provide answers to...
Question 3: Please create a statement of cash flow with indirect method- Please provide answers to each category and a one paragraph analysis of the cash flow using the indirect method. Statement of Cash Flow with Indirect method 2011 2010 Difference Operating Investing Financing ASSETS: Current Assets Cash and equivalents $ 2,291.1 $ 2,133.9 Short-term investments    1,164.2       642.2 Account receivable    2,883.9    2,795.3 Inventory    2,357.0    2,438.4 Prepaid expenses and other assets       765.6       602.3...
Identify the steps you would take to create a one-field table named Titles that could
Identify the steps you would take to create a one-field table named Titles that could be used to constrain the values in the Title field of the Employees table to the existing values in that field.
A copy of CA 16-3: For various reasons a corporation may issue warrants to purchase shares...
A copy of CA 16-3: For various reasons a corporation may issue warrants to purchase shares of its common stock at specified prices that, depending on the circumstances, may be less than, equal to, or greater than the current market price. For example, warrants may be issued: 1.To existing stockholders on a pro rata basis. 2.To certain key employees under an incentive stock-option plan. 3.To purchasers of the corporation's bonds. Instructions (a) For each of the three examples of how...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT