This action might not be possible to undo. Are you sure you want to continue?
It specifies a default value for a new column or a new default for an existing column. Oracle assigns this value to the column if a subsequent INSERT statement omits a value for the column. A DEFAULT expression cannot contain references to other ... Disable Restricted Session How do you get back into SQLPlus to disable restricted session if you enabled. "When database is in restricted mode only users who have restricted permissions can log on to database"Â To disable itALTERÂ SYSTEM DISABLE RESTRICTED SESSION ... How many ways you can delete the table records? In how many ways can I delete all the contents of a table and the entire table. Explain with syntax? To delete the records in a table , there are 2 ways . 1.Using the delete statement 2.using the truncate statement . To delete the entire table drop statement is used . Deleting a record from a table :use the following statement. delete from table_name . User defined exception waste In which section of a PL/SQL block is a user defined exception waste? Latest Answer: In exception block ... List all customer (user id, name, and e-mail), number of charging List all customer (user id, name, and e-mail), number of charging, total charging,number of transaction and total number of transaction value?If u have these tables:1- 'Credit_card'columns: credit_number,type,value,Customer_ID.2-'Coupon'columns: Latest Answer: Hi, One of the solution is as follow: select cust.customer_id,fname,mname,lname,e_mail,credit.tot_credit+coupan.tot_coup no_of_recharge,credit.tot_credit_val+coupan.tot_coup_val tot_recharging,tot_trans,credit.tot_credit_val+coupan.tot_coup_val-current_balance ... What are the number datatypes allowed in a table? Latest Answer: There is no restiction on number of datatypes allowed except for long and LOB.I table can contain only one long column. ... How is the data inserted in the Index table when a new row is inserted into the main table on which
. How do you insert image file. they are :The block within the database file. Latest Answer: SELECT 'GRANT ' ||privilege ||' ON '||table_schema||'.e. it is a pseudo column that has a value for every row in a table.So a table having a column which is unique as well as not null apart from primar key is known as a candidate key. Row # within the block.. 2 . Explian the 18 character long ROWID? How it gets constructed? How we will identify each part of ROWID? Explian the 18 character long ROWID? How it gets constructed? How we will identify each part of ROWID? What is the fastest way of accessing a row in a table A ROWID is created by Oracle for each new row in every table..'dd/mm/yy hh:mi:ss') from dual. Database file ID.. The ROWID gives us the physical address of a row and is the fastest way to access any row..How is the data inserted in the Index table when a new row is inserted into the main table on which the index is created ? How can we use of select query to get the current date and time? Latest Answer: select to_char(sysdate. sound file using CLOB and BLOB.'||table_name ||' TO '|| USER ||' . . An example could be :000088C9.. . ...unique key along with Not NULL constraint has got a name i.Thanks. Latest Answer: In addition to all this. If you install SQL*PLUS in client. To display the all employee name with end of ‘S’ without using like operator ? Latest Answer: select employee_name from employees where substr(first_name..0002 What is the basic difference between primary key and (unique key along with Not NULL). So the SQL commands will be executed at the database only. How to grant all permission of one user to another user. where does SQL engine run. "candidate key".user name that has already access .0191. at server side or client side? Latest Answer: SQL plus doesn't have engine with that..' FROM ALL_TAB_PRIVSWHERE grantee ='TILITS' -. The ROWID contains 3 bits of information..-1)='s' ..
ROWNUM A FROM VW_MASTER ORDER BY SKU_CODE) WHERE A <= 500 Could anyone please explain about hash joins? Thanks.cartision join3. If using procedure/function then do not give commit in them. denoted by > Greater than or equal to. what is cascading how many types of queries are there How Multiple Transactions can be controlled ? Latest Answer: use savepoint after each DML statement.. denoted by >= Less than.. How many types of joins are there in oracle and what are the difference between them Latest Answer: There are four Type of joins in oracle1.f_lob blob. denoted by How many types of data base triggers are there....But in case of GO statement which is available In SQL Server(TSQL).'day') from emp order by to_char(hiredate-1.Latest Answer: --This code will insert a image into database create or replace PROCEDURE INSERT_BLOB(filE_namE IN VARCHAR2. 3 . outer join .BEGINdbms_output.self join4.'d') What is the difference between Commit and Go Latest Answer: Commit to like making all the changes permanently in the Server..SKU_NAME FROM (SELECT SKU_CODE.. the set of steps before the GO statement is complied at once and sent to server.dir_name varchar2)IStmp number. How can we order the column of day (mon to sun)such that monday comes first then tues and so no. what is cascading how many types of queries are there How many types of data base triggers are there.put_line('INSERT BLOB . denoted by < Less than or equal to. . What is theta join?? Latest Answer: Theta Joins Theta joins are joins that use any of the comparison operators: Greater than. bfile..Suppose select to_char(hiredate.SKU_NAME.. commit in proc/function will erase your savepoints.I mean from the beginning of the script .b_lob HOw to get /select the nth row from the table ?how to select first n rows ..last n rows from a table SELECT SKU_CODE... Inner join2.
. View is nothing but a set a sql statements together which join single or multiple tables and shows the data.. The main purpose of Materialized view is to do calculations and display data from multiple tables using joins.Latest Answer: in cases where a very small table is being joind to large table .where as the scope of ref cursor is global. It works faster than simple.regards pratyush singh .. View is a logical or virtual memory which is based on select query Whereas Materialized view is a concept mainly used in Data warehousing. Difference between a View and Materialized View Latest Answer: materialized view is physical duplicate data in a table view is logical representation of table. These views contain the data itself .oracle 8 and higher are supporting upto 1000 autonumber columns .. .minute ...second) if the date format is ddmon-yy?? 4 . How many autonumber columns are allowed? 255 autonumber columns till oracle 7..Reason being it is easier/faster to access the data.. here block/ programme means upto a end of procedure/function and only one fixed query can be attached to that cursor. ofcouse he can reset the new password What values are stored internally for time (hour. Generally ref cursor is used with . even DBA can not come to know what is the password. However views do not have the data themselves but point to the data...the oracle hash join will often dramatically speedup the querry hash join are for faster than nested loops join same cashes. Difference between view and table View is a subset of data derived from table update of data in table we can see in in view but update in view can not see in table. Its works as snap shot and used for security purposes and we can make DML command in materialize view How to decrypt the password on oracle 8/8i in system/scott user?what is the query fired to see the password? DBMS_OBFUSCATION_TOOLKIT package provides the encryption of password. We can add upto 1040 column in the table What is Ref cursor when we use ref cursor andadvantage of ref cursor Latest Answer: The scope of cursor is limited to a block/ programme.x.
Natural join is also called blind join. In an equi join we join tables with = operator only What is the function of 'force' in view? Latest Answer: "Force" option used to create a view without existance of Table in the databaseSyntax: Create or replace FORCE VIEW as select * from A table has following layout .. What is the difference between Inner and equi join? Latest Answer: Inner jon Or equi join is The query that retrives the rows that exact match using (=) sign in where clause . What is ALTER TABLE? HOW WE USE IT TO ADD A NEW ROW? 5 .. Inner joins are equi and non equi joins (<> . NAME .Latest Answer: In sqlserver 2005 we can use as follows to retreive the date part of the given date or sys dateselect datepart(dd.. SELECT * FROM (SELECT TABLE_NAME FROM USER_TABLES WHERE TABLE_NAME LIKE 'TEST')..selectÂ employee_id.If you dont want to use the table name directly in the query. SEXHow do you write a query to get the count of Male. It is modify structure A of database object such as table. count How do you set AutoComit off for DDL commands in Oracle Server? Is this Possible.Set autocommit on/off is used for DML.Above query will give the result as TEST.. An inner join is a type of join where we use = and <> in the where condition joining the tables..? For DDL commands. What is the condition to be follwed for the natural join syntax to be correct?? Latest Answer: It implicitly construct the join condition on the 2 tables taking all the column with same name into consideration. CITY. view and these commands have automatically commit. We cannot do autocommit off.... = conditions in the where clause ). you can create synonym for that table and can use that synonym in your . ..department_name from employees natural join departments. .getdate()) . How to execute the following query without using tempselect * from temp..last_name.
the values of the first query Latest Answer: UNION: Take the common record once( No Duplicate) UNION ALL : Takes Duplicates also Minus: Result of first query . one ROLLBACK statement is sufficient .for drop that column . Incase Of Workgroup .alter table table_name add column_name datatype.Example:select * from emp . 6 . in 9i sqlplus /nolog connect /as sysdba startup What is Snapshot in oracle 9i and what is different between view and Snapshot? Latest Answer: In Oracle 9i instead of snapshot we can use meterialized views which can act as snapshot.alter table table_name drop column_name datatype..the values of the first query are returned with the values of the second query eliminating duplicates..Right outer join)3) Full Join4) Cross Join5) Self Join1) inner Join : Two tables having the common column values go with inner join. what is the process of connecting to Database manually in oracle Database Latest Answer: The startup of database depends on the nature of Oracle server :Incase Of Enterprise Server and Unix Environment :Go to Unix and type the following commands :sqldba lmode=yconnect internalstartup This will start the Oracle Instance.Diff between view & snapshot is view is not a table its a virtual table to join one or more table or to prevent access from users on complete data on table.. .. MINUS..it's ..result of second queryexamleselect * from emp where rownum Explain the different types of joins Latest Answer: There are 5 types of joins available in sql server1) inner join2) outer join( left outer join. How to use command "COMMIT” and "ROLLBACK" in a transaction? COMMIT: it is used to make the manipulations ENABLE permanently on the table where as ROLLBACK is used to DISABLE the effect of the queries(which were typed a bit above it) on the table.... MINUS .by using alter table we can alter only column not the rows. by using alter command we write query like this. IS 'define' a valid SQL statement? Latest Answer: if DEFINE is isqlplus command then how do u define ACCEPT command...... Explain UNION. UNION ALL and INTERSECT UNION .... what is difference between them?i think define is a command in sql *plus which works same in isqlplus with ACCEPT...pls do forward the argument. whenever .
could by alhphabatic 7 ... Is it possible to access the current value in a session before accessing next value Latest Answer: Nextval must be used to generate a sequence number in the current user's session before currval can be referenced. .What is difference between TRUNCATE & DELETE TRUNCATE is a DDL command and cannot be rolled back. How do I eliminate the duplicate rows Latest Answer: With the help of Distinct function . . while leaving the foreign key or any other contraint in place.. type of trigger may be 12 . This means that the deletion of each row gets logged and physically deleted. If a View on a single base table is manipulated will the changes be reflected on the base table What is meant by SORTING and GROUPING Latest Answer: sorting mean puting the value in a particular order .. What is a transaction ? Transaction is logical unit between two commits and commit and rollback. Can a view be updated/inserted/deleted Latest Answer: If a view is based upon a single table then DML operations can be performed on it. .. while if a view is based upon more than two tables then it is a complex view and DML operations can be performed using instead of triggers. . All of the memory space is released back to the server.. can apply to a single table Latest Answer: there can be n number of trigger can have in a table . Latest Answer: A Transaction is a logical unit of work that comprises one or more SQL statements executed by a single user.. DELETE is a DML command and can be rolled DELETE is a logged operation on a per row basis... What is the maximum number of triggers. You can DELETE any row that will not violate a constraint....
the other pseudo columns are: user. . FULL OUTER JOIN . delete. sum(sal) from emp group by deptno order by . Explicit & Implicit crusors have same attributes. always uses the maximum length What are the different tablespaces in database There are only three tablespaces as follows:-1.SQL%ROW COUNT as implicit cursor attributes.varchar2(50) and our entry ia of 30 bute then it will only occupy 30 bute and other will b null. Subquery vs Join subquery is faster when we have to retrieve data from large number of tables. CHAR only store character.grouping mean making a group of same type of values and displaying a single row for that group example select deptno... rollback.. What are the different types of OUTER JOINS Latest Answer: LEFT OUTER JOIN. update. Currval. What are the different types of SQL DQL(Data Query Language) select DML(Data Manupulation Language) insert. merge DDL (Data Defination Language) Create.. alter.It can also store number as well as char. uses only the space allocated to it. open is there but it will always return "false" for implicit cursor ..uid .Permanent tablespace 2 . 8 .Because it becomes tedious to join more tables. SQL%NOT FOUND.. save point DCL (Data control Language) grant.. rowid FROM sometable Besides these.Undo tablespace 3. drop. when stored in a database table. RIGHT OUTER JOIN. Nextval Implicit Cursor attributes SQL%FOUND. truncate TCL (Transaction Control Language) Commit. sql% is not a valid implicit cursor attribute.. rename. join is faster to retrieve data from database when we have less number of tables What are the more common pseudo-columns SELECT rownum. revoke What is difference between CHAR and VARCHAR2 A varchar2 datatype.Temperory tablespace ...
What are the pre-requisites to modify datatype of a column and to add a column with NOT NULL constraint To modify the datatype of a column that should be empty. both r used 4 data restriction only. There are six types: A NOT NULL constraint prohibits a database value from being null.group by is used 4 grouping similar items If a view on a single base table is manipulated will the changes be reflected on the base table if a view based on one table or multiple table matter is it should contain all not null columns and additionaly no calculated column then ant DML statement will cause changes in base table.all database objects are stored in tablespaces.. What is a database link it is a way of connecting to remote database.-1 if a is less than 0 and 0 if a is 0 . scott@8i> create database link ora8idev 2 connect to scott 3 identified by tiger 9 . diff types of tablespaces:1)system tablespace.6)data and index tablespace. What is the output of SIGN function SIGN (a): Returns 1 if a is positive ..A tablespace is a collection of one or more datafiles. WHERE and GROUPBY in one SQL where condition we cann't use group function but having clause allows it.. 5)rollback tablespace. To add not null column the table must be empty if not then add the column as nullable then modify that column as not null.2) != 0 We can use the below query to get the even record of the table select r from (SELECT rownum r FROM EMP)where mod(r. A unique constraint prohibits multiple rows from having the same value in the .. Display Odd/ Even number of records We can use the below query to get the odd record of the table select r from (SELECT rownum r FROM EMP)where mod(r. The use of HAVING. but if increasing the width then it can be done even it holds the value.2)temp tablespace.3)tools tablespace4)users tablespace.2) = 0 What is an integrity constraint An integrity constraint is a rule that restricts the values in a database.
'Not Applicable'.0.3) test1. connect by clause can be used to select data that has a hierarchical relationship (usually some sort of parent->child (boss->employee or thing->parts). specified by numeric character positions.emp.4 using 'ora8idev' 5 / Database link created. Invalid_cursor . scott@8i> select * from dual@ora8idev. 'Not Applicable') FROM table_name. Select INSTR('Mississippi'.-2. To make a column unused you could have following command: SQL> Alter table <table name> set unused column <column name>.1. INSTR('Mississippi'.3) from dual. Test1 Test2 Test3 ___________________________________________ 11 8 2 SUBSTR function returns the section of thte specified string.0)..'i'.'i'. What are PL/SQL Cursor Exceptions Latest Answer: Cursor_already_open.comm) from scott. -. Explain CONNECT BY PRIOR it is used to get a tree type structure in data.3. How do I write the query select ename.3) test3 from dual.*. Select SUBSTR('The Three Musketeers'. level from emp a start with mgr is null connect by mgr = prior empno. How to drop the column in a table Alter table <table name> drop column <column name>.3) test2. select a. How to access the current value and next value from a sequence for current value the function is :.decode(nvl(comm.will return 'The'.currval and for the next value it is sequence_name.'i'...1. instead of blank space. The start with .nextval Difference between SUBSTR and INSTR INSTR function finds the numeric starting position of a string within a string. if commission is null then the text “Not Applicable” want to display. SELECT NVL (To_Char(comm). 10 .sequence_name. INSTR('Mississippi'.
A foreign key means the values in one table must also appear in another table. Also we cannot add primary key constraint to that column only not to the whole table. How will you activate/deactivate integrity constraints Alter table modify constraint < constraintname> disable/enableexamplealter table CONTACT_US modify constraint CONTACT_US_UK disable. Faster: view refers to a query which is already parsed. This constraint specifies a column or list of columns as a foreign key of the referencing table. Complexity: write a complex query and assign this query to a view so next time no need to write that complex query. And that column cannot be used in WHERE clause or in ORDER BY clause. that means we will give primary key to any column in the What is referential integrity constraint Referential Integrity Constraint is used to specify interdependencies between relations. order by clause A table can have only one long column How to drop the index 11 . How many LONG columns are allowed in a table Only one column can have LONG data type.What are the advantages of VIEW The advantages of View are: Security: only selected column from a table made available to view. A foreign key means the values in one table must also appear in another Is it possible to use LONG columns in WHERE clause or ORDER BY NO. Syntax: constraint <constraint name> references <primary table><primary key> Referential Integrity Constraint is used to specify interdependencies between relations. trigger makes the table in mutating state. so use of views in this scenario makes it easy. The referencing table is called the child table & referenced table is called the parent table. Long column can not used in where. so again it does not go to that stage efficient: while writing trigger a condition may arise. This constraint specifies a column or list of columns as a foreign key of the referencing table. The foreign key in the child table will generally reference a primary key in the parent table.
ename. nvl(to_char(mgr). Eg : Select deptno. sal from emp a where sal> (select avg(sal) from emp b where a. ename. Becoz sysdate contains date and time.if index is create by primary key /unique key constraint thenby droping the constriant . will it validate the rows that are inserted with sysdate Yes.deptno =b.deptno) order by deptno.'no manager') from emp. 12 . If unique key constraint on DATE column is created. mgr. the index will be droped automaticallyelsedrop index Other way to replace query result null value with a text select empno. What is ON DELETE CASCADE ON DELETE CASCADE option permits deletions of referenced key values in the parent table and automatically delete dependent rows in the child table to maintain referential integrity. the information from the outer select statement participates as a condition in the inner select statement. Any three PL/SQL Exceptions TOO_MANY_ROWS NO_DATA_FOUND INVALID_CURSORS CURSOR_ALREADY_OPEN DUP_VAL_ON_INDEX What is correlated sub-query In correlated subqueries.
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue listening from where you left off, or restart the preview.