Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Create a table COPYOFDEPT as a copy of the table DEPT. syntax: CREATE TABLE new_table SELECT * FROM original_table; 2. Delete all the rows

1. Create a table COPYOFDEPT as a copy of the table DEPT.

syntax: CREATE TABLE new_table SELECT * FROM original_table;

2. Delete all the rows from COPYOF DEPT table.

syntax: DELETE FROM table_name;

3. Remove COPYOF DEPT table.

Syntax: DROP TABLE table_name;

4. Drop Foreign key defined on SuperSSN and add it using Alter table command.

Syntax: To drop foreign keys using the command line, enter: ALTER TABLE name DROP FOREIGN KEY foreign_key_name.

5. Add Foreign Keys to DEPT table (to any column ) using Alter Table .

Syntax: Add Foreign key to the Existing Table. If you want to add the foreign key to the existing table, you have to use the following ALTER syntax in

SQL: ALTER TABLE Table_Name1 ADD CONSTRAINT ForeignKey_Name FOREIGN KEY (Column_Name) REFERENCES Table_Name2 (Column_Name);

6. Find the employee names having salary greater than Rs.25000.

SELECT emp_name FROM employee WHERE emp_salary>=25000;

7. Find the employee names whose salary lies in the range between 30000 and 70000.

Sample Solution: SELECT * FROM employees WHERE salary BETWEEN 1000 and 3000; or SELECT * FROM employees WHERE salary BETWEEN (SELECT 1000) AND 3000;

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions

Question

be reported on the income staternent for the therm missing

Answered: 1 week ago

Question

=+C&B (especially taxation) laws, regulations, and practices?

Answered: 1 week ago

Question

=+designing international assignment C&B packages.

Answered: 1 week ago