Vous êtes sur la page 1sur 3

1. Provide the create table syntax to Create a Table Employee whose detail s are as below.

Employee(EmployeeID, LastName, FirstName, Address, DateHired) Answer: create table Employee( EmployeeID number(5) primary key, LastName varcha r(10), FirstName varchar(10), Address varchar(50), DateHired date ); 2. s. Provide the INSERT query to be used in Employee Table to fill the Detail

Answer: insert into Employee values( 53107,'Kumar','Abhishek','Ranchi-Piska More ', '22-AUG-12'); 3. When we give SELECT * FROM EMPLOYEE .How does it Respond?

Answer: when we hit the query of select * from employee it returns all the data present in the column of employee table. 4. Create a Table CLIENT whose details are as below. Client(ClientID, LastName, FirstName, Balance, EmployeeID) Answer: create table CLIENT( ClientID number(5) primary key, LastName varchar(10 ), FirstName varchar(10), Balance int(10), EmployeeID int(5)); 5. Provide the INSERT query to be used in CLIENT Table to fill the Details.

Answer: Insert into CLIENT values(23177,'Kapoor','Ronit',6200, 77644); 6. When we give SELECT * FROM CLIENT .How does it Respond?

Answer: when we hit the query of select * from CLIENT it returns all the data pr esent in the column of CLIENT table. 7. a. b. c. d. Choose the correct answer. The SQL command to create a table is: Make Table Alter Table Define Table Create Table

Answer: d. Create Table 8. a. b. c. d. Choose the correct answer. The DROP TABLE statement: deletes the table structure only deletes the table structure along with the table data works whether or not referential integrity constraints would be violated is not an SQL statement b. deletes the table structure along with the table data What are the different data types available in SQL server?

Answer: 9.

1) Numeric : Stores numeric values. 2) Monetary : It stores numeric values with decimal places. It is used spe cially for currency values. 3) Date and Time : It stores date and time information. 4) Character : It supports character based values of varying lengths. 5) Binary : It stores data in strict binary (0 or 1) representation. 6) Special purpose: SQL Server contains Complex data types to handle the X ML Documents, Globally unique identifiers etc.

10. Which is the subset of SQL commands used to manipulate Oracle Database s tructures, including tables? DDL( Data Deifinition Language) Create Alter Drop Rename Truncate Comment 11. What operator performs pattern matching?

Answer: LIKE operator is used in a WHERE clause to search for a specifie d pattern in a column 12. Answer: 13. Answer: 14. Answer: What operator tests column for the absence of data? IS NULL Operator Which command executes the contents of a specified file? START or @ command. What is the parameter substitution symbol used with INSERT INTO command? '&' - ampersand operator.

15. Which command displays the SQL command in the SQL buffer, and then execu tes it? Answer: RUN. 16. What are the wildcards used for pattern matching?

Answer: _ = single character substitution . % = multiple character substitution. [CHARLIST] = any single charecter in CHARLIST ^[CHARLIST] = any single charecter NOT in CHARLIST 17. State whether true or false. EXISTS, SOME, ANY are operators in SQL.

Answer: TRUE

18. State whether true or false. !=, <>, ^= all denote the same operation. Answer: TRUE 19. rs? Answer: all. What are the privileges that can be granted on a table by a user to othe Insert, update, delete, select, references, index, execute, alter,

20.What command is used to get back the privileges offered by the GRANT command?

Answer: REVOKE 20. Which system tables contain information on privileges granted and privil eges obtained? Answer: USER_TAB_PRIVS_MADE, USER_TAB_PRIVS_RECD . 21. Which system table contains information on constraints on all the tables created? Answer: USER_CONSTRAINTS. 22. Answer: Delete: The DELETE command is used to remove rows from a table. A WHERE clause can be used to remove some rows only. If no WHERE condition is specified, all rows will be removed. After performing a DELETE operation you need to COMMIT the transaction t o make the change permanent. If not committed, the change can be rolled back using the ROLLBACK state ment, so the deleted data can be restored. This operation will cause all DELETE triggers on the table to fire. Truncate: The TRUNCATE command removes all rows from a table. The operation cannot be rolled back, i.e., the operation is permanent. NO triggers will be fired. As such, TRUCATE is faster and doesn't use as much undo space as a DELET E. 22. What command is used to create a table by copying the structure of anoth er table? Answer: CREATE TABLE TABLE2 AS SELECT * FROM TABLE1; What is the difference between TRUNCATE and DELETE commands?

Vous aimerez peut-être aussi