where
In SQL, the UNION operation combines the result sets of two or more queries into a single result set, removing any duplicate rows. The INTERSECT operation returns only the common rows that appear in both result sets of two or more queries.
All rows & columns in a table can be selected by using the below query Select * from table_name If you do not have any where condition in the query then all rows will be selected.
EXISTS is more efficient that IN , Because EXISTS use indexes of the table and hence scans the table faster, as well as it returns the boolean value (T or F), If T is received for EXISTS clause than the rows will be returned otherwise not. where as IN works as simple query where it will scan all possible values in the table and than compares the condition given by you and then the result.
I'm actually not familiar with Access, but I'll try to help. Usually the primary key will physically order the rows in a database table. In SQL-query you can use "order by" clause. The default order is usually ascending. You can also add "asc" or "desc" after the column name. Please do notice, primary keys are not for ordering rows. You should really let the database decide how to save the rows. You should always order the rows in your query (if needed), not modify or trust the physical order! select col1 from foo order by col2 select col1 from foo order by col2 desc, col3 asc
The SELECT clause is used to retrieve rows and columns from tables. Ex: Select * from employee
You apply criteria to queries using the WHERE clause. ex: Select * from tbl_emp This query would fetch all rows from the table tbl_emp Select * from tbl_emp where emp_name = "Rocky" This query would fetch all rows from the table that have employee name as Rocky
KEEP ROWS and PURGE ROWS
You can have a table without rows. It would be an empty table with no data. select (*)count from TABLENAME; 0 rows returned.
TRUE
The most important thing about normalization of tables in a database for the purposes of query writing is to allow only the data wanted to be returned and you don't end up with what is called a Cartesian product... where it is possible that all rows are returned in error because the keys from table to table are not normalized correctly.
Selection has more power to reduce size (Number of rows) while projection can not reduce number of tuples
Order by