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.
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.
Create a file named StudentArrayList.java,within the file create a class named StudentArrayList. This class is meant...
Create a file named StudentArrayList.java,within the file create a class named StudentArrayList. This class is meant to mimic the ArrayList data structure. It will hold an ordered list of items. This list should have a variable size, meaning an arbitrary number of items may be added to the list. Most importantly this class should implement the interface SimpleArrayList provided. Feel free to add as many other functions and methods as needed to your class to accomplish this task. In other...
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...
CS 209 Data Structure 3. a. Create a class named Point3D that contains 3 instance variables...
CS 209 Data Structure 3. a. Create a class named Point3D that contains 3 instance variables x, y, and z. b. Create a constructor that sets the variables. Also, create get and set methods for each variable. c. Create a toString() method. d. Make Point3D implement Comparable. Also, create a compareTo(Point3D other) method that compares based on the x-coordinate, then y-coordinate for tiebreakers, then z-coordinate for tiebreakers. For example, (1, 2, 5) comes before (2, 1, 4), which comes before...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT