Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started