Q.1 Write an SQL query for fetching “FIRST_NAME” from the Customer table using < Customer_NAME> as alias.
Ans. The query that you can use is:
Q.2 What is an SQL Query for fetching the “FIRST_NAME” from Customer table in upper case?
Ans. The query that you can use is:
Q.3 What is an SQL query for fetching the unique values of the column DEPARTMENT from the Customer table?
Ans. The query that you cam use is:
Q.4 Write an SQL query for printing the first three characters of the column FIRST_NAME.
Ans. The query that can be used is:
Q.5 What is an SQL query for finding the position of the alphabet (‘A’) in the FIRST_NAME column of Ayush.
Ans. The query that can be used is:
Q.6 What is an SQL Query for printing the FIRST_NAME from Customer Table after the removal of white spaces from right side.
Ans. The query that can be used is:
Q.7 Write an SQL Query for printing the DEPARTMENT from Customer Table after the removal of white spaces from the left side.
Ans. The query that you can use is:
Q.8 What is an SQL query for fetching the unique values from the DEPARTMENT column and thus printing is the length?
Ans. The query that you can use is:
Q.9 Write an SQL query for printing the FIRST_NAME after replacing ‘A’ with ‘a’.
The query that can be used is:
Q.10 What is an SQL query for printing the FIRST_NAME and LAST_NAME into a column named COMPLETE_NAME? (A space char should be used)
Ans. The query that can be used is:
Q.11 What is an SQL query for printing all details of the Customer table which ordered by FIRST_NAME ascending?
Ans. The query that can be used is:
Q.12 Write an SQL query for printing the all details of the Customer table which ordered by FIRST_NAME ascending and the DEPARTMENT in descending
The query that can be used is:
Q.13 What is an SQL query to print the details of the Customer ‘NISHANT’ and ‘PRIYANSH’.
Ans. The query that can be used is:
Q.14 What is an SQL query printing all details of Customer excluding the first names of ‘NISHANT’ and ‘PRIYANSH’.
Ans. The query that can be used is:
Q.15 Write an SQL query for printing the details of DEPARTMENT name as “Admin”.
Ans. The query that can be used is:
Q.16 What is an SQL query for printing the details of Customer whose FIRST_NAME Contains ‘A’?
Ans. The query that can be used is:
Q.17 What is an SQL Query for printing the FIRST_NAME of Customer whose name ends with ‘A’?
Ans. The query that can be used is:
Q.18 What is an SQL Query for printing the details of the Customer whose FIRST_NAME ends with ‘H’ and contains six alphabets?
Ans. The query that can be used is:
Q.19 Write an SQL Query for printing the details of Customer whose SALARY lies between 10000 and 20000.
Ans. The query that can be used is:
Q.20 Write an SQL Query for printing the details of Customer who joined in Feb’2014
Ans. The query that can be used is:
Q.21 Write an SQL Query for fetching the count of Customer in DEPARTMENT with ‘Admin’.
Ans. The query that can be used is:
Q.22 Write an SQL Query for fetching the details of Customer with Salaries >= 5000 and <= 10000.
Ans. The query that can be used is:
Q.23 What is an SQL Query for fetching the no. of Customer in each department in descending order?
Ans. The query that can be used is:
Q.24 What is an SQL Query for printing the details of Customer who are also managers?
Ans. The query that can be used is:
Q.25 Write an SQL Query for fetching the details of duplicate records in some fields.
Ans. The query that can be used is:
Q.26 What is an SQL Query for only showing odd rows?
Ans. The query that can be used is:
Q.27 What is an SQL Query for only showing even rows?
Ans. The query that can be used is:
Q.28 Write an SQL Query for cloning a new table from another table.
Ans. The general query that can be used to clone a table with data is:
Q.29 Write an SQL Query for fetching the intersecting details of two tables.
Ans. The query that can be used is:
Q.30 What is an SQL Query for showing the details of one table that another doesn’t have.
Ans. The query that can be used is:
Q.31 Write a query to count the number of unique records in a table?
We can count the number of unique records in our table using the Distinct and the count keywords.
Query:
Q.32 Write a query to show the working of the SUM() function in SQL?
The SUM() function in SQL is put to use on the integer columns to return the total of all the entries.
Let us write the query to understand it further.
Query:
SQL JOINS
BASIC SQL Query
Subscribe to:
Post Comments (Atom)
Stay Connected To Get Free Updates! Subscribe via Email
|
No comments:
Post a Comment