Sunteți pe pagina 1din 6

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

Employee(EmployeeID, LastName, FirstName, Address, DateHired) Ans) Sql>create table Employee (EmployeeID varchar2(10),LastName varchar2(10),FirstName varchar2(10),Address char(50), DateHired Date);

Question 2: Provide the INSERT query to be used in Employee Table to fill the Details. ANS) Sql>insert into Employee values(&EmployeeID,&LastName,&FirstName,&Address,&DateHired); Enter value for EmployeeID=A101 Enter value for LastName=Depp Enter value for FirstName=Johnny Enter value for Address=H.no 101,Johnny street,North Carolina,USA Enter value for DateHired=27-feb-1990 1 row created Sql>/ Enter value for EmployeeID=A102 Enter value for LastName=Hanks Enter value for FirstName=Tom Enter value for Address=H.no 102,TOM street,Florida,USA Enter value for DateHired=14-mar-1992 1 row created Sql>Commit;

Question 3: When we give SELECT * FROM EMPLOYEE .How does it Respond? Ans)

Question 4: Create a Table CLIENT whose details are as below. Client(ClientID, LastName, FirstName, Balance, EmployeeID) ANS) Sql>create table CLIENT(clientID varchar2(10),LastName varchar2(10),FirstName varchar2(10), Balance number(8,2),EmployeeID varchar2(10));

Question 5: Provide the INSERT query to be used in CLIENT Table to fill the Details ANS) Sql>insert into CLIENT values(A101,Blake,James,12000.00,A101); 1 row created Sql>insert into CLIENT values(A102,Scott,Adam,1500.00,A102); 1 row created Sql>Commit;

Question 6: When we give SELECT * FROMCLIENT .How does it Respond? Ans)

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 data

Question 9: What are the different data types available in SQL server? ANS) Char,varchar2,long,number(p,s),number,date,raw,long raw,LOB,CLOB,BLOB,BFILE

Question 10: Which is the subset of SQL commands used to manipulate Oracle Database structures, includingtables? ANS) Data Definition Language Commands(DDL). DML commands cannot manipulate table structures

Question 11: What operator performs pattern matching? ANS) like operator

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 or @

Question 14: What is the parameter substitution symbol used with INSERT INTO command? ANS) & symbol

Question 15: Which command displays the SQL command in the SQL buffer, and then executes it? ANS) run command

Question 16: What are the wildcards used for pattern matching? ANS) % for multiple character matching _ for single character matching

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-relational negation operators

Question 19: What are the privileges that can be granted on a table by a user to others? ANS) alter,delete,index,insert,references,select,update

Question 20: What command is used to get back the privileges offered by the GRANT command? ANS) revoke command

Question 21: Which system tables contain information on privileges granted and privileges obtained? ANS) USER_TAB_PRIVS_MADE privileges granted USER_TAB_PRIVS_RECD privileges obtained

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) Truncate commits after deleting entire table and hence cannot be rolled back whereas we can roll back delete. Database triggers do not fire on truncate whereas database triggers fire on delete Since delete is a DML command we can use where clause to delete specific rows which is not possible in truncate because it is a DDL command.

Question 24: What command is used to create a table by copying the structure of another table? ANS) The syntax for copying the structure of table is Create table <tablename> as select * from <source table name> where <false condition>; Ex- create table Employee as select * from EMP where 1=0;

S-ar putea să vă placă și