zulifqar
Answered On : May 20th, 2006
1)What is the maximum value that can be stored for a datetime field?
- When a record is inserted into a table containing fields of type DATETIME, the DATETIME field(s) are NOT changed.
- The valid range for the DATETIME field type is '0000-01-01 00:00:00' - '9999-12-31 23:59:59' when used in a string context, and '00000000000000' - '99991231235959' when used in a numeric context.
The DATETIME type is eight bytes long.
2)SELECT * FROM Persons ORDER BY FirstName DESC
3) SELECT * FROM Persons WHERE LastName BETWEEN 'Hansen' AND 'Pettersen'
4). Query 2 will return an error
Login to rate this answer.
1)-----------------a2)-----------------b3)-----------------d4)-----------------b5)-----------------c6)-----------------e7)-----------------c8)-----------------c9)-----------------10)---------------11)---------------a12)---------------13)---------------
Login to rate this answer.
ashish jain
Answered On : Aug 23rd, 2006
1. a. Dec 31, 9999
2. d. SELECT * FROM Persons ORDER BY FirstName DESC
3. d. SELECT * FROM Persons WHERE LastName BETWEEN 'Hansen' AND 'Pettersen'
4. a. Query 2 will return an error
5. a. @@colcount
6. e. It will return an error since * is used alone for one table only
7. d. BIGINT (not sure)
8. c. Logical
9.
10. b. Pessimistic locking is a locking scheme handled by the server, whereas optimistic locking is handled by the application developer
11. a. desc myTable
12.
Login to rate this answer.
Following answers are for SQL Server (few verified on SQL 2005)
1. ... (a)
2. ... (d)
3. ... (d)
4. ... (a)
5. ... (e) In SQL @@Variable = is a global variable @Variable = local
6. ... (c) It returns cartesian product of both the table columns with last column 'branch_name'
7. ... (e) MONEY - is the only with decimal value with ten-thousandth place for monetary unit. Storage size is 8 bytes. All other are integer only but still the valid data type
8. ... (c) Logical
9. ... (d) Even if any runtime error happens the batch will execute from next SQL statement. Batch Execution will not halt.
10. ... (b)
11. ... (c) sp_columns [For SQL Server] desc myTable [its Oracle]
12. ... (e)
13. ... (d)
14. ... (d) Question repeated above (9)
Login to rate this answer.
1. a.Dec 31, 9999
2. a. SELECT * FROM Persons WHERE FirstName ORDER BY FirstName DESC
suggested: SELECT FROM Persons WHERE FirstName ORDER BY FirstName DESC
3. d. SELECT * FROM Persons WHERE LastName BETWEEN 'Hansen' AND 'Pettersen'
suggested: SELECT FROM Persons WHERE LastName BETWEEN 'Hansen' AND 'Pettersen'
4. a. Query 2 will return an error
suggested: Both the query will return an error
5. @@colcount
6. It will return the fields customer_id, customer_name, branch_id, branch_name, branch_name
7. All are numeric
8. c. Logical
9. d. None of the statements in the batch is executed if there are any fatal errors in the batch (fatal errors are the runtime error)
10. a. Optimistic locking is a locking scheme handled by the server, whereas pessimistic locking is handled by the application developer (not sure)
11. c. sp_columns myTable
12. e. TESTAMP
13) d. All of the above are true
14) d. None of the statements in the batch is executed if there are any fatal errors in the batch
Login to rate this answer.