- Details
- Last Updated: Wednesday, 04 October 2017 Hits: 553303
¨SQL provides broad support for nested subqueries ¤A SQL query is a “select-from-where” expression ¤Nestedsubqueriesare “select-from-where” expressions embedded within another query ¨Can embed queries in WHEREclauses ¤Sophisticated selection tests ¨Can embed queries in FROMclauses ¤Issuing a query against a derived relation. Protect query performance during upgrades to the newer versions of SQL Server Who This Book Is For Developers and database administrators with responsibility for application performance in SQL Server environments. SQL>select sysdate from dual; 15) Display the list of all users in your database (use catalog table). SQL>select * from all_users; 16) Display the names of all tables from current user; SQL>select * from tab; 17) Display the name of the current user.
- SQL WHERE ANY, ALL Clause. ANY and ALL keywords are used with a WHERE or HAVING clause. ANY and ALL operate on subqueries that return multiple values. ANY returns true if any of the subquery values meet the condition. ALL returns true if all of the subquery values meet the condition.
- I worte the query and for get the field name and value from database. But it takes the field name and not consider the field values. Mysql_num_fields() this method is used to get the field name and mysql_fetch_row() this method is used to get the field values.
Frequently asked basic and advanced Top 80 + SQL Queries Interview Questions and Answers with Examples for Business Analyst, Data Analyst, DBA, Freshers and Experienced Java, PHP, Dot Net programmers in Oracle, MySQL and MS SQL Database.
Are you an Experienced Programmer or Database Administrator ? If so, visit our Interview Questions on Advanced and Complex SQL Querysection of this article. For each question, if the SQL Commands differ for Oracle, MySQL and SQL Server Databases, specific queries with respect to a database is provided. If the answers are same for all databases, only one query is specified. Interview Questions on SQL are based on following two tables, Employee Table and Employee Incentive Table.
Table Name : Employee
Employee_id | First_name | Last_name | Salary | Joining_date | Department |
---|---|---|---|---|---|
1 | John | Abraham | 1000000 | 01-JAN-13 12.00.00 AM | Banking |
2 | Michael | Clarke | 800000 | 01-JAN-13 12.00.00 AM | Insurance |
3 | Roy | Thomas | 700000 | 01-FEB-13 12.00.00 AM | Banking |
4 | Tom | Jose | 600000 | 01-FEB-13 12.00.00 AM | Insurance |
5 | Jerry | Pinto | 650000 | 01-FEB-13 12.00.00 AM | Insurance |
6 | Philip | Mathew | 750000 | 01-JAN-13 12.00.00 AM | Services |
7 | TestName1 | 123 | 650000 | 01-JAN-13 12.00.00 AM | Services |
8 | TestName2 | Lname% | 600000 | 01-FEB-13 12.00.00 AM | Insurance |
Employee_ref_id | Incentive_date | Incentive_amount |
---|---|---|
1 | 01-FEB-13 | 5000 |
2 | 01-FEB-13 | 3000 |
3 | 01-FEB-13 | 4000 |
1 | 01-JAN-13 | 4500 |
2 | 01-JAN-13 | 3500 |
SQL Queries Interview Questions and Answers on 'SQL Select'
1. Get all employee details from the employee table
![All Sql Query In Pdf All Sql Query In Pdf](https://docs.microsoft.com/en-us/azure/cosmos-db/media/sql-api-sql-query-cheat-sheet/microsoft-sql-api-sql-query-cheat-sheet-v4.png)
2. Get First_Name,Last_Name from employee table
3. Get First_Name from employee table using alias name “Employee Name”
4. Get First_Name from employee table in upper case
5. Get First_Name from employee table in lower case
Don't Miss - SQL and Database theory Interview Questions
7. Select first 3 characters of FIRST_NAME from EMPLOYEE
8. Get position of 'o' in name 'John' from employee table
9. Get FIRST_NAME from employee table after removing white spaces from right side
10. Get FIRST_NAME from employee table after removing white spaces from left side
All Sql Query In Pdf File
11. Get length of FIRST_NAME from employee table
12. Get First_Name from employee table after replacing 'o' with '$'
13. Get First_Name and Last_Name as single column from employee table separated by a '_'
14. Get FIRST_NAME ,Joining year,Joining Month and Joining Date from employee table
Using And In Sql Query
- Prev
- 1