Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Make sure those queries are work in SQL Server Q-28. Write An SQL Query To Clone A New Table From Another Table. Ans. The general

Make sure those queries are work in SQL Server

Q-28. Write An SQL Query To Clone A New Table From Another Table. Ans.

The general query to clone a table with data is:

SELECT * INTO WorkerClone FROM Worker; The general way to clone a table without information is:

SELECT * INTO WorkerClone FROM Worker WHERE 1 = 0; An alternate way to clone a table (for MySQL) without is:

CREATE TABLE WorkerClone LIKE Worker;

Q-29. Write An SQL Query To Fetch Intersecting Records Of Two Tables. Ans.

The required query is:

(SELECT * FROM Worker) INTERSECT (SELECT * FROM WorkerClone);

Q-30. Write An SQL Query To Show Records From One Table That Another Table Does Not Have. Ans.

The required query is:

SELECT * FROM Worker MINUS SELECT * FROM Title;

Q-31. Write An SQL Query To Show The Current Date And Time. Ans.

Following MySQL query returns the current date:

SELECT CURDATE(); Following MySQL query returns the current date and time:

SELECT NOW(); Following SQL Server query returns the current date and time:

SELECT getdate(); Following Oracle query returns the current date and time:

SELECT SYSDATE FROM DUAL;

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

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

More Books

Students also viewed these Databases questions

Question

Q.No.1 Explain Large scale map ? Q.No.2 Explain small scale map ?

Answered: 1 week ago