Você está na página 1de 4

Question 1: Provide the create table syntax to Create a Table Employee whose details are as below.

Employee(EmployeeID, LastName, FirstName, Address, DateHired)] Ans: create table Employee(EmployeeID number(5) constraint empid_pk primary key, LastName varchar2(15), FirstName varchar2(20),address varchar2(15), date date) Question 2: Provide the INSERT query to be used in Employee Table to fill the Details. Ans: Insert into Employee values(1001,selvam,ramya,ramsaraswathi nagar,12-jan-2011); Question 3: When we give SELECT * FROM EMPLOYEE .How does it Respond? Ans: To display all columns that have stored by the user in the table employee we can use select * from employee. Only one record has been stored in the table employee which will displayed. Question 4: Create a Table CLIENT whose details are as below. Client(ClientID, LastName, FirstName, Balance, EmployeeID) Ans: create table Client(ClientID number(5) constraint cli_pk primary key,LastName varchar2(20),FirstName varchar2(20),Balance number(15),EmpID number(5) constraint emp_ID_fk references Employee(EmployeeID)) Question 5: Provide the INSERT query to be used in CLIENT Table to fill the Details. Ans : Insert into Client(ClientID, LastName, FirstName, Balance, EmployeeID) values(&value1,&value2,&value3,&value4,&value5) /*&value1,&value2 these are used get the dynamic values i.e., getting values at run time in any numbers.*/ Question 6: When we give SELECT * FROM CLIENT .How does it Respond? Ans: It will return all the records has been stored under the table client. Question 7: Choose the correct answer. The SQL command to create a table is:

a. Make Table b. Alter Table c. Define Table d. Create Table ans : d. Create table Question 8: Choose the correct answer. The DROP TABLE statement: a. deletes the table structure only b. deletes the table structure along with the table data c. works whether or not referential integrity constraints would be violated d. is not an SQL statement ans : b. deletes the table structure along with the table data Question 9: What are the different data types available in SQL server? Ans: 1. Numeric : Stores numeric values. 2. Monetary : It stores numeric values with decimal places. It is used specially 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. Question 10: Which is the subset of SQL commands used to manipulate Oracle Database structures, includingtables? Ans: Data Definition Language Question 11: What operator performs pattern matching? Ans: LIKE operator..(if we want to list employees whose name start with the letter

R we have to use like r%) Question 12: What operator tests column for the absence of data? Ans: IS NULL operator Question 13: Which command executes the contents of a specified file? Ans: START Question 14: What is the parameter substitution symbol used with INSERT INTO command? Ans: & operator Question 15: Which command displays the SQL command in the SQL buffer, and then executes it? Ans: RUN Question 16: What are the wildcards used for pattern matching? Ans : _ and % Question 17: State whether true or false. EXISTS, SOME, ANY are operators in SQL. Ans : true Question 18: State whether true or false. !=, <>, ^= all denote the same operation. Ans : True Question 19: What are the privileges that can be granted on a table by a user to others? Ans: select, delete,insert,update,execute,alter,all,update Question 20: What command is used to get back the privileges offered by the GRANT command? Ans: revoke

Question 21: Which system tables contain information on privileges granted and privileges obtained? Ans: USER_TAB_PRIVS_MADE, USER_TAB_PRIVS_RECD . Question 22: Which system table contains information on constraints on all the tables created? Ans: USER_CONSTRAINTS. Question 23: What is the difference between TRUNCATE and DELETE commands? Ans: 1.DELETE command is DML command and TRUNCATE is a DDL command. 2. DELETE command can be get back while TRUNCATE deleted the table permanently. 3. DELETE command In which where clause will be used while in TRUNCATE it cannot be used

Question 24: What command is used to create a table by copying the structure of another table? Ans: create table new as select * from existing where x=y, Here If the where clause condition gets satisfied then it will display all the records.